@kungfu-tech/buildchain 2.8.15 → 2.8.16-alpha.1
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/README.md +19 -11
- package/bin/buildchain.mjs +65 -0
- package/dist/site/buildchain-contract.json +45 -10
- package/dist/site/buildchain-site.json +66 -17
- package/dist/site/kfd-claims.json +45 -3
- package/dist/site/manual-registry.json +9 -2
- package/dist/site/node-api-registry.json +17 -6
- package/dist/site/page-registry.json +50 -9
- package/dist/site/release-provenance.json +1 -0
- package/dist/site/site-manifest.json +14 -6
- package/docs/MAP.md +4 -0
- package/docs/cli.md +21 -3
- package/docs/readme-badges.md +124 -0
- package/package.json +2 -1
- package/packages/core/README.md +12 -0
- package/packages/core/buildchain-contract.js +26 -0
- package/packages/core/buildchain-kfd-claims.js +19 -0
- package/packages/core/index.js +11 -0
- package/packages/core/readme-badges.js +450 -0
- package/packages/core/release-passport.js +10 -1
- package/scripts/check-inventory.mjs +37 -0
- package/scripts/generate-site-bundle.mjs +1 -0
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# Buildchain
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://github.com/kungfu-systems/buildchain/releases/latest/download/buildchain.release.json)
|
|
5
|
+
[](https://github.com/kungfu-systems/buildchain/releases/latest/download/buildchain.release.json)
|
|
6
|
+
[](https://github.com/kungfu-systems/buildchain/releases/latest/download/buildchain.release.json)
|
|
7
|
+
[](https://github.com/kungfu-systems/buildchain/releases/latest/download/buildchain.release.json)
|
|
8
|
+
[](https://github.com/kungfu-systems/buildchain/blob/HEAD/LICENSE)
|
|
9
|
+
[](https://github.com/kungfu-systems/buildchain/releases/latest/download/buildchain.release.json)
|
|
10
|
+
[](https://github.com/kungfu-systems/buildchain/actions/workflows/verify.yml)
|
|
11
|
+
[](https://github.com/kungfu-systems/buildchain/actions/workflows/buildchain-ref-promotion.yml)
|
|
12
|
+
[](https://github.com/kungfu-systems/buildchain/actions/workflows/binary-distribution.yml)
|
|
13
|
+
<!-- buildchain:badges:end -->
|
|
14
14
|
|
|
15
15
|
Buildchain Release Passport is a mature product release record for artifacts
|
|
16
16
|
that users or agents depend on.
|
|
@@ -97,6 +97,14 @@ const report = verifyBuildchainLogEvents({
|
|
|
97
97
|
The package also ships `dist/site/` as the Buildchain-owned fact source for
|
|
98
98
|
`buildchain.libkungfu.dev`.
|
|
99
99
|
|
|
100
|
+
Repositories can also generate README status badges from Buildchain-owned facts
|
|
101
|
+
instead of hand-maintaining badge Markdown:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
buildchain badges readme --check
|
|
105
|
+
buildchain badges readme --write
|
|
106
|
+
```
|
|
107
|
+
|
|
100
108
|
## Project Governance
|
|
101
109
|
|
|
102
110
|
- [`LICENSE-POLICY.md`](LICENSE-POLICY.md) explains the Apache-2.0 project
|
package/bin/buildchain.mjs
CHANGED
|
@@ -30,6 +30,12 @@ import {
|
|
|
30
30
|
explainArtifactPassport,
|
|
31
31
|
verifyArtifactPassport,
|
|
32
32
|
} from "../packages/core/artifact-passport.js";
|
|
33
|
+
import {
|
|
34
|
+
checkReadmeBadgeBlock,
|
|
35
|
+
collectReadmeBadgeFacts,
|
|
36
|
+
readReadme,
|
|
37
|
+
updateReadmeBadgeBlock,
|
|
38
|
+
} from "../packages/core/readme-badges.js";
|
|
33
39
|
import {
|
|
34
40
|
BUILDCHAIN_PROCESS_SAMPLE_REPORT_CONTRACT,
|
|
35
41
|
formatDiagnosticsSummaryTable,
|
|
@@ -115,6 +121,7 @@ function usage() {
|
|
|
115
121
|
buildchain web-surface ...
|
|
116
122
|
buildchain infra-contract ...
|
|
117
123
|
buildchain release-propagation <plan|write-lock> ...
|
|
124
|
+
buildchain badges readme [--cwd <dir>] [--readme <path>] [--check] [--write] [--json]
|
|
118
125
|
buildchain publish-source <lock|manifest|verify-lock|verify-channel-ref|validate-anchored-release> ...
|
|
119
126
|
buildchain build-contract ...
|
|
120
127
|
|
|
@@ -277,6 +284,59 @@ function writeJsonFile(filePath, value) {
|
|
|
277
284
|
return filePath;
|
|
278
285
|
}
|
|
279
286
|
|
|
287
|
+
async function runReadmeBadgesCli(args = []) {
|
|
288
|
+
const [subcommand = "", surface = "", ...badgeArgs] = args;
|
|
289
|
+
if (subcommand !== "readme" || (surface && surface.startsWith("--") === false)) {
|
|
290
|
+
throw new Error("usage: buildchain badges readme [--cwd <dir>] [--readme <path>] [--check] [--write] [--json]");
|
|
291
|
+
}
|
|
292
|
+
const effectiveArgs = surface ? [surface, ...badgeArgs] : badgeArgs;
|
|
293
|
+
const cwd = path.resolve(readFlag(effectiveArgs, "cwd", process.cwd()));
|
|
294
|
+
const readmePath = readFlag(effectiveArgs, "readme", "README.md");
|
|
295
|
+
const facts = await collectReadmeBadgeFacts({ cwd });
|
|
296
|
+
if (readBooleanFlag(effectiveArgs, "json") && !readBooleanFlag(effectiveArgs, "check") && !readBooleanFlag(effectiveArgs, "write")) {
|
|
297
|
+
printJson(facts);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const readmeText = readReadme({ cwd, readmePath });
|
|
301
|
+
if (!readmeText) {
|
|
302
|
+
throw new Error(`README not found: ${path.join(cwd, readmePath)}`);
|
|
303
|
+
}
|
|
304
|
+
const check = checkReadmeBadgeBlock({ readmeText, facts });
|
|
305
|
+
if (readBooleanFlag(effectiveArgs, "write")) {
|
|
306
|
+
const next = updateReadmeBadgeBlock({ readmeText, facts });
|
|
307
|
+
fs.writeFileSync(path.join(cwd, readmePath), next);
|
|
308
|
+
const result = {
|
|
309
|
+
schemaVersion: 1,
|
|
310
|
+
contract: "kungfu-buildchain-readme-badge-write",
|
|
311
|
+
ok: true,
|
|
312
|
+
changed: next !== readmeText,
|
|
313
|
+
readmePath,
|
|
314
|
+
facts,
|
|
315
|
+
};
|
|
316
|
+
if (readBooleanFlag(effectiveArgs, "json")) {
|
|
317
|
+
printJson(result);
|
|
318
|
+
} else {
|
|
319
|
+
process.stdout.write(`buildchain badges readme: ${result.changed ? "updated" : "current"}\n`);
|
|
320
|
+
}
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
if (readBooleanFlag(effectiveArgs, "check")) {
|
|
324
|
+
if (readBooleanFlag(effectiveArgs, "json")) {
|
|
325
|
+
printJson(check);
|
|
326
|
+
} else {
|
|
327
|
+
process.stdout.write(`buildchain badges readme: ${check.ok ? "ok" : "failed"}\n`);
|
|
328
|
+
if (!check.ok) {
|
|
329
|
+
process.stdout.write(`${check.message}\n`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (!check.ok) {
|
|
333
|
+
process.exitCode = 1;
|
|
334
|
+
}
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
printJson(facts);
|
|
338
|
+
}
|
|
339
|
+
|
|
280
340
|
function appendJsonLine(filePath, value) {
|
|
281
341
|
if (!filePath) {
|
|
282
342
|
return "";
|
|
@@ -951,6 +1011,11 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
951
1011
|
return;
|
|
952
1012
|
}
|
|
953
1013
|
|
|
1014
|
+
if (command === "badges") {
|
|
1015
|
+
await runReadmeBadgesCli(args);
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
954
1019
|
if (command === "build-contract") {
|
|
955
1020
|
runScript("resolve-build-contract.mjs", args);
|
|
956
1021
|
return;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"product": {
|
|
5
5
|
"name": "Buildchain",
|
|
6
6
|
"package": "@kungfu-tech/buildchain",
|
|
7
|
-
"version": "2.8.
|
|
7
|
+
"version": "2.8.16-alpha.1",
|
|
8
8
|
"repository": "https://github.com/kungfu-systems/buildchain"
|
|
9
9
|
},
|
|
10
10
|
"majorLine": "v2",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"release-state SHA is recorded as a durable audit entrance"
|
|
236
236
|
],
|
|
237
237
|
"breakingDigest": "sha256:b627e1b2ece9b6049517a942c5139e342e6077cdd3d8962d61cef8481b1f70ad",
|
|
238
|
-
"auditDigest": "sha256:
|
|
238
|
+
"auditDigest": "sha256:4d88ba7178753d2d1488f6393fee7c086dfb660f42e6507db718dccd38bf8a34"
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
241
|
"contractVersion": 1,
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
"prose-only public claims downgrade the release trust passport audit"
|
|
285
285
|
],
|
|
286
286
|
"breakingDigest": "sha256:f0b636eb925ddbf45ff1a8872454ab7b4dd98857cac12bb75217830130e62a16",
|
|
287
|
-
"auditDigest": "sha256:
|
|
287
|
+
"auditDigest": "sha256:4d88ba7178753d2d1488f6393fee7c086dfb660f42e6507db718dccd38bf8a34"
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
"contractVersion": 1,
|
|
@@ -331,16 +331,51 @@
|
|
|
331
331
|
"optionalInputs": [
|
|
332
332
|
"validate",
|
|
333
333
|
"lifecycle",
|
|
334
|
+
"badges readme",
|
|
334
335
|
"collect github-release",
|
|
335
336
|
"verify release-passport",
|
|
336
337
|
"release-propagation",
|
|
337
338
|
"infra-contract"
|
|
338
339
|
],
|
|
339
340
|
"guarantees": [
|
|
340
|
-
"CLI commands are stable within the major line unless the contract major changes"
|
|
341
|
+
"CLI commands are stable within the major line unless the contract major changes",
|
|
342
|
+
"README badge block checks and writes are generated from machine-readable repository facts"
|
|
341
343
|
],
|
|
342
|
-
"breakingDigest": "sha256:
|
|
343
|
-
"auditDigest": "sha256:
|
|
344
|
+
"breakingDigest": "sha256:90a73892b2d6c214048448d5f45df75639bdf7b7e8fefd9c596e04b087407bcc",
|
|
345
|
+
"auditDigest": "sha256:af247c9ce9227e64e07344fee30d718646ed66ada69b6e1d6155a7f33ff1005e"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"contractVersion": 1,
|
|
349
|
+
"stability": "stable",
|
|
350
|
+
"additiveChanges": "optional inputs, optional outputs, diagnostics, and documentation may be added within the same major line",
|
|
351
|
+
"id": "readme-badge-facts",
|
|
352
|
+
"kind": "node-api",
|
|
353
|
+
"path": "packages/core/readme-badges.js",
|
|
354
|
+
"requiredInputs": [
|
|
355
|
+
"repository checkout"
|
|
356
|
+
],
|
|
357
|
+
"requiredOutputs": [
|
|
358
|
+
"kungfu-buildchain-readme-badge-facts"
|
|
359
|
+
],
|
|
360
|
+
"breakingDefaults": {
|
|
361
|
+
"markerStart": "<!-- buildchain:badges:start -->",
|
|
362
|
+
"markerEnd": "<!-- buildchain:badges:end -->",
|
|
363
|
+
"kfdPassedSource": "verified repository-owned release passport"
|
|
364
|
+
},
|
|
365
|
+
"optionalInputs": [
|
|
366
|
+
"buildchain.toml [badges]",
|
|
367
|
+
"release passport URL or local path",
|
|
368
|
+
"workflow file list",
|
|
369
|
+
"platform declarations"
|
|
370
|
+
],
|
|
371
|
+
"guarantees": [
|
|
372
|
+
"README badge Markdown is a deterministic projection of badge facts",
|
|
373
|
+
"KFD passed badges require the repository's own verified release passport section",
|
|
374
|
+
"unreleased repositories downgrade KFD status to explicit non-passed declarations",
|
|
375
|
+
"CLI and JavaScript callers use the same Node API implementation"
|
|
376
|
+
],
|
|
377
|
+
"breakingDigest": "sha256:bcd72ad6dfba8013c96f8b2f7b0a307d2e7713972a1219348f0d5ecc493939a0",
|
|
378
|
+
"auditDigest": "sha256:a3400b0083430782d4fda283b21d308327eaed969053aa5b88a8b946bf83d4b3"
|
|
344
379
|
},
|
|
345
380
|
{
|
|
346
381
|
"contractVersion": 1,
|
|
@@ -362,7 +397,7 @@
|
|
|
362
397
|
"manual entries carry source file digests so downstream sites and agents can detect stale hand-written documentation"
|
|
363
398
|
],
|
|
364
399
|
"breakingDigest": "sha256:7d0d2819e3a3e72989d9c57b5efe9d0bc0a79bc0f2c82a0c7b9d6c5a211a91f2",
|
|
365
|
-
"auditDigest": "sha256:
|
|
400
|
+
"auditDigest": "sha256:99fd5e862e5a29eb10b0ec5a7a5e06d9ab7a594bd7b345bfcb8d45a0a099b9fc"
|
|
366
401
|
},
|
|
367
402
|
{
|
|
368
403
|
"contractVersion": 1,
|
|
@@ -384,9 +419,9 @@
|
|
|
384
419
|
"agents can discover supported Node APIs without importing internal file paths"
|
|
385
420
|
],
|
|
386
421
|
"breakingDigest": "sha256:48f925608d3e2131d90936b07dc2a30341204cae3e6e785c0f77d61ad755c945",
|
|
387
|
-
"auditDigest": "sha256:
|
|
422
|
+
"auditDigest": "sha256:e1fae05f9ab0186e9423464b7e4bcb9bfefe4185fe0925a0b95368fb97f1cd41"
|
|
388
423
|
}
|
|
389
424
|
],
|
|
390
|
-
"compatibilityDigest": "sha256:
|
|
391
|
-
"contractDigest": "sha256:
|
|
425
|
+
"compatibilityDigest": "sha256:217f7764849bf779cbc70aea9da59429a44c68f5f7131b26593bb18a6e7ffb18",
|
|
426
|
+
"contractDigest": "sha256:242f4e40e1768fddb28264561efcfaf3a206b3907c35f08143d4b98a4e13b527"
|
|
392
427
|
}
|