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