@kungfu-tech/buildchain 4.0.1-alpha.20 → 4.0.1-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.
@@ -4,7 +4,7 @@
4
4
  "product": {
5
5
  "name": "Buildchain",
6
6
  "package": "@kungfu-tech/buildchain",
7
- "version": "4.0.1-alpha.20",
7
+ "version": "4.0.1-alpha.22",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "majorLine": "v4",
@@ -5308,5 +5308,5 @@
5308
5308
  "compatibilityFactCutRoot": "sha256:f61b975d4a96c921cc4bd37fb3ed9a0596b47004fe34dc7219979d697e3707f9",
5309
5309
  "compatibilityProofRegistryRoot": "sha256:b7194b811e4d3af2df4390bc4d1731e16a86215bd64ee18cb630dd5492f4fb63",
5310
5310
  "compatibilityDigest": "sha256:5de1c69386510b74b17eb70141b8bdd07063d62c504f91db5e84b67c6d4b64a2",
5311
- "contractDigest": "sha256:60d147cd9822082d40118af74840510b4f26dec29a8316855a06a12a6ce855d4"
5311
+ "contractDigest": "sha256:e65aac67dd6571c61badfbbe5beb47b504c6973d696047c95f12955149911bc5"
5312
5312
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-site-bundle",
4
- "generatedAt": "2026-08-23T03:02:01.541Z",
5
- "publishedAt": "2026-08-23T03:02:01.541Z",
4
+ "generatedAt": "2026-08-23T05:29:03.118Z",
5
+ "publishedAt": "2026-08-23T05:29:03.118Z",
6
6
  "reproducible": true,
7
7
  "timestampPolicy": "ci-injected",
8
8
  "deterministicInputs": [
@@ -19,7 +19,7 @@
19
19
  "declared Buildchain surface manifest contract"
20
20
  ],
21
21
  "sourceDateEpoch": "0",
22
- "sourceRevision": "498d822822d352cce5c71ef21f3f12ae67c0cb68",
22
+ "sourceRevision": "403ed0fb1805899292067e6eea6cee48468594e1",
23
23
  "timestampPolicyDetails": {
24
24
  "contract": "kungfu-buildchain-surface-timestamp-policy",
25
25
  "timestampFields": [
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "package": {
39
39
  "name": "@kungfu-tech/buildchain",
40
- "version": "4.0.1-alpha.20",
40
+ "version": "4.0.1-alpha.22",
41
41
  "versionSource": "package.json#version"
42
42
  },
43
43
  "source": {
@@ -21,7 +21,7 @@
21
21
  "contract": "kungfu-buildchain-public-surface-reverse-audit",
22
22
  "path": "dist/site/public-surface-audit.json",
23
23
  "status": "passed",
24
- "sha256": "1250f1c595c4dddc1c8fbd5b3b3070673267ddc86628cd9ace1c119e2ce45114",
24
+ "sha256": "0ed832b670bbff7588d73520698f981cd8d98f58378b53d68def2bcc7d9bfb44",
25
25
  "summary": {
26
26
  "cliCommandCount": 117,
27
27
  "workflowCount": 76,
@@ -246,7 +246,7 @@
246
246
  "contract": "kungfu-buildchain-public-surface-reverse-audit",
247
247
  "path": "dist/site/public-surface-audit.json",
248
248
  "status": "passed",
249
- "sha256": "1250f1c595c4dddc1c8fbd5b3b3070673267ddc86628cd9ace1c119e2ce45114",
249
+ "sha256": "0ed832b670bbff7588d73520698f981cd8d98f58378b53d68def2bcc7d9bfb44",
250
250
  "summary": {
251
251
  "cliCommandCount": 117,
252
252
  "workflowCount": 76,
@@ -4,7 +4,7 @@
4
4
  "product": {
5
5
  "id": "kungfu-tech-buildchain",
6
6
  "name": "@kungfu-tech/buildchain",
7
- "version": "4.0.1-alpha.20",
7
+ "version": "4.0.1-alpha.22",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "source": {
@@ -8846,7 +8846,7 @@
8846
8846
  "workflowRegistryPath": "dist/site/workflow-registry.json",
8847
8847
  "pageRegistryPath": "dist/site/page-registry.json",
8848
8848
  "cliRegistryDigest": "ea47a31ce7ef3577f23e22055ab7be7715c3af494bcef63f76b426f2883086aa",
8849
- "workflowRegistryDigest": "7be3308092b1e0666e0fce6a7fd246e952d3b03c1ebe74c895a83e6d7829fa16",
8849
+ "workflowRegistryDigest": "64e90e170742621cb64818554a05430919127d4484aa909aef6b767b5c9376d3",
8850
8850
  "pageRegistryDigest": "9d9d0590c8d3110fc5a95978852ee25337567f93980b2562cc1159f0d5219ade"
8851
8851
  },
8852
8852
  "comparison": {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-publication-release-registry",
4
- "generatedAt": "2026-08-23T03:02:01.541Z",
5
- "publishedAt": "2026-08-23T03:02:01.541Z",
4
+ "generatedAt": "2026-08-23T05:29:03.118Z",
5
+ "publishedAt": "2026-08-23T05:29:03.118Z",
6
6
  "reproducible": true,
7
7
  "timestampPolicy": "ci-injected",
8
8
  "deterministicInputs": [
@@ -19,7 +19,7 @@
19
19
  "declared Buildchain surface manifest contract"
20
20
  ],
21
21
  "sourceDateEpoch": "0",
22
- "sourceRevision": "498d822822d352cce5c71ef21f3f12ae67c0cb68",
22
+ "sourceRevision": "403ed0fb1805899292067e6eea6cee48468594e1",
23
23
  "timestampPolicyDetails": {
24
24
  "contract": "kungfu-buildchain-surface-timestamp-policy",
25
25
  "timestampFields": [
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "package": {
34
34
  "name": "@kungfu-tech/buildchain",
35
- "version": "4.0.1-alpha.20",
35
+ "version": "4.0.1-alpha.22",
36
36
  "versionSource": "package.json#version"
37
37
  },
38
38
  "sourceKind": "package-site-bundle",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-site-manifest",
4
- "generatedAt": "2026-08-23T03:02:01.541Z",
5
- "publishedAt": "2026-08-23T03:02:01.541Z",
4
+ "generatedAt": "2026-08-23T05:29:03.118Z",
5
+ "publishedAt": "2026-08-23T05:29:03.118Z",
6
6
  "reproducible": true,
7
7
  "timestampPolicy": "ci-injected",
8
8
  "deterministicInputs": [
@@ -19,7 +19,7 @@
19
19
  "declared Buildchain surface manifest contract"
20
20
  ],
21
21
  "sourceDateEpoch": "0",
22
- "sourceRevision": "498d822822d352cce5c71ef21f3f12ae67c0cb68",
22
+ "sourceRevision": "403ed0fb1805899292067e6eea6cee48468594e1",
23
23
  "timestampPolicyDetails": {
24
24
  "contract": "kungfu-buildchain-surface-timestamp-policy",
25
25
  "timestampFields": [
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "package": {
39
39
  "name": "@kungfu-tech/buildchain",
40
- "version": "4.0.1-alpha.20",
40
+ "version": "4.0.1-alpha.22",
41
41
  "versionSource": "package.json#version"
42
42
  },
43
43
  "entrypoint": "buildchain-site.json",
@@ -2027,7 +2027,7 @@
2027
2027
  "status": "preview",
2028
2028
  "owner": "buildchain-workflows",
2029
2029
  "maturity": "preview",
2030
- "introducedVersion": "4.0.1-alpha.20",
2030
+ "introducedVersion": "4.0.1-alpha.22",
2031
2031
  "compatibilityPromise": "preserved-through-the-v3-major-line",
2032
2032
  "deprecationReplacement": "",
2033
2033
  "sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
@@ -2048,7 +2048,7 @@
2048
2048
  "status": "preview",
2049
2049
  "owner": "buildchain-workflows",
2050
2050
  "maturity": "preview",
2051
- "introducedVersion": "4.0.1-alpha.20",
2051
+ "introducedVersion": "4.0.1-alpha.22",
2052
2052
  "compatibilityPromise": "preserved-through-the-v3-major-line",
2053
2053
  "deprecationReplacement": "",
2054
2054
  "sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
@@ -2069,7 +2069,7 @@
2069
2069
  "status": "preview",
2070
2070
  "owner": "buildchain-workflows",
2071
2071
  "maturity": "preview",
2072
- "introducedVersion": "4.0.1-alpha.20",
2072
+ "introducedVersion": "4.0.1-alpha.22",
2073
2073
  "compatibilityPromise": "preserved-through-the-v3-major-line",
2074
2074
  "deprecationReplacement": "",
2075
2075
  "sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
@@ -2119,7 +2119,7 @@
2119
2119
  "status": "preview",
2120
2120
  "owner": "buildchain-workflows",
2121
2121
  "maturity": "preview",
2122
- "introducedVersion": "4.0.1-alpha.20",
2122
+ "introducedVersion": "4.0.1-alpha.22",
2123
2123
  "compatibilityPromise": "preserved-through-the-v3-major-line",
2124
2124
  "deprecationReplacement": "",
2125
2125
  "sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "4.0.1-alpha.20",
3
+ "version": "4.0.1-alpha.22",
4
4
  "private": false,
5
5
  "description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
6
6
  "repository": "https://github.com/kungfu-systems/buildchain",
@@ -7,6 +7,7 @@ import { execFileSync } from "node:child_process";
7
7
  import { fileURLToPath, pathToFileURL } from "node:url";
8
8
 
9
9
  import { writeGitHubOutputs } from "./build-contract-core.mjs";
10
+ import { compareSemver } from "./publication-registry-hydrate.mjs";
10
11
  import { normalizeAnchorProvenance, normalizeCandidateRun, recoverCandidateProvenance } from "./release-candidate-anchor-provenance.mjs";
11
12
  export { resolveAnchorRecoveryRequest } from "./release-candidate-anchor-provenance.mjs";
12
13
  import {
@@ -203,23 +204,36 @@ export function verifyReleaseCandidateStageCapsules({ sidecar, passport, downloa
203
204
  export function validateV4RuntimeResumePublicReadback({
204
205
  targetRef,
205
206
  targetSha,
207
+ targetVersion,
206
208
  alphaSha,
207
209
  exactTagSha,
208
210
  tagLineage,
211
+ runtimeLineage,
212
+ floatingTargetLineage,
209
213
  runtimeSha,
210
214
  version,
211
215
  transaction,
212
216
  main,
213
217
  npm,
214
218
  }) {
219
+ const channelVersion = npm["dist-tags"]?.alpha;
220
+ let channelDidNotRegress = false;
221
+ try {
222
+ channelDidNotRegress = compareSemver(channelVersion, version) >= 0;
223
+ } catch { channelDidNotRegress = false; }
215
224
  if (
216
225
  transaction?.target_ref !== targetRef ||
217
226
  transaction?.version !== version ||
218
227
  exactTagSha !== transaction?.source_sha ||
219
228
  !["ahead", "identical"].includes(tagLineage?.status) ||
220
- alphaSha !== runtimeSha ||
229
+ !["ahead", "identical"].includes(runtimeLineage?.status) ||
230
+ !["ahead", "identical"].includes(floatingTargetLineage?.status) ||
231
+ !alphaSha ||
221
232
  !targetSha ||
222
- npm["dist-tags"]?.alpha !== version ||
233
+ !runtimeSha ||
234
+ channelVersion !== targetVersion ||
235
+ !channelDidNotRegress ||
236
+ !npm.versions?.[channelVersion]?.dist?.integrity ||
223
237
  npm.versions?.[version]?.dist?.integrity !== main.digest
224
238
  ) {
225
239
  throw new Error(
@@ -238,21 +252,12 @@ export async function readPublicResumeState({
238
252
  apiUrl,
239
253
  fetchImpl,
240
254
  }) {
241
- const readRef = async (ref) =>
242
- (await githubJson({
243
- apiUrl,
244
- token,
245
- fetchImpl,
246
- path: `/repos/${repoInfo.owner}/${repoInfo.repo}/git/ref/${ref}`,
247
- })).object?.sha || "";
255
+ const readRef = async (ref) => (await githubJson({ apiUrl, token, fetchImpl,
256
+ path: `/repos/${repoInfo.owner}/${repoInfo.repo}/git/ref/${ref}` })).object?.sha || "";
248
257
  const main = transaction?.artifacts?.find((entry) => entry.kind === "npm" && entry.required !== false);
249
- if (!main || main.ref !== version || !main.digest) {
250
- throw new Error(
251
- "cross-runtime recovery requires exact durable npm publication evidence",
252
- );
253
- }
254
- const packageUrl =
255
- `https://registry.npmjs.org/${encodeURIComponent(main.name)}`;
258
+ if (!main || main.ref !== version || !main.digest)
259
+ throw new Error("cross-runtime recovery requires exact durable npm publication evidence");
260
+ const packageUrl = `https://registry.npmjs.org/${encodeURIComponent(main.name)}`;
256
261
  const exactTag = transaction.exact_tag || `v${version}`;
257
262
  const [targetSha, alphaSha, exactTagSha, npmResponse] = await Promise.all([
258
263
  readRef(`heads/${targetRef}`),
@@ -264,24 +269,18 @@ export async function readPublicResumeState({
264
269
  throw new Error(`npm public readback failed with HTTP ${npmResponse.status}`);
265
270
  }
266
271
  const npm = await npmResponse.json();
267
- const tagLineage = await githubJson({
268
- apiUrl,
269
- token,
270
- fetchImpl,
271
- path: `/repos/${repoInfo.owner}/${repoInfo.repo}/compare/${exactTagSha}...${targetSha}`,
272
- });
273
- validateV4RuntimeResumePublicReadback({
274
- targetRef,
275
- targetSha,
276
- alphaSha,
277
- exactTagSha,
278
- tagLineage,
279
- runtimeSha,
280
- version,
281
- transaction,
282
- main,
283
- npm,
284
- });
272
+ const [tagLineage, runtimeLineage, floatingTargetLineage, targetPackageFile] = await Promise.all([
273
+ githubJson({ apiUrl, token, fetchImpl, path: `/repos/${repoInfo.owner}/${repoInfo.repo}/compare/${exactTagSha}...${targetSha}` }),
274
+ githubJson({ apiUrl, token, fetchImpl, path: `/repos/${repoInfo.owner}/${repoInfo.repo}/compare/${runtimeSha}...${alphaSha}` }),
275
+ githubJson({ apiUrl, token, fetchImpl, path: `/repos/${repoInfo.owner}/${repoInfo.repo}/compare/${alphaSha}...${targetSha}` }),
276
+ githubJson({ apiUrl, token, fetchImpl, path: `/repos/${repoInfo.owner}/${repoInfo.repo}/contents/package.json?ref=${encodeURIComponent(targetSha)}` }),
277
+ ]);
278
+ if (targetPackageFile?.type !== "file" || targetPackageFile.encoding !== "base64" || !targetPackageFile.content)
279
+ throw new Error("cross-runtime recovery requires protected target version state");
280
+ const targetVersion = JSON.parse(Buffer.from(String(targetPackageFile.content).replace(/\s/g, ""), "base64").toString("utf8")).version;
281
+ validateV4RuntimeResumePublicReadback({ targetRef, targetSha, targetVersion, alphaSha,
282
+ exactTagSha, tagLineage, runtimeLineage, floatingTargetLineage, runtimeSha,
283
+ version, transaction, main, npm });
285
284
  const body = {
286
285
  schemaVersion: 1,
287
286
  contract: "kungfu-buildchain-v4-runtime-resume-public-readback/v1",
@@ -298,6 +297,8 @@ export async function readPublicResumeState({
298
297
  version,
299
298
  distTag: "alpha",
300
299
  integrity: npm.versions[version].dist.integrity,
300
+ targetVersion, distTagVersion: npm["dist-tags"].alpha,
301
+ distTagIntegrity: npm.versions[npm["dist-tags"].alpha].dist.integrity,
301
302
  },
302
303
  };
303
304
  return { ...body, root: v4RuntimeResumeDocumentRoot(body) };
@@ -456,7 +457,7 @@ export async function finalizeRuntimeResumeEvidence({
456
457
  resumePlanRoot: material.resumePlanRoot,
457
458
  finalPublicReadbackRoot: readback.root,
458
459
  floatingRefBefore: material.floatingRefBefore,
459
- floatingRefAfter: { ref: "v4-alpha", sha: material.runtimeSha },
460
+ floatingRefAfter: { ref: "v4-alpha", sha: readback.refs.floating.sha },
460
461
  });
461
462
  const evidence = {
462
463
  authorization: material.authorization,