@kungfu-tech/buildchain 2.12.1-alpha.6 → 2.12.1-alpha.7

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": "2.12.1-alpha.6",
7
+ "version": "2.12.1-alpha.7",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "majorLine": "v2",
@@ -507,5 +507,5 @@
507
507
  }
508
508
  ],
509
509
  "compatibilityDigest": "sha256:2090784977bc7d54fc647215ef73532b9db26147a0b40ec3f56c31d611d806cc",
510
- "contractDigest": "sha256:0d99192c0680fb9e00d7af90061eae0ef7e82b41453599f79fae7b5105df3c71"
510
+ "contractDigest": "sha256:b19d9fa286103c97b1bd3ae20bfca923bef32a6521450e70813b74ba3252bb7f"
511
511
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-site-bundle",
4
- "generatedAt": "2026-07-12T07:16:47.627Z",
5
- "publishedAt": "2026-07-12T07:16:47.627Z",
4
+ "generatedAt": "2026-07-12T08:33:40.639Z",
5
+ "publishedAt": "2026-07-12T08:33:40.639Z",
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": "f189e978df8dc612f9a8f9553ee21dad653a5029",
22
+ "sourceRevision": "fff859ed6eee0dfb1d3e8ed873e7348aa74accc2",
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": "2.12.1-alpha.6",
40
+ "version": "2.12.1-alpha.7",
41
41
  "versionSource": "package.json#version"
42
42
  },
