@kungfu-tech/buildchain 2.8.2-alpha.1 → 2.8.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.
@@ -129,6 +129,9 @@ export function createBuildchainContractWorld({ root = process.cwd(), packageJso
129
129
  "release-passport-kfd-3-artifact-verify-command",
130
130
  "buildchain-contract-lock-path",
131
131
  "buildchain-contract-drift-issue-mode",
132
+ "github-release",
133
+ "github-release-title",
134
+ "github-release-notes",
132
135
  ],
133
136
  guarantees: [
134
137
  "promotion reuses PR-stage release-candidate artifacts",
@@ -136,6 +139,7 @@ export function createBuildchainContractWorld({ root = process.cwd(), packageJso
136
139
  "built source and promotion channel SHA are recorded separately",
137
140
  "contract drift is checked before release-candidate resolution and publish",
138
141
  "publish-gate source locks are created by the wrapper and enforced by promote-buildchain-ref before publish side effects",
142
+ "GitHub Release passport and evidence publication is delegated to promote-buildchain-ref after the semver release transaction completes",
139
143
  ],
140
144
  }),
141
145
  surface(root, {
@@ -158,11 +162,15 @@ export function createBuildchainContractWorld({ root = process.cwd(), packageJso
158
162
  "release-passport-kfd-3-prebuild-witness-jsons",
159
163
  "release-passport-kfd-3-artifact-witness-jsons",
160
164
  "release-passport-kfd-3-artifact-verify-command",
165
+ "github-release",
166
+ "github-release-title",
167
+ "github-release-notes",
161
168
  ],
162
169
  guarantees: [
163
170
  "protected release refs and durable release-state are finalized by Buildchain",
164
171
  "release passport finalization is idempotent after publish side effects",
165
172
  "publish transactions can require a resolved publish-gate source lock to prevent floating-ref drift",
173
+ "semver GitHub Releases are created or updated only after transaction completion, with prerelease/latest metadata derived from the exact tag",
166
174
  ],
167
175
  }),
168
176
  surface(root, {
@@ -273,6 +281,35 @@ export function createBuildchainContractWorld({ root = process.cwd(), packageJso
273
281
  "CLI commands are stable within the major line unless the contract major changes",
274
282
  ],
275
283
  }),
284
+ surface(root, {
285
+ id: "agent-manual-registry",
286
+ kind: "site-contract",
287
+ path: "dist/site/manual-registry.json",
288
+ requiredInputs: [],
289
+ requiredOutputs: ["manuals", "requiredAgentManuals"],
290
+ breakingDefaults: {
291
+ contract: "kungfu-buildchain-agent-manual-registry",
292
+ },
293
+ guarantees: [
294
+ "agent-facing packaged docs are enumerable from the npm package site bundle",
295
+ "manual entries carry source file digests so downstream sites and agents can detect stale hand-written documentation",
296
+ ],
297
+ }),
298
+ surface(root, {
299
+ id: "node-api-registry",
300
+ kind: "site-contract",
301
+ path: "dist/site/node-api-registry.json",
302
+ requiredInputs: [],
303
+ requiredOutputs: ["exports"],
304
+ breakingDefaults: {
305
+ contract: "kungfu-buildchain-node-api-registry",
306
+ moduleSystem: "module",
307
+ },
308
+ guarantees: [
309
+ "public Node import surfaces are derived from package.json exports",
310
+ "agents can discover supported Node APIs without importing internal file paths",
311
+ ],
312
+ }),
276
313
  ];
277
314
  const base = {
278
315
  schemaVersion: 1,
@@ -0,0 +1,488 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { createBuildchainContractWorld, sha256Json } from "./buildchain-contract.js";
5
+
6
+ export const BUILDCHAIN_KFD_CLAIM_REGISTRY_CONTRACT = "kungfu-buildchain-kfd-claim-registry";
7
+ export const BUILDCHAIN_KFD_COLLABORATION_INTERFACE_CONTRACT = "kungfu-buildchain-kfd-collaboration-interface";
8
+
9
+ export const BUILDCHAIN_AGENT_MANUALS = Object.freeze([
10
+ { id: "install", title: "Install and verify Buildchain", path: "docs/install.md", plane: "use" },
11
+ { id: "release-passport", title: "Release Passport protocol", path: "docs/release-passport.md", plane: "verify" },
12
+ { id: "release-propagation", title: "Release propagation", path: "docs/release-propagation.md", plane: "use" },
13
+ { id: "binary-distribution", title: "Binary distribution contract", path: "docs/binary-distribution.md", plane: "verify" },
14
+ { id: "toolkit-observability", title: "Toolkit observability", path: "docs/toolkit-observability.md", plane: "use" },
15
+ { id: "site-bundle-contract", title: "Site bundle contract", path: "docs/site-bundle-contract.md", plane: "use" },
16
+ { id: "product-mechanism", title: "Product mechanism", path: "docs/product-mechanism.md", plane: "why" },
17
+ { id: "cli", title: "CLI and npm package", path: "docs/cli.md", plane: "use" },
18
+ { id: "lifecycle-protocol", title: "Lifecycle protocol", path: "docs/lifecycle-protocol.md", plane: "use" },
19
+ { id: "reusable-build-surface", title: "Reusable build surface", path: "docs/reusable-build-surface.md", plane: "use" },
20
+ { id: "publish-transaction", title: "Publish transaction", path: "docs/publish-transaction.md", plane: "verify" },
21
+ { id: "release-governance", title: "Release governance", path: "docs/release-governance.md", plane: "why" },
22
+ { id: "release-flow", title: "Release flow", path: "docs/release-flow.md", plane: "verify" },
23
+ { id: "versioning", title: "Versioning", path: "docs/versioning.md", plane: "why" },
24
+ { id: "web-surface-deployments", title: "Web surface deployments", path: "docs/web-surface-deployments.md", plane: "use" },
25
+ { id: "infra-contract", title: "Infra Contract", path: "docs/infra-contract.md", plane: "use" },
26
+ ]);
27
+
28
+ const SITE_CONTRACT_FILES = Object.freeze([
29
+ "dist/site/buildchain-site.json",
30
+ "dist/site/site-manifest.json",
31
+ "dist/site/cli-registry.json",
32
+ "dist/site/manual-registry.json",
33
+ "dist/site/node-api-registry.json",
34
+ "dist/site/workflow-registry.json",
35
+ "dist/site/release-model.json",
36
+ "dist/site/artifact-schemas.json",
37
+ "dist/site/buildchain-contract.json",
38
+ "dist/site/product-mechanism.json",
39
+ "dist/site/release-provenance.json",
40
+ "dist/site/agent-index.json",
41
+ "dist/site/kfd-claims.json",
42
+ ]);
43
+
44
+ const SCHEMA_AND_STANDARD_FILES = Object.freeze([
45
+ "packages/core/kfd-gate.js",
46
+ "packages/core/release-passport.js",
47
+ "packages/core/buildchain-contract.js",
48
+ "packages/core/buildchain-kfd-claims.js",
49
+ "dist/site/artifact-schemas.json",
50
+ "dist/site/buildchain-contract.json",
51
+ ]);
52
+
53
+ const WORKFLOW_AND_ACTION_FILES = Object.freeze([
54
+ ".github/workflows/.build.yml",
55
+ ".github/workflows/release-candidate-promote.yml",
56
+ ".github/workflows/buildchain-ref-promotion.yml",
57
+ ".github/workflows/release-propagation.yml",
58
+ "actions/promote-buildchain-ref/action.yml",
59
+ "actions/promote-buildchain-ref/index.js",
60
+ ]);
61
+
62
+ const EXTRA_KFD1_FILES = Object.freeze([
63
+ "package.json",
64
+ "bin/buildchain.mjs",
65
+ "packages/core/index.js",
66
+ "packages/core/release-propagation.js",
67
+ "scripts/generate-site-bundle.mjs",
68
+ "scripts/ensure-github-release.mjs",
69
+ ]);
70
+
71
+ function readJson(root, relPath, fallback = {}) {
72
+ const filePath = path.join(root, relPath);
73
+ if (!fs.existsSync(filePath)) {
74
+ return fallback;
75
+ }
76
+ return JSON.parse(fs.readFileSync(filePath, "utf8"));
77
+ }
78
+
79
+ function fileExists(root, relPath) {
80
+ const filePath = path.join(root, relPath);
81
+ return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
82
+ }
83
+
84
+ function sha256File(root, relPath) {
85
+ return crypto.createHash("sha256").update(fs.readFileSync(path.join(root, relPath))).digest("hex");
86
+ }
87
+
88
+ function uniqueById(entries) {
89
+ const seen = new Set();
90
+ return entries.filter((entry) => {
91
+ if (seen.has(entry.id)) return false;
92
+ seen.add(entry.id);
93
+ return true;
94
+ });
95
+ }
96
+
97
+ function uniquePaths(paths) {
98
+ return [...new Set(paths.filter(Boolean))].sort();
99
+ }
100
+
101
+ function fileEvidence(root, relPath, extra = {}) {
102
+ const sha256 = fileExists(root, relPath) ? sha256File(root, relPath) : "";
103
+ return {
104
+ id: extra.id || relPath,
105
+ path: relPath,
106
+ sha256,
107
+ digest: sha256 ? `sha256:${sha256}` : "",
108
+ ...extra,
109
+ };
110
+ }
111
+
112
+ function packageJson(root) {
113
+ return readJson(root, "package.json", {});
114
+ }
115
+
116
+ function sourceMetadata({ root, sourceSha = "" } = {}) {
117
+ const pkg = packageJson(root);
118
+ return {
119
+ repo: "kungfu-systems/buildchain",
120
+ ref: sourceSha,
121
+ package: pkg.name || "@kungfu-tech/buildchain",
122
+ };
123
+ }
124
+
125
+ function runtimeContractSummary({ root = process.cwd() } = {}) {
126
+ const contractWorld = createBuildchainContractWorld({ root });
127
+ return {
128
+ contract: contractWorld.contract,
129
+ compatibilityDigest: contractWorld.compatibilityDigest,
130
+ majorLine: contractWorld.majorLine,
131
+ };
132
+ }
133
+
134
+ function surface(id, kind, relPath, extra = {}) {
135
+ return {
136
+ id,
137
+ name: extra.name || id,
138
+ kind,
139
+ sourcePath: relPath,
140
+ evidencePath: relPath,
141
+ availability: "shipped",
142
+ visibility: "public",
143
+ participantFacing: true,
144
+ public: true,
145
+ ...extra,
146
+ };
147
+ }
148
+
149
+ export function createBuildchainPublicClaimDefinitions() {
150
+ return [
151
+ {
152
+ id: "claim:buildchain-kfd-release-passport-support",
153
+ claim: "Buildchain release passports support KFD-1 self contract verification, KFD-2 public release claim audits, and KFD-3 collaboration-interface trust proofs.",
154
+ sourcePaths: [
155
+ "packages/core/release-passport.js",
156
+ "packages/core/kfd-gate.js",
157
+ "packages/core/buildchain-kfd-claims.js",
158
+ "docs/release-passport.md",
159
+ ],
160
+ artifactPaths: [
161
+ "dist/site/buildchain-contract.json",
162
+ "dist/site/kfd-claims.json",
163
+ "dist/site/artifact-schemas.json",
164
+ ],
165
+ },
166
+ {
167
+ id: "claim:buildchain-agent-first-source-of-truth",
168
+ claim: "The npm package ships Buildchain's agent-first manuals, Node API registry, site facts, and release model as the single source of truth for downstream sites and agents.",
169
+ sourcePaths: [
170
+ "scripts/generate-site-bundle.mjs",
171
+ "packages/core/buildchain-kfd-claims.js",
172
+ "docs/MAP.md",
173
+ "docs/site-bundle-contract.md",
174
+ "docs/cli.md",
175
+ ],
176
+ artifactPaths: [
177
+ "dist/site/manual-registry.json",
178
+ "dist/site/node-api-registry.json",
179
+ "dist/site/buildchain-site.json",
180
+ "dist/site/site-manifest.json",
181
+ ],
182
+ },
183
+ {
184
+ id: "claim:buildchain-floating-contract-lock",
185
+ claim: "Consumers using floating Buildchain refs can lock the observed runtime contract and receive drift checks before expensive build or publish work proceeds.",
186
+ sourcePaths: [
187
+ "packages/core/buildchain-contract.js",
188
+ "scripts/buildchain-contract-lock.mjs",
189
+ ".github/workflows/.build.yml",
190
+ ".github/workflows/release-candidate-promote.yml",
191
+ "docs/reusable-build-surface.md",
192
+ ],
193
+ artifactPaths: [
194
+ "dist/site/buildchain-contract.json",
195
+ "dist/site/release-model.json",
196
+ ],
197
+ },
198
+ {
199
+ id: "claim:buildchain-semver-github-release",
200
+ claim: "Semver promotion can create or update an exact-tag GitHub Release only after the publish transaction completes, and uploads Buildchain release passport/evidence assets.",
201
+ sourcePaths: [
202
+ "actions/promote-buildchain-ref/index.js",
203
+ "actions/promote-buildchain-ref/action.yml",
204
+ "scripts/ensure-github-release.mjs",
205
+ ".github/workflows/release-candidate-promote.yml",
206
+ "docs/release-governance.md",
207
+ ],
208
+ artifactPaths: [
209
+ "dist/site/release-model.json",
210
+ "dist/site/workflow-registry.json",
211
+ ],
212
+ },
213
+ {
214
+ id: "claim:buildchain-release-propagation",
215
+ claim: "Buildchain can propagate upstream alpha or stable releases to downstream repositories while preserving release channels through exact release locks.",
216
+ sourcePaths: [
217
+ "packages/core/release-propagation.js",
218
+ "scripts/release-propagation.mjs",
219
+ ".github/workflows/release-propagation.yml",
220
+ "docs/release-propagation.md",
221
+ ],
222
+ artifactPaths: [
223
+ "dist/site/release-model.json",
224
+ "dist/site/workflow-registry.json",
225
+ ],
226
+ },
227
+ {
228
+ id: "claim:buildchain-npm-publish-evidence",
229
+ claim: "Buildchain npm publish transactions bind trusted publishing, package-set required artifacts, publish evidence, durable release state, and final release passports.",
230
+ sourcePaths: [
231
+ "scripts/npm-publish-transaction.mjs",
232
+ "actions/promote-buildchain-ref/index.js",
233
+ ".github/workflows/release-candidate-promote.yml",
234
+ "docs/publish-transaction.md",
235
+ ],
236
+ artifactPaths: [
237
+ "dist/site/release-model.json",
238
+ "dist/site/artifact-schemas.json",
239
+ ],
240
+ },
241
+ ];
242
+ }
243
+
244
+ export function createBuildchainKfdSurfaceRegistry({ root = process.cwd() } = {}) {
245
+ const pkg = packageJson(root);
246
+ const exports = Object.entries(pkg.exports || {})
247
+ .filter(([specifier]) => !specifier.startsWith("./site/") && specifier !== "./package.json")
248
+ .map(([specifier, target]) => surface(
249
+ `export:${specifier}`,
250
+ "package-export",
251
+ String(target).replace(/^\.\//, ""),
252
+ {
253
+ packageExport: specifier,
254
+ name: specifier === "." ? pkg.name : `${pkg.name}/${specifier.replace(/^\.\//, "")}`,
255
+ },
256
+ ));
257
+ const docs = BUILDCHAIN_AGENT_MANUALS.map((manual) => surface(`doc:${manual.id}`, "documentation", manual.path, {
258
+ name: manual.title,
259
+ plane: manual.plane,
260
+ }));
261
+ const schemas = SCHEMA_AND_STANDARD_FILES.map((relPath) => surface(`schema:${relPath}`, "schema", relPath));
262
+ const standardsMetadata = [
263
+ surface("metadata:package-json", "standards-metadata", "package.json"),
264
+ surface("metadata:buildchain-contract-world", "standards-metadata", "dist/site/buildchain-contract.json"),
265
+ surface("metadata:kfd-claim-registry", "standards-metadata", "dist/site/kfd-claims.json"),
266
+ surface("metadata:release-model", "standards-metadata", "dist/site/release-model.json"),
267
+ ];
268
+ const siteConsumptionContracts = SITE_CONTRACT_FILES.map((relPath) => surface(`site:${relPath}`, "site-consumption-contract", relPath));
269
+ const controlSurfaces = WORKFLOW_AND_ACTION_FILES.map((relPath) => surface(`control:${relPath}`, relPath.includes("actions/") ? "action" : "workflow", relPath));
270
+ return {
271
+ schemaVersion: 1,
272
+ contract: BUILDCHAIN_KFD_COLLABORATION_INTERFACE_CONTRACT,
273
+ groups: {
274
+ docs,
275
+ schemas,
276
+ standardsMetadata,
277
+ packageExports: exports,
278
+ siteConsumptionContracts,
279
+ },
280
+ additionalSurfaces: controlSurfaces,
281
+ publicSurfaceCount: docs.length + schemas.length + standardsMetadata.length + exports.length + siteConsumptionContracts.length + controlSurfaces.length,
282
+ };
283
+ }
284
+
285
+ export function createBuildchainKfdClaimRegistry({ root = process.cwd(), sourceSha = "" } = {}) {
286
+ return {
287
+ schemaVersion: 1,
288
+ contract: BUILDCHAIN_KFD_CLAIM_REGISTRY_CONTRACT,
289
+ product: {
290
+ name: "Buildchain",
291
+ package: packageJson(root).name || "@kungfu-tech/buildchain",
292
+ repository: "kungfu-systems/buildchain",
293
+ },
294
+ source: {
295
+ ...sourceMetadata({ root, sourceSha }),
296
+ sourceModule: "packages/core/buildchain-kfd-claims.js",
297
+ },
298
+ runtimeContract: runtimeContractSummary({ root }),
299
+ publicClaims: createBuildchainPublicClaimDefinitions(),
300
+ collaborationSurfaces: createBuildchainKfdSurfaceRegistry({ root }),
301
+ };
302
+ }
303
+
304
+ export function createBuildchainKfd1Witness({ root = process.cwd(), sourceSha = "" } = {}) {
305
+ const registry = createBuildchainKfdClaimRegistry({ root, sourceSha });
306
+ const registrySha256 = sha256Json(registry);
307
+ const paths = uniquePaths([
308
+ ...BUILDCHAIN_AGENT_MANUALS.map((entry) => entry.path),
309
+ ...SCHEMA_AND_STANDARD_FILES,
310
+ ...SITE_CONTRACT_FILES,
311
+ ...WORKFLOW_AND_ACTION_FILES,
312
+ ...EXTRA_KFD1_FILES,
313
+ ]);
314
+ return {
315
+ schemaVersion: 1,
316
+ id: "buildchain-self-contract-world",
317
+ standard: "kfd-1",
318
+ source: sourceMetadata({ root, sourceSha }),
319
+ contractWorld: {
320
+ id: "buildchain-runtime-contract-world",
321
+ schemaId: "kungfu-buildchain-runtime-contract-world",
322
+ digest: `sha256:${registrySha256}`,
323
+ owner: "Buildchain maintainers",
324
+ selfHosted: true,
325
+ },
326
+ standardContract: {
327
+ id: "buildchain-kfd-claim-registry",
328
+ path: "dist/site/kfd-claims.json",
329
+ sha256: fileExists(root, "dist/site/kfd-claims.json") ? sha256File(root, "dist/site/kfd-claims.json") : "",
330
+ },
331
+ selfHostingBoundary: {
332
+ mode: "self-hosted-standard-contract",
333
+ sourceScope: "Buildchain KFD claim registry, release-passport schemas, manuals, Node API exports, workflows, and site-consumption contracts",
334
+ artifactScope: "packaged npm files and release passport evidence assets",
335
+ boundary: "declared source files must match packaged artifact bytes by sha256",
336
+ residualRisk: [],
337
+ },
338
+ responsibility: {
339
+ sourceContractOwner: "Buildchain maintainers",
340
+ artifactVerificationOwner: "Buildchain KFD-1 release gate",
341
+ releasePassportProofOwner: "Buildchain",
342
+ },
343
+ surfaces: paths.map((relPath) => {
344
+ const sha256 = fileExists(root, relPath) ? sha256File(root, relPath) : "";
345
+ return {
346
+ name: relPath,
347
+ sourcePath: relPath,
348
+ sourceSha256: sha256,
349
+ artifactPath: relPath,
350
+ expectedSha256: sha256,
351
+ byteForByte: true,
352
+ };
353
+ }),
354
+ };
355
+ }
356
+
357
+ export function createBuildchainKfd3PrebuildWitness({ root = process.cwd(), sourceSha = "" } = {}) {
358
+ const registry = createBuildchainKfdClaimRegistry({ root, sourceSha });
359
+ const surfaces = createBuildchainKfdSurfaceRegistry({ root });
360
+ const digest = `sha256:${sha256Json(registry)}`;
361
+ return {
362
+ schemaVersion: 1,
363
+ id: "buildchain-collaboration-interface",
364
+ standard: "kfd-3",
365
+ supportLevel: "release",
366
+ source: sourceMetadata({ root, sourceSha }),
367
+ sourceRegistry: {
368
+ id: "Buildchain KFD claim registry",
369
+ path: "dist/site/kfd-claims.json",
370
+ sha256: fileExists(root, "dist/site/kfd-claims.json") ? sha256File(root, "dist/site/kfd-claims.json") : "",
371
+ },
372
+ collaborationInterfaceDigest: digest,
373
+ collaborationInterface: {
374
+ schemaVersion: 1,
375
+ contract: BUILDCHAIN_KFD_COLLABORATION_INTERFACE_CONTRACT,
376
+ product: {
377
+ name: "Buildchain",
378
+ repository: "kungfu-systems/buildchain",
379
+ package: packageJson(root).name || "@kungfu-tech/buildchain",
380
+ },
381
+ participants: [
382
+ { id: "human-release-operator", kind: "human" },
383
+ { id: "agent-consumer", kind: "agent" },
384
+ { id: "downstream-site", kind: "site" },
385
+ ],
386
+ docs: surfaces.groups.docs,
387
+ schemas: surfaces.groups.schemas,
388
+ standardsMetadata: surfaces.groups.standardsMetadata,
389
+ packageExports: surfaces.groups.packageExports,
390
+ siteConsumptionContracts: surfaces.groups.siteConsumptionContracts,
391
+ surfaces: surfaces.additionalSurfaces,
392
+ closure: {
393
+ classificationMode: "closed-world",
394
+ reachableSurfaceMode: "declared-boundary",
395
+ unclassifiedEntrypointsPolicy: "fail",
396
+ nonExhaustivelyEnumerableSurfaces: [],
397
+ explicitlyExemptedSurfaces: [],
398
+ },
399
+ },
400
+ auditBoundary: {
401
+ mode: "closed-world",
402
+ scope: "Buildchain public human/agent release, workflow, package, and site-consumption surfaces",
403
+ reachableSurfaceMode: "declared-boundary",
404
+ unclassifiedPolicy: "fail",
405
+ nonExhaustivelyEnumerableSurfaces: [],
406
+ explicitlyExemptedSurfaces: [],
407
+ },
408
+ residualRisk: [],
409
+ responsibility: {
410
+ registryFactsOwner: "Buildchain maintainers",
411
+ artifactVerificationOwner: "Buildchain KFD-3 release gate",
412
+ releasePassportProofOwner: "Buildchain",
413
+ },
414
+ };
415
+ }
416
+
417
+ export function createBuildchainKfd3ArtifactWitness({ root = process.cwd(), sourceSha = "" } = {}) {
418
+ const registry = createBuildchainKfdClaimRegistry({ root, sourceSha });
419
+ const surfaces = createBuildchainKfdSurfaceRegistry({ root });
420
+ return {
421
+ schemaVersion: 1,
422
+ id: "buildchain-collaboration-interface",
423
+ standard: "kfd-3",
424
+ sourceRegistry: {
425
+ id: "Buildchain KFD claim registry",
426
+ path: "dist/site/kfd-claims.json",
427
+ sha256: fileExists(root, "dist/site/kfd-claims.json") ? sha256File(root, "dist/site/kfd-claims.json") : "",
428
+ },
429
+ collaborationInterfaceDigest: `sha256:${sha256Json(registry)}`,
430
+ artifact: {
431
+ name: packageJson(root).name || "@kungfu-tech/buildchain",
432
+ path: "package.json",
433
+ digest: fileExists(root, "package.json") ? `sha256:${sha256File(root, "package.json")}` : "",
434
+ },
435
+ docs: surfaces.groups.docs,
436
+ schemas: surfaces.groups.schemas,
437
+ standardsMetadata: surfaces.groups.standardsMetadata,
438
+ packageExports: surfaces.groups.packageExports,
439
+ siteConsumptionContracts: surfaces.groups.siteConsumptionContracts,
440
+ surfaces: surfaces.additionalSurfaces,
441
+ verifier: {
442
+ name: "Buildchain self KFD witness generator",
443
+ source: "scripts/generate-buildchain-kfd-witnesses.mjs",
444
+ },
445
+ };
446
+ }
447
+
448
+ export function createBuildchainKfd2Claims({ root = process.cwd(), witnessFiles = {} } = {}) {
449
+ const evidenceFiles = Object.entries(witnessFiles)
450
+ .filter(([, relPath]) => relPath)
451
+ .map(([id, relPath]) => fileEvidence(root, relPath, { id }));
452
+ return createBuildchainPublicClaimDefinitions().map((definition) => {
453
+ const sourceBindings = uniqueById(definition.sourcePaths.map((relPath) => fileEvidence(root, relPath)));
454
+ const artifacts = uniqueById(definition.artifactPaths.map((relPath) => fileEvidence(root, relPath)));
455
+ const machineEvidence = [
456
+ ...evidenceFiles,
457
+ { id: "buildchain-kfd-claim-definition", digest: `sha256:${sha256Json(definition)}` },
458
+ ];
459
+ return {
460
+ id: definition.id,
461
+ public: true,
462
+ claim: definition.claim,
463
+ sourceBindings,
464
+ machineEvidence,
465
+ hashes: {
466
+ definitionSha256: sha256Json(definition),
467
+ sourceBindingsSha256: sha256Json(sourceBindings),
468
+ machineEvidenceSha256: sha256Json(machineEvidence),
469
+ artifactsSha256: sha256Json(artifacts),
470
+ },
471
+ artifacts,
472
+ verification: {
473
+ result: "passed",
474
+ method: "Buildchain self KFD claim registry and release witness generation",
475
+ },
476
+ auditBoundary: {
477
+ mode: "closed-world",
478
+ scope: "Buildchain declared public release claims for packaged docs, workflows, actions, Node exports, site facts, npm publish, GitHub Release, release propagation, and KFD passport support",
479
+ },
480
+ responsibility: {
481
+ owner: "Buildchain maintainers",
482
+ sourceOwner: "Buildchain maintainers",
483
+ releasePassportProofOwner: "Buildchain",
484
+ },
485
+ residualRisk: [],
486
+ };
487
+ });
488
+ }
@@ -137,6 +137,19 @@ export {
137
137
  validateKfd3CollaborationInterfaceReleaseGateEvidence,
138
138
  } from "./kfd-gate.js";
139
139
 
140
+ export {
141
+ BUILDCHAIN_AGENT_MANUALS,
142
+ BUILDCHAIN_KFD_CLAIM_REGISTRY_CONTRACT,
143
+ BUILDCHAIN_KFD_COLLABORATION_INTERFACE_CONTRACT,
144
+ createBuildchainKfd1Witness,
145
+ createBuildchainKfd2Claims,
146
+ createBuildchainKfd3ArtifactWitness,
147
+ createBuildchainKfd3PrebuildWitness,
148
+ createBuildchainKfdClaimRegistry,
149
+ createBuildchainKfdSurfaceRegistry,
150
+ createBuildchainPublicClaimDefinitions,
151
+ } from "./buildchain-kfd-claims.js";
152
+
140
153
  export {
141
154
  AGENT_INDEX_CONTRACT,
142
155
  ARTIFACT_EVIDENCE_CONTRACT,