@kungfu-tech/buildchain 4.0.1-alpha.34 → 4.0.1-alpha.36

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.34",
7
+ "version": "4.0.1-alpha.36",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "majorLine": "v4",
@@ -1646,7 +1646,7 @@
1646
1646
  "resume-from-candidate-run is fail-closed and uses a fresh caller event instead of rerunning a frozen startup graph"
1647
1647
  ],
1648
1648
  "breakingDigest": "sha256:9db8dd07152855d03ff30f9c571438593c689d3e8139fa45431d000f548242f5",
1649
- "auditDigest": "sha256:9113ee5ba1b58ce2dbe51ae284a2915cb04a1cad27a9560142421df37a0eb4fb",
1649
+ "auditDigest": "sha256:6d18173f1048d68196da4729a078f77b85781ecbae0e34aadc1f862a5d83897a",
1650
1650
  "compatibleBreakingDigests": [
1651
1651
  "sha256:aa30f22e3af0a89841310bdbdc900844dd95a66974db173fa140a71bbd7e82c0"
1652
1652
  ],
@@ -5082,7 +5082,7 @@
5082
5082
  "missing receipts are non-qualifying and must not be represented as a successful controller run"
5083
5083
  ],
5084
5084
  "breakingDigest": "sha256:015d8de793adbd4c539416be7d7512e18cc92097e629b0203fa06d2c183e98bd",
5085
- "auditDigest": "sha256:9113ee5ba1b58ce2dbe51ae284a2915cb04a1cad27a9560142421df37a0eb4fb"
5085
+ "auditDigest": "sha256:6d18173f1048d68196da4729a078f77b85781ecbae0e34aadc1f862a5d83897a"
5086
5086
  },
