@kungfu-tech/buildchain 4.0.1-alpha.5 → 4.0.1-alpha.6

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.
Files changed (79) hide show
  1. package/actions/release-tail/README.md +8 -0
  2. package/architecture/internal-capabilities.json +65 -5
  3. package/architecture/maintainability-policy.json +22 -16
  4. package/architecture/release-tail-contract-inventory.json +5 -2
  5. package/architecture/v4-adopter-delivery-parity.json +32 -5
  6. package/architecture/v4-publication-rehearsal-parity.json +84 -0
  7. package/bin/buildchain.mjs +7 -1
  8. package/bin/internal/adopter-delivery-cli.mjs +70 -0
  9. package/bin/internal/command-registry.mjs +1 -0
  10. package/contracts/fixtures/v4-adopter-delivery-v1/archive-template.json +19 -0
  11. package/contracts/fixtures/v4-adopter-delivery-v1/bootstrap-positive.json +93 -0
  12. package/contracts/fixtures/v4-adopter-delivery-v1/gate-positive.json +29 -0
  13. package/contracts/fixtures/v4-adopter-delivery-v1/gate-unknown-selector.json +26 -0
  14. package/contracts/fixtures/v4-adopter-delivery-v1/offline-vectors.json +50 -0
  15. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/artifacts/product.bin +1 -0
  16. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/config/buildchain.toml +5 -0
  17. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/documents/release-activation.json +1 -0
  18. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/documents/signed-channel.json +1 -0
  19. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/evidence/qualification.json +1 -0
  20. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/manifests/candidate.json +5 -0
  21. package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/manifests/release-passport.json +1 -0
  22. package/contracts/fixtures/v4-publication-rehearsal-v1/capsule.json +707 -0
  23. package/contracts/fixtures/v4-publication-rehearsal-v1/offline-vectors.json +27 -0
  24. package/contracts/v4-adopter-delivery-v1.schema.json +81 -0
  25. package/contracts/v4-publication-rehearsal-capsule-v1.schema.json +233 -0
  26. package/dist/site/agent-index.json +3 -0
  27. package/dist/site/artifact-schemas.json +6 -0
  28. package/dist/site/buildchain-contract.json +14 -14
  29. package/dist/site/buildchain-site.json +219 -22
  30. package/dist/site/capability-registry.json +10 -9
  31. package/dist/site/cli-registry.json +53 -1
  32. package/dist/site/kfd-claims.json +253 -14
  33. package/dist/site/kfd-upstream-aggregate.json +1 -1
  34. package/dist/site/manual-registry.json +20 -5
  35. package/dist/site/node-api-registry.json +11501 -9312
  36. package/dist/site/page-registry.json +202 -13
  37. package/dist/site/public-surface-audit.json +195 -11
  38. package/dist/site/publication-authority-registry.json +17 -4
  39. package/dist/site/publication-registry.json +4 -4
  40. package/dist/site/release-provenance.json +14 -0
  41. package/dist/site/schemas/release-tail-capabilities-v1.schema.json +199 -0
  42. package/dist/site/schemas/v4-adopter-delivery-v1.schema.json +81 -0
  43. package/dist/site/schemas/v4-publication-rehearsal-capsule-v1.schema.json +233 -0
  44. package/dist/site/site-manifest.json +17 -9
  45. package/dist/site/workflow-registry.json +89 -8
  46. package/docs/MAP.md +3 -1
  47. package/docs/cli-reference.md +68 -0
  48. package/docs/cli.md +8 -0
  49. package/docs/node-api-reference.md +198 -51
  50. package/docs/release-tail-provider-plane.md +30 -0
  51. package/docs/v4-adopter-delivery.md +133 -0
  52. package/docs/v4-publication-rehearsal.md +130 -0
  53. package/package.json +17 -3
  54. package/packages/core/adopter-delivery-passport.js +259 -0
  55. package/packages/core/adopter-delivery-vectors.js +158 -0
  56. package/packages/core/adopter-delivery-vectors.json +77 -0
  57. package/packages/core/buildchain-agent-manuals.js +1 -0
  58. package/packages/core/buildchain-config.js +84 -0
  59. package/packages/core/buildchain-delivery-bootstrap.js +240 -0
  60. package/packages/core/buildchain-delivery-infrastructure.js +164 -0
  61. package/packages/core/buildchain-delivery-self-dogfood.js +395 -0
  62. package/packages/core/legacy-kfd-adopter-driver.js +167 -0
  63. package/packages/core/published-delivery-authority.js +266 -0
  64. package/packages/core/release-passport.js +26 -8
  65. package/packages/core/v4-adopter-delivery-parity.js +3 -3
  66. package/packages/core/v4-adopter-delivery.js +359 -0
  67. package/packages/core/v4-publication-rehearsal-capsule.js +468 -0
  68. package/packages/core/v4-publication-rehearsal-provider-bindings.js +212 -0
  69. package/packages/core/v4-publication-rehearsal.js +481 -0
  70. package/scripts/buildchain-cli-help.mjs +10 -0
  71. package/scripts/check-inventory.mjs +3 -3
  72. package/scripts/dev-delivery-source-proof-replay.mjs +153 -0
  73. package/scripts/dev-delivery-source-proof-reuse.mjs +13 -97
  74. package/scripts/generate-release-candidate-passport.mjs +152 -0
  75. package/scripts/generate-site-bundle.mjs +30 -0
  76. package/scripts/release-tail.mjs +51 -3
  77. package/scripts/resume-from-candidate-run.mjs +545 -15
  78. package/scripts/site-capability-metadata.mjs +16 -0
  79. package/scripts/v4-publication-rehearsal-fixture.mjs +144 -0
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env node
2
+
3
+ import crypto from "node:crypto";
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ import {
9
+ createV4PublicationRehearsalCapsule,
10
+ executeV4PublicationRehearsal,
11
+ } from "../packages/core/v4-publication-rehearsal.js";
12
+
13
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
14
+ const fixtureRoot = path.join(
15
+ root,
16
+ "contracts/fixtures/v4-publication-rehearsal-v1",
17
+ );
18
+ const candidateRoot = path.join(fixtureRoot, "candidate");
19
+
20
+ function digest(bytes) {
21
+ return `sha256:${crypto.createHash("sha256").update(bytes).digest("hex")}`;
22
+ }
23
+
24
+ function candidateFiles() {
25
+ const roles = {
26
+ "artifacts/product.bin": "installable-product",
27
+ "config/buildchain.toml": "buildchain-config",
28
+ "documents/release-activation.json": "release-activation-document",
29
+ "documents/signed-channel.json": "signed-channel-document",
30
+ "evidence/qualification.json": "qualification-evidence",
31
+ "manifests/candidate.json": "candidate-manifest",
32
+ "manifests/release-passport.json": "release-passport",
33
+ };
34
+ return Object.keys(roles)
35
+ .map((relative) => {
36
+ const bytes = fs.readFileSync(path.join(candidateRoot, relative));
37
+ return {
38
+ role: roles[relative],
39
+ path: relative,
40
+ size: bytes.length,
41
+ root: digest(bytes),
42
+ };
43
+ })
44
+ .sort((left, right) =>
45
+ Buffer.from(left.path).compare(Buffer.from(right.path)),
46
+ );
47
+ }
48
+
49
+ async function generated() {
50
+ const declaration = JSON.parse(
51
+ fs.readFileSync(
52
+ path.join(
53
+ root,
54
+ "contracts/fixtures/release-tail-capabilities-v1/kungfu-alpha.json",
55
+ ),
56
+ "utf8",
57
+ ),
58
+ );
59
+ const files = candidateFiles();
60
+ const binding = (relative) => ({
61
+ path: relative,
62
+ root: files.find((entry) => entry.path === relative).root,
63
+ });
64
+ const capsule = createV4PublicationRehearsalCapsule({
65
+ source: {
66
+ repository: "kungfu-systems/buildchain",
67
+ revision: "bc12cd0ff18a7e1d918777ea093c169349952d34",
68
+ },
69
+ declaration,
70
+ manifest: binding("manifests/candidate.json"),
71
+ config: binding("config/buildchain.toml"),
72
+ providerBindings: {
73
+ schema: "kungfu.buildchain.release-tail.provider-bindings/v1",
74
+ artifacts: {
75
+ "installable-product": {
76
+ path: "artifacts/product.bin",
77
+ name: "product.bin",
78
+ },
79
+ "release-passport": {
80
+ path: "manifests/release-passport.json",
81
+ name: "release-passport.json",
82
+ },
83
+ },
84
+ documents: {
85
+ "release.activate": {
86
+ path: "documents/release-activation.json",
87
+ method: "PUT",
88
+ },
89
+ "signed-channel.commit": {
90
+ path: "documents/signed-channel.json",
91
+ method: "PUT",
92
+ },
93
+ },
94
+ evidence: {
95
+ inputs: ["evidence/qualification.json"],
96
+ output: "generated/released-evidence.json",
97
+ },
98
+ },
99
+ files,
100
+ });
101
+ const vectors = [];
102
+ for (const platform of ["linux", "macos", "windows"]) {
103
+ const result = await executeV4PublicationRehearsal({
104
+ capsule,
105
+ candidateRoot,
106
+ mode: "simulate",
107
+ });
108
+ vectors.push({
109
+ platform,
110
+ capsuleRoot: result.evidence.capsuleRoot,
111
+ transactionRoot: result.evidence.transactionRoot,
112
+ stateRoot: result.evidence.stateRoot,
113
+ evidenceRoot: result.evidence.evidenceRoot,
114
+ });
115
+ }
116
+ return {
117
+ capsule,
118
+ vectors: {
119
+ schema: "buildchain-v4-publication-rehearsal-offline-vectors/v1",
120
+ vectors,
121
+ vectorRoot: digest(JSON.stringify(vectors)),
122
+ },
123
+ };
124
+ }
125
+
126
+ const { capsule, vectors } = await generated();
127
+ const outputs = new Map([
128
+ [path.join(fixtureRoot, "capsule.json"), capsule],
129
+ [path.join(fixtureRoot, "offline-vectors.json"), vectors],
130
+ ]);
131
+ const check = process.argv.includes("--check");
132
+ for (const [file, value] of outputs) {
133
+ const bytes = `${JSON.stringify(value, null, 2)}\n`;
134
+ if (check) {
135
+ if (!fs.existsSync(file) || fs.readFileSync(file, "utf8") !== bytes)
136
+ throw new Error(`${path.relative(root, file)} is stale`);
137
+ } else {
138
+ fs.mkdirSync(path.dirname(file), { recursive: true });
139
+ fs.writeFileSync(file, bytes);
140
+ }
141
+ }
142
+ process.stdout.write(
143
+ `${JSON.stringify({ capsuleRoot: capsule.capsuleRoot, vectorRoot: vectors.vectorRoot })}\n`,
144
+ );