43
43
  "source": {
@@ -4,7 +4,7 @@
4
4
  "product": {
5
5
  "id": "kungfu-tech-buildchain",
6
6
  "name": "@kungfu-tech/buildchain",
7
- "version": "2.12.1-alpha.6",
7
+ "version": "2.12.1-alpha.7",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "source": {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-publication-release-registry",
4
- "generatedAt": "2026-07-12T07:16:47.627Z",
5
- "publishedAt": "2026-07-12T07:16:47.627Z",
4
+ "generatedAt": "2026-07-12T08:33:40.639Z",
5
+ "publishedAt": "2026-07-12T08:33:40.639Z",
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": "f189e978df8dc612f9a8f9553ee21dad653a5029",
22
+ "sourceRevision": "fff859ed6eee0dfb1d3e8ed873e7348aa74accc2",
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": "2.12.1-alpha.6",
35
+ "version": "2.12.1-alpha.7",
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-07-12T07:16:47.627Z",
5
- "publishedAt": "2026-07-12T07:16:47.627Z",
4
+ "generatedAt": "2026-07-12T08:33:40.639Z",
5
+ "publishedAt": "2026-07-12T08:33:40.639Z",
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": "f189e978df8dc612f9a8f9553ee21dad653a5029",
22
+ "sourceRevision": "fff859ed6eee0dfb1d3e8ed873e7348aa74accc2",
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": "2.12.1-alpha.6",
40
+ "version": "2.12.1-alpha.7",
41
41
  "versionSource": "package.json#version"
42
42
  },
43
43
  "entrypoint": "buildchain-site.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "2.12.1-alpha.6",
3
+ "version": "2.12.1-alpha.7",
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",
@@ -200,6 +200,7 @@ export function fetchSourceCommit({
200
200
  remoteUrl,
201
201
  sha,
202
202
  fetchRef,
203
+ sourceTreeSha = "",
203
204
  timeoutMs,
204
205
  env = {},
205
206
  runGit = git,
@@ -225,7 +226,20 @@ export function fetchSourceCommit({
225
226
  stdio: "ignore",
226
227
  });
227
228
  if (containsCommit(targetPath, sha, timeoutMs)) {
228
- return { selector: "ref" };
229
+ return { selector: "ref", checkoutSha: sha };
230
+ }
231
+ if (/^refs\/pull\/\d+\/merge$/.test(fetchRef) && sourceTreeSha) {
232
+ const fetchedSha = runGit(["rev-parse", "refs/buildchain/source-ref^{commit}"], {
233
+ cwd: targetPath,
234
+ timeoutMs,
235
+ });
236
+ const fetchedTree = runGit(["rev-parse", "refs/buildchain/source-ref^{tree}"], {
237
+ cwd: targetPath,
238
+ timeoutMs,
239
+ });
240
+ if (fetchedTree === sourceTreeSha) {
241
+ return { selector: "ref-tree", checkoutSha: fetchedSha };
242
+ }
229
243
  }
230
244
  } catch (error) {
231
245
  // A retryable transport failure belongs to the bounded outer retry. Do
@@ -245,7 +259,7 @@ export function fetchSourceCommit({
245
259
  if (!containsCommit(targetPath, sha, timeoutMs)) {
246
260
  throw new Error(`fetched ${fetchRef || sha}, but ${sha} is not available`);
247
261
  }
248
- return { selector: "sha" };
262
+ return { selector: "sha", checkoutSha: sha };
249
263
  }
250
264
 
251
265
  export function runBoundedFetch({ attempts = 1, fetch, onAttempt = () => {}, onRetry = () => {}, shouldRetry = () => true }) {
@@ -272,18 +286,30 @@ function githubRemoteUrl({ repository, serverUrl = "https://github.com" }) {
272
286
  return `${base}/${repository}.git`;
273
287
  }
274
288
 
275
- function verifyCheckout({ targetPath, sourceSha, sourceTreeSha = "" }) {
289
+ function verifyCheckout({ targetPath, sourceSha, sourceTreeSha = "", fetchRef = "" }) {
276
290
  const head = git(["rev-parse", "HEAD"], { cwd: targetPath });
277
291
  const tree = git(["rev-parse", "HEAD^{tree}"], { cwd: targetPath });
278
292
  const headOk = head === sourceSha;
279
293
  const treeOk = !sourceTreeSha || tree === sourceTreeSha;
280
- if (!headOk) {
294
+ const pullMergeTreeEquivalent = !headOk
295
+ && /^refs\/pull\/\d+\/merge$/.test(fetchRef)
296
+ && Boolean(sourceTreeSha)
297
+ && treeOk;
298
+ if (!headOk && !pullMergeTreeEquivalent) {
281
299
  throw new Error(`locked source checkout head mismatch: expected ${sourceSha}, got ${head}`);
282
300
  }
283
301
  if (!treeOk) {
284
302
  throw new Error(`locked source checkout tree mismatch: expected ${sourceTreeSha}, got ${tree}`);
285
303
  }
286
- return { head, tree, headOk, treeOk };
304
+ return {
305
+ head,
306
+ expectedHead: sourceSha,
307
+ tree,
308
+ headOk,
309
+ treeOk,
310
+ identityOk: headOk || pullMergeTreeEquivalent,
311
+ identityMode: pullMergeTreeEquivalent ? "tree-equivalent-pull-merge" : "commit",
312
+ };
287
313
  }
288
314
 
289
315
  function writeEvidence(filePath, evidence) {
@@ -365,6 +391,7 @@ export function lockedSourceCheckout({
365
391
  durationMs: 0,
366
392
  };
367
393
  let checkoutError;
394
+ let checkoutSha = sha;
368
395
  if (normalizedMode !== "off") {
369
396
  try {
370
397
  if (renderedReferenceRepository) {
@@ -380,15 +407,17 @@ export function lockedSourceCheckout({
380
407
  checkoutFetchedCommit(targetPath, sha, timeoutMs);
381
408
  } else if (renderedMirrorUrl) {
382
409
  evidence.cache.transport = "mirror-url";
383
- fetchSourceCommit({
410
+ const fetchResult = fetchSourceCommit({
384
411
  targetPath,
385
412
  remoteName: "buildchain-cache",
386
413
  remoteUrl: renderedMirrorUrl,
387
414
  sha,
388
415
  fetchRef,
416
+ sourceTreeSha: treeSha,
389
417
  timeoutMs,
390
418
  });
391
- checkoutFetchedCommit(targetPath, sha, timeoutMs);
419
+ checkoutSha = fetchResult.checkoutSha || sha;
420
+ checkoutFetchedCommit(targetPath, checkoutSha, timeoutMs);
392
421
  } else {
393
422
  throw new Error("checkout cache is enabled but no mirror URL or reference repository template was provided");
394
423
  }
@@ -422,6 +451,7 @@ export function lockedSourceCheckout({
422
451
  remoteUrl,
423
452
  sha,
424
453
  fetchRef,
454
+ sourceTreeSha: treeSha,
425
455
  timeoutMs: githubTimeoutMs,
426
456
  env: githubAuthEnv(githubToken),
427
457
  }),
@@ -430,14 +460,20 @@ export function lockedSourceCheckout({
430
460
  shouldRetry: retryableGitFetchError,
431
461
  });
432
462
  evidence.cache.githubFetchAttempts = fetchResult.attempts;
463
+ checkoutSha = fetchResult.value.checkoutSha || sha;
433
464
  } catch (error) {
434
465
  evidence.durationMs = Date.now() - startedAt;
435
466
  writeEvidence(path.resolve(workspace, diagnosticsPath), evidence);
436
467
  throw error;
437
468
  }
438
- checkoutFetchedCommit(targetPath, sha, timeoutMs);
469
+ checkoutFetchedCommit(targetPath, checkoutSha, timeoutMs);
439
470
  }
440
- evidence.verification = verifyCheckout({ targetPath, sourceSha: sha, sourceTreeSha: treeSha });
471
+ evidence.verification = verifyCheckout({
472
+ targetPath,
473
+ sourceSha: sha,
474
+ sourceTreeSha: treeSha,
475
+ fetchRef,
476
+ });
441
477
  evidence.durationMs = Date.now() - startedAt;
442
478
  writeEvidence(path.resolve(workspace, diagnosticsPath), evidence);
443
479
  return evidence;