5087
5087
  {
5088
5088
  "contractVersion": 1,
@@ -5308,5 +5308,5 @@
5308
5308
  "compatibilityFactCutRoot": "sha256:f61b975d4a96c921cc4bd37fb3ed9a0596b47004fe34dc7219979d697e3707f9",
5309
5309
  "compatibilityProofRegistryRoot": "sha256:b7194b811e4d3af2df4390bc4d1731e16a86215bd64ee18cb630dd5492f4fb63",
5310
5310
  "compatibilityDigest": "sha256:5de1c69386510b74b17eb70141b8bdd07063d62c504f91db5e84b67c6d4b64a2",
5311
- "contractDigest": "sha256:1cd711c4379d653bd154dc8fd781282fb3497aa68480b35054e9eff336f4a58d"
5311
+ "contractDigest": "sha256:08da7cb857e3c977a4dd0a918af9659de8628a9404c6a5a907593d8f89d294ae"
5312
5312
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-site-bundle",
4
- "generatedAt": "2026-08-23T23:30:13.157Z",
5
- "publishedAt": "2026-08-23T23:30:13.157Z",
4
+ "generatedAt": "2026-08-24T04:04:36.516Z",
5
+ "publishedAt": "2026-08-24T04:04:36.516Z",
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": "411fd491bb0b21c8fc28a6e2f505b3e4e4a133d0",
22
+ "sourceRevision": "975c93b1e33d04d6c27e2879651f8dcfd9b5fe42",
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.34",
40
+ "version": "4.0.1-alpha.36",
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": "d52aad240b46495a2a930ba48847adc17159d1d0ca2751759f62570e0f332865",
24
+ "sha256": "94f0e944155b53b68186da6ff5edaad13f23514e0207e2a9516a8c402f7f44a9",
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": "d52aad240b46495a2a930ba48847adc17159d1d0ca2751759f62570e0f332865",
249
+ "sha256": "94f0e944155b53b68186da6ff5edaad13f23514e0207e2a9516a8c402f7f44a9",
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.34",
7
+ "version": "4.0.1-alpha.36",
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": "ba26bf58130e1b70b3a4f38f5d87313797c77d700d407f949fc62faf45287104",
8849
+ "workflowRegistryDigest": "1b21627d15c546740ad5fbf98df3c0ea989009193f86b55a15cf139f45934439",
8850
8850
  "pageRegistryDigest": "619910e5c57fb8e94ea1525de1fb7699c412a8dafd7269bc9354cc6c4fe83f48"
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-23T23:30:13.157Z",
5
- "publishedAt": "2026-08-23T23:30:13.157Z",
4
+ "generatedAt": "2026-08-24T04:04:36.516Z",
5
+ "publishedAt": "2026-08-24T04:04:36.516Z",
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": "411fd491bb0b21c8fc28a6e2f505b3e4e4a133d0",
22
+ "sourceRevision": "975c93b1e33d04d6c27e2879651f8dcfd9b5fe42",
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.34",
35
+ "version": "4.0.1-alpha.36",
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-23T23:30:13.157Z",
5
- "publishedAt": "2026-08-23T23:30:13.157Z",
4
+ "generatedAt": "2026-08-24T04:04:36.516Z",
5
+ "publishedAt": "2026-08-24T04:04:36.516Z",
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": "411fd491bb0b21c8fc28a6e2f505b3e4e4a133d0",
22
+ "sourceRevision": "975c93b1e33d04d6c27e2879651f8dcfd9b5fe42",
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.34",
40
+ "version": "4.0.1-alpha.36",
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.34",
2030
+ "introducedVersion": "4.0.1-alpha.36",
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.34",
2051
+ "introducedVersion": "4.0.1-alpha.36",
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.34",
2072
+ "introducedVersion": "4.0.1-alpha.36",
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.34",
2122
+ "introducedVersion": "4.0.1-alpha.36",
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.34",
3
+ "version": "4.0.1-alpha.36",
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",
@@ -700,13 +700,21 @@ export function resolveRecoveredPublicationVersion({ artifactVersion, channel, r
700
700
  if (!match) throw new Error(`recovered npm artifact has invalid publication version: ${version || "<empty>"}`);
701
701
  return channel === "release" && rematerializeOnResume ? match[1] : version;
702
702
  }
703
- export function createRecoveredPublication({ downloads, bundleRoot, repository, passport, candidateRuntimeSha, publishArtifactKind, publishPackageMain, releasePatterns, platformManifests, channel, rematerializeOnResume = false }) {
704
- const allFiles = downloads.flatMap((download) => download.files.map((file) => ({
705
- path: path.relative(bundleRoot, file.absolutePath).split(path.sep).join("/"),
706
- size: file.size,
707
- sha256: file.sha256.replace(/^sha256:/, ""),
708
- absolutePath: file.absolutePath,
709
- }))).sort((left, right) => left.path.localeCompare(right.path));
703
+ export function resolveRecoveredCandidateVersion({ artifactVersion, publicationVersion, channel, rematerializeOnResume = false, targetRef = "", candidateRef = "" } = {}) {
704
+ const version = String(artifactVersion || "").trim(), target = String(targetRef || "").replace(/^refs\/heads\//u, ""), candidate = String(candidateRef || "").replace(/^refs\/heads\//u, "");
705
+ if (channel !== "release" || !rematerializeOnResume) return version;
706
+ const prefix = `publish-gate/${target}/`;
707
+ if (!target || !candidate.startsWith(prefix)) throw new Error(`stable recovery candidate ref must descend from ${prefix || "publish-gate/<target>/"}`);
708
+ const candidateVersion = candidate.slice(prefix.length);
709
+ if (!/^\d+\.\d+\.\d+-alpha\.\d+$/u.test(candidateVersion)) throw new Error(`stable recovery candidate ref must bind an exact alpha version, got ${candidateVersion || "<empty>"}`);
710
+ if (candidateVersion.replace(/-alpha\.\d+$/u, "") !== publicationVersion) throw new Error(`stable recovery candidate ${candidateVersion} does not match publication ${publicationVersion || "<empty>"}`);
711
+ if ((version.match(/^(\d+\.\d+\.\d+)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u)?.[1] || "") !== publicationVersion) throw new Error(`recovered npm artifact version ${version || "<empty>"} does not match publication ${publicationVersion}`);
712
+ return candidateVersion;
713
+ }
714
+ export function createRecoveredPublication({ downloads, bundleRoot, repository, passport, candidateRuntimeSha, publishArtifactKind, publishPackageMain, releasePatterns, platformManifests, channel, targetRef = "", candidateRef = "", rematerializeOnResume = false }) {
715
+ const allFiles = downloads.flatMap((download) => download.files.map((file) => ({ path: path.relative(bundleRoot, file.absolutePath).split(path.sep).join("/"),
716
+ size: file.size, sha256: file.sha256.replace(/^sha256:/, ""), absolutePath: file.absolutePath })))
717
+ .sort((left, right) => left.path.localeCompare(right.path));
710
718
  const kind = String(publishArtifactKind || "npm");
711
719
  const releaseMatchers = splitPatterns(releasePatterns).map(patternMatcher);
712
720
  const releaseAssets = allFiles.filter((file) => releaseMatchers.some((matcher) => matcher.test(path.basename(file.path))));
@@ -714,12 +722,8 @@ export function createRecoveredPublication({ downloads, bundleRoot, repository,
714
722
  createRecoveredPublicationCandidate({ allFiles, repository, passport, candidateRuntimeSha });
715
723
  const version = String(passport.target?.version || "").trim();
716
724
  if (!version) throw new Error("candidate recovery requires a passport publication version");
717
- return {
718
- manifest: undefined,
719
- npmArtifacts: [],
720
- allFiles,
721
- releaseAssets,
722
- version,
725
+ return { manifest: undefined, npmArtifacts: [], allFiles, releaseAssets,
726
+ version, candidateVersion: version,
723
727
  publishRequiredArtifacts: generatePublishRequiredArtifacts({ manifests: platformManifests, version, kind }),
724
728
  };
725
729
  }
@@ -732,12 +736,8 @@ export function createRecoveredPublication({ downloads, bundleRoot, repository,
732
736
  ? releaseMatchers.some((matcher) => matcher.test(path.basename(file.path)))
733
737
  : file.path.toLowerCase().endsWith(".tgz"));
734
738
  const publicationVersion = resolveRecoveredPublicationVersion({ artifactVersion: main.metadata.ref, channel, rematerializeOnResume });
735
- const candidate = createRecoveredPublicationCandidate({
736
- allFiles,
737
- repository,
738
- passport,
739
- candidateRuntimeSha,
740
- });
739
+ const candidateVersion = resolveRecoveredCandidateVersion({ artifactVersion: main.metadata.ref, publicationVersion, channel, rematerializeOnResume, targetRef, candidateRef });
740
+ const candidate = createRecoveredPublicationCandidate({ allFiles, repository, passport, candidateRuntimeSha });
741
741
  const manifest = createPublicationSealedBundle({
742
742
  candidate,
743
743
  packageName: main.metadata.name,
@@ -751,7 +751,7 @@ export function createRecoveredPublication({ downloads, bundleRoot, repository,
751
751
  npmArtifacts,
752
752
  allFiles,
753
753
  releaseAssets: npmReleaseAssets,
754
- version: publicationVersion,
754
+ version: publicationVersion, candidateVersion,
755
755
  publishRequiredArtifacts: generatePublishRequiredArtifacts({
756
756
  kind: "npm",
757
757
  tarballPaths: npmArtifacts.map((entry) => entry.file.absolutePath),
@@ -832,9 +832,9 @@ export async function resolveRecoveryTransaction({
832
832
  })
833
833
  : undefined;
834
834
  if (!transaction) {
835
- transaction = await readExistingTransactionById({
836
- repoInfo, apiUrl, token, fetchImpl, transactionId,
837
- });
835
+ transaction = transactionId
836
+ ? await readExistingTransactionById({ repoInfo, apiUrl, token, fetchImpl, transactionId })
837
+ : undefined;
838
838
  }
839
839
  return { version: transaction?.version || publicationVersion, transaction };
840
840
  }
@@ -908,7 +908,7 @@ export async function resumeFromCandidateRun({
908
908
  publishArtifactKind,
909
909
  publishPackageMain,
910
910
  releasePatterns,
911
- platformManifests: platformManifestEvidence.manifests, channel, rematerializeOnResume,
911
+ platformManifests: platformManifestEvidence.manifests, channel, targetRef, candidateRef: pullRequest.head?.ref || "", rematerializeOnResume,
912
912
  });
913
913
  const stageCapsules = resolveRecoveredStageCapsules({
914
914
  candidateRuntimeSha,
@@ -918,7 +918,7 @@ export async function resumeFromCandidateRun({
918
918
  downloads,
919
919
  });
920
920
  const {
921
- version: candidateVersion,
921
+ version: publicationVersion,
922
922
  transaction: existingTransaction,
923
923
  } = await resolveRecoveryTransaction({
924
924
  repoInfo,
@@ -976,7 +976,7 @@ export async function resumeFromCandidateRun({
976
976
  platformManifestEvidence: platformManifestEvidence.evidence,
977
977
  productPayloadManifests,
978
978
  artifacts: downloads.map((download) => download.record),
979
- publicationVersion: candidateVersion,
979
+ publicationVersion,
980
980
  currentToolingSha: runtimeSha,
981
981
  recoveryRunId,
982
982
  });
@@ -992,7 +992,7 @@ export async function resumeFromCandidateRun({
992
992
  repoInfo,
993
993
  targetRef,
994
994
  runtimeSha,
995
- version: candidateVersion,
995
+ version: publicationVersion,
996
996
  passport,
997
997
  sidecar: stageCapsuleSidecar,
998
998
  stageCapsules,
@@ -1007,7 +1007,7 @@ export async function resumeFromCandidateRun({
1007
1007
  repository: repoInfo.fullName,
1008
1008
  run: { id: runId, url: run.html_url || "", name: run.name },
1009
1009
  artifacts: { passport: selected.passport.name, summary: selected.summary.name, payloads: chosen.map((artifact) => artifact.name), sourceSha: selected.sourceSha },
1010
- version: candidateVersion,
1010
+ version: publicationVersion, candidateVersion: publication.candidateVersion,
1011
1011
  candidateRoot: recovery.receipt.recovered.candidateRoot,
1012
1012
  artifactRoot: recovery.receipt.recovered.artifactRoot,
1013
1013
  receipt: recovery.receipt,
@@ -1062,7 +1062,7 @@ export async function resumeFromCandidateRunCli() {
1062
1062
  "release-candidate-action": result.action,
1063
1063
  "release-candidate-passport-path": result.paths.passport,
1064
1064
  "release-candidate-build-summary-path": result.paths.buildSummary,
1065
- "release-candidate-version": result.version,
1065
+ "release-candidate-version": result.candidateVersion, "release-candidate-publication-version": result.version,
1066
1066
  "release-candidate-source-sha": result.artifacts.sourceSha,
1067
1067
  "release-candidate-artifact": result.artifacts.passport,
1068
1068
  "release-candidate-build-summary-artifact": result.artifacts.summary,