@kungfu-tech/buildchain 3.0.3-alpha.0 → 3.0.3-alpha.2

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.
Files changed (115) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +32 -1
  4. package/actions/promote-buildchain-ref/README.md +90 -19
  5. package/actions/report-buildchain-issue/README.md +19 -1
  6. package/actions/run-lifecycle/README.md +5 -0
  7. package/actions/validate-config/README.md +19 -1
  8. package/bin/buildchain.mjs +41 -241
  9. package/bin/internal/command-registry.mjs +82 -0
  10. package/bin/internal/trust-release-cli.mjs +1 -0
  11. package/contracts/auditable-demo-media-profiles-v1.json +116 -1
  12. package/contracts/buildchain-v2-residuals-v1.json +0 -45
  13. package/contracts/evidence/auditable-demo-responsive-web-delivery-v1.json +143 -0
  14. package/contracts/evidence/auditable-demo-web-delivery-v1.json +7 -3
  15. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/complete-transcript.txt +2 -0
  16. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/public-projection.json +16 -0
  17. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/scene.json +12 -0
  18. package/dist/site/buildchain-contract.json +161 -42
  19. package/dist/site/buildchain-site.json +180 -84
  20. package/dist/site/capability-registry.json +6 -6
  21. package/dist/site/cli-registry.json +932 -98
  22. package/dist/site/controller-registry.json +97 -5
  23. package/dist/site/kfd-claims.json +316 -23
  24. package/dist/site/kfd-upstream-aggregate.json +1 -1
  25. package/dist/site/manual-registry.json +20 -20
  26. package/dist/site/node-api-registry.json +371 -56
  27. package/dist/site/page-registry.json +155 -59
  28. package/dist/site/public-surface-audit.json +286 -24
  29. package/dist/site/publication-registry.json +4 -4
  30. package/dist/site/release-provenance.json +3 -0
  31. package/dist/site/site-manifest.json +24 -24
  32. package/dist/site/workflow-registry.json +570 -79
  33. package/docs/MAP.md +22 -4
  34. package/docs/auditable-demo.md +35 -12
  35. package/docs/aws-us-elastic-runner-burst-plane.md +381 -0
  36. package/docs/cli.md +143 -12
  37. package/docs/consumer-issue-reporting.md +19 -1
  38. package/docs/github-governance-authority.md +2 -2
  39. package/docs/lifecycle-protocol.md +20 -2
  40. package/docs/migration-inventory.md +24 -5
  41. package/docs/ownership.md +19 -1
  42. package/docs/publication-artifacts.md +185 -18
  43. package/docs/publication-authority.md +4 -4
  44. package/docs/publish-transaction.md +78 -31
  45. package/docs/release-candidate.md +24 -0
  46. package/docs/release-flow.md +50 -32
  47. package/docs/release-governance.md +31 -31
  48. package/docs/release-passport.md +4 -0
  49. package/docs/release-propagation.md +57 -12
  50. package/docs/reusable-build-surface.md +95 -27
  51. package/docs/runtime-train-validation.md +20 -2
  52. package/docs/stable-candidate-patrol.md +6 -6
  53. package/docs/toolkit-observability.md +22 -0
  54. package/docs/versioning.md +6 -4
  55. package/docs/web-surface-deployments.md +62 -0
  56. package/package.json +7 -5
  57. package/packages/core/README.md +61 -4
  58. package/packages/core/buildchain-contract.js +8 -4
  59. package/packages/core/cache-evidence.js +1 -0
  60. package/packages/core/diagnostics.js +105 -30
  61. package/packages/core/github-governance-authority.js +10 -25
  62. package/packages/core/index.js +40 -0
  63. package/packages/core/paper-fleet.js +260 -0
  64. package/packages/core/paper-repository.js +210 -0
  65. package/packages/core/paper-work.js +365 -0
  66. package/packages/core/paper.js +3180 -0
  67. package/packages/core/public-surface-audit.js +26 -75
  68. package/packages/core/public-surface-cli.js +117 -0
  69. package/packages/core/publication-artifact.js +1 -6
  70. package/packages/core/publication-authority.js +1 -0
  71. package/packages/core/publication-reproducibility.js +947 -0
  72. package/packages/core/publication-sealed-bundle.js +190 -0
  73. package/packages/core/publish-transaction.js +147 -17
  74. package/packages/core/release-candidate.js +234 -0
  75. package/packages/core/release-passport.js +483 -201
  76. package/packages/core/release-propagation.js +175 -1
  77. package/scripts/auditable-demo.mjs +119 -5
  78. package/scripts/aws-codebuild-toolchain.mjs +285 -0
  79. package/scripts/aws-macos-jit-core.mjs +378 -0
  80. package/scripts/aws-macos-jit.mjs +123 -0
  81. package/scripts/aws-runner-burst-core.mjs +248 -0
  82. package/scripts/aws-runner-burst.mjs +79 -0
  83. package/scripts/aws-windows-jit-core.mjs +374 -0
  84. package/scripts/aws-windows-jit.mjs +121 -0
  85. package/scripts/build-contract-core.mjs +69 -6
  86. package/scripts/build-standalone-binary.mjs +23 -0
  87. package/scripts/buildchain-cli-help.mjs +256 -0
  88. package/scripts/buildchain-contract-lock.mjs +1 -1
  89. package/scripts/check-internal-architecture.mjs +69 -2
  90. package/scripts/check-inventory.mjs +69 -2
  91. package/scripts/check-javascript-syntax.mjs +31 -0
  92. package/scripts/check-maintainability.mjs +371 -0
  93. package/scripts/compiler-cache-evidence.mjs +221 -0
  94. package/scripts/dev-alpha-candidate-patrol.mjs +268 -43
  95. package/scripts/finalize-native-artifact-signing-result.mjs +75 -4
  96. package/scripts/generate-channel-promotion-workflow.mjs +3 -12
  97. package/scripts/generate-release-candidate-passport.mjs +4 -0
  98. package/scripts/generate-site-bundle.mjs +68 -188
  99. package/scripts/import-artifact-signing-results.mjs +64 -5
  100. package/scripts/inspect-artifact-signing-requests.mjs +7 -0
  101. package/scripts/maintainability-metrics.mjs +339 -0
  102. package/scripts/npm-publish-transaction.mjs +57 -6
  103. package/scripts/paper-work-fleet-cli.mjs +563 -0
  104. package/scripts/paper.mjs +631 -0
  105. package/scripts/promotion-channel-router.mjs +16 -4
  106. package/scripts/publication-reproducibility.mjs +62 -0
  107. package/scripts/release-propagation.mjs +39 -0
  108. package/scripts/resolve-build-contract.mjs +6 -0
  109. package/scripts/route-offline-runners.mjs +236 -0
  110. package/scripts/run-lifecycle-core.mjs +62 -1
  111. package/scripts/runtime-ref-core.mjs +23 -2
  112. package/scripts/seal-artifact-signing-requests.mjs +13 -6
  113. package/scripts/site-capability-metadata.mjs +202 -0
  114. package/scripts/stable-candidate-qualification.mjs +42 -0
  115. package/scripts/web-surface-core.mjs +272 -86
@@ -11,6 +11,9 @@ import { runReleasePropagationCli } from "../scripts/release-propagation.mjs";
11
11
  import { runReleaseGovernanceCli } from "../scripts/reconcile-release-governance.mjs";
12
12
  import { runPublicationArtifactCli } from "../scripts/publication-artifact.mjs";
13
13
  import { runPublicationPackageCli } from "../scripts/publication-package.mjs";
14
+ import { runPublicationReproducibilityCli } from "../scripts/publication-reproducibility.mjs";
15
+ import { runPaperCli } from "../scripts/paper.mjs";
16
+ import { BUILDCHAIN_USAGE } from "../scripts/buildchain-cli-help.mjs";
14
17
  import { validateBuildchainConfig } from "../packages/core/buildchain-config.js";
15
18
  import { detectPackageManager } from "../packages/core/package-manager.js";
16
19
  import {
@@ -99,247 +102,14 @@ import {
99
102
  TRUST_RELEASE_COMMANDS,
100
103
  dispatchTrustReleaseCommand,
101
104
  } from "./internal/trust-release-cli.mjs";
105
+ import {
106
+ BUILDCHAIN_COMMAND_REGISTRY,
107
+ dispatchRegisteredCommand,
108
+ } from "./internal/command-registry.mjs";
102
109
 
103
110
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
104
111
  const embeddedPackageVersion = process.env.BUILDCHAIN_EMBEDDED_PACKAGE_VERSION || "";
105
-
106
- function usage() {
107
- return `Usage:
108
- buildchain --help
109
- buildchain version
110
- buildchain layout [--cwd <dir>] [--json]
111
- buildchain portable-cache plan --manifest <file-or-json> [--output <file>]
112
- [--github-output <file>] [--json]
113
- buildchain portable-cache receipt --plan <file-or-json> [--matched-key <key>]
114
- [--cache-hit true|false]
115
- [--validation-status pass|fail]
116
- [--validation-reason <text>]
117
- [--cold-fallback-status not-run|passed|failed]
118
- [--output <file>] [--json]
119
- buildchain candidate timeline --input <file-or-json> [--output <file>] [--json]
120
- buildchain init [--cwd <dir>] [--type package|native|web-surface|infra-contract|publication-artifact|anchored-package] [--force]
121
- [--package-manager pnpm|npm|yarn] [--runner-preset <preset>]
122
- [--artifact-name <template>]
123
- buildchain validate [--cwd <dir>] [--require-version-state]
124
- [--require-lifecycle-stages <comma-list>]
125
- buildchain lifecycle run <stage> [--cwd <dir>] [--required]
126
- [--artifact-name <name>] [--artifact-path <path>]...
127
- [--manifest-path <path>] [--summary-path <path>]
128
- [--process-summary <json>]
129
- buildchain npm dry-run [--cwd <dir>] [--expected-tag <tag>] [--registry <url>]
130
- [--dist-tag <tag>] [--skip-npm-publish-dry-run] [--json]
131
- buildchain release --dry-run --target-ref <ref> [--sha <sha>] [--source-ref <ref>]
132
- [--tags <comma-list>] [--json]
133
- buildchain release explain --target-ref <ref> [--sha <sha>] [--source-ref <ref>]
134
- [--tags <comma-list>] [--json]
135
- buildchain release dry-run --target-ref <ref> [--sha <sha>] [--source-ref <ref>]
136
- [--tags <comma-list>] [--json]
137
- buildchain release line open --major <n> --minor <n> [--source-ref <ref>]
138
- [--initial-version <version>] [--write] [--json]
139
- buildchain release-governance reconcile --repository <owner/repo>
140
- --branch <dev|alpha|release/vN/vN.N>
141
- --candidate-sha <sha> [--apply] [--json]
142
- buildchain github-governance <plan|apply|rollback|protection-policy-plan|ruleset-policy-plan> ...
143
- buildchain release <inspect|recover|finalize|abort> ...
144
- buildchain transaction inspect ...
145
- buildchain collect github-release --tag <tag> [--repository <owner/repo>]
146
- [--assets-dir <dir>] [--assets-json <json-or-path>]
147
- [--release-json <json-or-path>] [--package-set-json <json-or-path>]
148
- [--product-name <name>]
149
- [--publish-evidence-json <json-or-path>]
150
- [--trusted-publishing-json <json-or-path>]
151
- [--transaction-json <json-or-path>]
152
- [--anchor-manifest-json <json-or-path>]
153
- [--impact-json <json-or-path>]
154
- [--build-summary-json <json-or-path>]
155
- [--build-facts-json <json-or-path>]...
156
- [--platform-manifest-json <json-or-path>]...
157
- [--dist-tag-evidence-json <json-or-path>]
158
- [--kfd-1-witness-json <json-or-path>]...
159
- [--kfd-2-claim-json <json-or-path>]...
160
- [--kfd-3-prebuild-witness-json <json-or-path>]...
161
- [--kfd-3-artifact-witness-json <json-or-path>]...
162
- [--kfd-3-artifact-verify-cmd <command>]
163
- [--kfd-support-matrix-json <json-or-path>]
164
- [--kfd-product-gate-json <json-or-path>]...
165
- [--invariant-passport-json <json-or-path>]...
166
- [--invariant-passport-cmd <command>]
167
- [--github-artifact-attestation-policy-json <json-or-path>]...
168
- [--kfd-agent-hub-evidence-json <json-or-path>]
169
- [--base-passport-json <json-or-path>] [--require-base-kfd]
170
- [--release-extra-json <json-or-path>]
171
- [--publish-json <json-or-path>] [--output-dir <dir>] [--json]
172
- buildchain create publication-admission --input-json <file-or-json> [--output <file>] [--json]
173
- buildchain create runner-provenance --input-json <file-or-json> [--output <file>] [--json]
174
- buildchain create github-artifact-attestation-policy --input-json <file-or-json> [--output <file>] [--json]
175
- buildchain verify release-passport <file-or-url> [--json]
176
- buildchain verify github-artifact-attestation <artifact>
177
- --evidence <file> --bundle <file>
178
- --platform-manifest <file> --release-passport <file> [--json]
179
- buildchain verify publication-admission <file-or-json>
180
- --registry-json <file-or-json>
181
- --runner-json <file-or-json>
182
- --control-plane-audit-json <file-or-json>
183
- --publication-evidence-json <file-or-json>
184
- [--expected-json <file-or-json>] [--used-nonce <nonce>]... [--json]
185
- buildchain audit publication-control-plane --repository <owner/repo> --branch <protected-branch>
186
- buildchain audit github-governance [--organization <owner>] [--repository <owner/repo>]
187
- [--output <file>] [--require-qualifying] [--json]
188
- [--source-sha <merged-branch-sha>] [--workflow-repository <owner/repo>]
189
- [--workflow <path>] [--workflow-ref <sha-or-ref>]
190
- [--job <id>] [--environment <name>] [--package <name>]
191
- [--publisher-mode npm-trusted-publisher|github-token|oidc-role]
192
- [--npm-trust-json <file-or-json>]
193
- [--provider-audit-json <file>] [--output <file>] [--allow-nonqualifying]
194
- buildchain verify artifact <file|dir|url|npm:...|oci:...|github-release:...>
195
- [--passport <file-or-url>] [--locator-config <json>]
196
- [--repository <owner/repo>] [--tag <tag>]
197
- [--npm-registry <url>] [--json]
198
- buildchain verify artifact-envelope <file-or-json> [--assessment-time <epoch>]
199
- [--expected-root <sha256:...>] [--expected-issuer <issuer>]
200
- [--expected-publisher <publisher>]
201
- [--expected-contract <version>] [--json]
202
- buildchain project kfx-admission <file-or-json> [--assessment-time <epoch>]
203
- [--expected-root <sha256:...>] [--expected-issuer <issuer>]
204
- [--expected-publisher <publisher>]
205
- [--expected-contract <version>] [--json]
206
- buildchain verify infra-contract-evidence-bundle <file> [--json]
207
- buildchain verify observability-log <jsonl> [--min-events <n>]
208
- [--require-phase <csv>]
209
- [--require-component <csv>]
210
- [--require-event <csv>] [--allow-errors] [--json]
211
- buildchain explain release --passport <file-or-url> [--for human|agent] [--json]
212
- buildchain explain artifact <subject> [--passport <file-or-url>] [--npm-registry <url>] [--for human|agent] [--json]
213
- buildchain inspect release --passport <file-or-url> [--json]
214
- buildchain inspect artifact <subject> [--passport <file-or-url>] [--npm-registry <url>] [--json]
215
- buildchain doctor [--cwd <dir>] [--require-publish-source-lock] [--json]
216
- buildchain dev merge-queue --repository <owner/repo> --branch <dev/vN/vN.M>
217
- [--from-config | --workflow <required-workflow.yml>...] [--cwd <dir>]
218
- [--check-response-timeout-minutes <n>]
219
- [--max-entries-to-build <n>] [--apply]
220
- buildchain log <info|warn|error> --event <name> [--phase <phase>]
221
- [--component <name>] [--source <name>] [--attribute key=value]...
222
- [--path <jsonl>] [--json]
223
- buildchain log summary [--path <jsonl>] [--json]
224
- buildchain diagnostics summary <diagnostics.json>... [--artifact <file>]...
225
- [--output <file>] [--json]
226
- buildchain facts module [--cwd <dir>] [--module <id>] [--module-root <path>]
227
- [--version-source <id>] [--output <file>]
228
- [--output-path <path>]... [--legacy-kungfu-buildinfo <file>] [--json]
229
- buildchain facts aggregate [--cwd <dir>] [--product <id>]
230
- [--module-fact <file>]... [--artifact <path>]...
231
- [--output <file>] [--json]
232
- buildchain facts verify [--cwd <dir>] --fact <file> [--json]
233
- buildchain kfd ...
234
- buildchain kfd hub <init|inspect|test|explain> [--cwd <dir>]
235
- [--declaration <path>] [--output-dir <path>]
236
- [--write] [--force] [--for agent] [--json]
237
- buildchain kfd status [--cwd <dir>] [--json]
238
- buildchain kfd migrate-layout [--cwd <dir>] [--write] [--force] [--json]
239
- buildchain kfd schema list [--standard kfd-1|kfd-2|kfd-3|kfd-4] [--json]
240
- buildchain kfd schema show <kfd-1|kfd-2|kfd-3|kfd-4> [--schema <name>] [--json]
241
- buildchain kfd upstream roles [--json]
242
- buildchain kfd upstream collect [--cwd <dir>] [--output <file>] [--json]
243
- buildchain kfd upstream check [--cwd <dir>] [--aggregate-json <file-or-json>] [--json]
244
- buildchain kfd aggregate [--cwd <dir>] [--json]
245
- buildchain kfd 1 schema [--schema <name>] [--json]
246
- buildchain kfd 1 witness [--cwd <dir>] [--source-sha <sha>] [--output <file>] [--json]
247
- buildchain kfd 1 gate --witness-json <file-or-json>... [--cwd <dir>] [--artifact-root <dir>]
248
- [--output <file>] [--json]
249
- buildchain kfd 1 verify --gate-json <file-or-json> [--json]
250
- buildchain kfd 2 schema [--schema <name>] [--json]
251
- buildchain kfd 2 taxonomy --entry-json <file-or-json>... [--kind residualRisk|downgradeReason] [--json]
252
- buildchain kfd 2 claims [--cwd <dir>] [--output-dir <dir>] [--json]
253
- buildchain kfd 2 product-claims <check|write|render> [--cwd <dir>] [--registry <path>]
254
- [--output-dir <dir>] [--version <version>]
255
- [--channel <channel>] [--tag <tag>] [--source-sha <sha>] [--json]
256
- buildchain kfd 2 trust-claims [--claims-json <file-or-json>] [--json]
257
- buildchain kfd 2 trust-assessment [--assessment-json <file-or-json>] [--json]
258
- buildchain kfd 3 ...
259
- buildchain kfd 3 detect [--cwd <dir>] [--kind <kind>]... [--artifact <path>] [--json]
260
- buildchain kfd 3 register <node-api|python-api|cli|binary|documentation|site-bundle>
261
- [--cwd <dir>] [--registry <path>] [--artifact <path>]
262
- [--product <name>] [--json]
263
- buildchain kfd 3 audit [--cwd <dir>] [--registry <path>] [--artifact <path>] [--json]
264
- buildchain kfd 3 witness [--cwd <dir>] [--registry <path>] [--kind prebuild|artifact]
265
- [--source-sha <sha>] [--artifact <path>] [--output <file>] [--json]
266
- buildchain kfd 3 query [<product>] [--cwd <dir>] [--registry <path>]
267
- [--passport <file-or-url>] [--artifact <path>] [--json]
268
- buildchain kfd 4 schema [--schema <name>] [--json]
269
- buildchain kfd 4 gate --input-json <file-or-json> [--cwd <dir>] [--output <file>] [--json]
270
- buildchain kfd 4 verify --gate-json <file-or-json> [--expected-source-sha <sha>] [--json]
271
- buildchain kfd 5 schema [--schema <name>] [--json]
272
- buildchain kfd 5 gate --input-json <file-or-json> [--cwd <dir>] [--output <file>] [--json]
273
- buildchain kfd 5 verify --gate-json <file-or-json> [--expected-source-sha <sha>] [--json]
274
- buildchain kfd 7 schema [--schema <name>] [--json]
275
- buildchain kfd 7 gate --input-json <file-or-json> [--cwd <dir>] [--output <file>] [--json]
276
- buildchain kfd 7 verify --gate-json <file-or-json> [--expected-source-sha <sha>] [--json]
277
- buildchain kfd support project --matrix-json <file-or-json> --gate-json <file-or-json>...
278
- [--expected-source-sha <sha>] [--checked-at <date-time>]
279
- [--output <file>] [--json]
280
- buildchain kfd support verify --projection-json <file-or-json>
281
- [--expected-source-sha <sha>] [--checked-at <date-time>] [--json]
282
- buildchain sample process-tree [--interval-ms <n>] [--label <name>]
283
- [--output <jsonl>] [--summary-output <json>]
284
- [--requested-parallelism <n>] [--json]
285
- -- <command> [args...]
286
- buildchain mark --event <name> [--phase <phase>] [--component <name>]
287
- [--attribute key=value]... [--path <jsonl>] [--json]
288
- buildchain span --event <name> [--phase <phase>] [--component <name>]
289
- [--path <jsonl>] -- <command> [args...]
290
- buildchain web-surface ...
291
- buildchain infra-contract ...
292
- buildchain publication-artifact manifest [--cwd <dir>] [--source-sha <sha>]
293
- [--output <file>] [--passport-output <file>]
294
- [--registry-output <file>] [--source-bundle <file>]
295
- [--no-source-bundle] [--json]
296
- buildchain publication-artifact npm-package [--cwd <dir>] [--output-dir <dir>] [--package-name <name>] [--json]
297
- buildchain release-propagation <plan|write-lock> ...
298
- buildchain badges readme [--cwd <dir>] [--readme <path>] [--check] [--write] [--json]
299
- buildchain badges bundle [--cwd <dir>] [--readme <path>] [--claims <csv>] [--check] [--write] [--json]
300
- buildchain homebrew update-formula --package <name> --release-passport <file-or-url> [--write] [--json]
301
- buildchain homebrew check [--cwd <dir>] [--package <name>] [--release-passport <file-or-url>] [--json]
302
- buildchain publish-source <lock|manifest|verify-lock|verify-channel-ref|validate-anchored-release> ...
303
- buildchain build-contract ...
304
-
305
- Examples:
306
- buildchain init --type package --package-manager pnpm
307
- buildchain validate --require-version-state --require-lifecycle-stages build,verify
308
- buildchain lifecycle run build --artifact-path dist --artifact-name "{repo}-{version}-{platform}"
309
- buildchain npm dry-run --json
310
- buildchain release --dry-run --target-ref alpha/v3/v3.0
311
- buildchain release line open --major 3 --minor 1 --source-ref release/v3/v3.0 --json
312
- buildchain span --event native.build -- cmake --build build
313
- buildchain collect github-release --tag v3.0.0 --assets-dir dist --output-dir .buildchain/release-passport
314
- buildchain create publication-admission --input-json admission-input.json --output admission.json
315
- buildchain create runner-provenance --input-json runner-input.json --output runner.json
316
- buildchain verify release-passport .buildchain/release-passport/buildchain.release.json
317
- buildchain verify publication-admission admission.json --registry-json publication-authority-registry.json --runner-json runner.json --control-plane-audit-json control-plane.json --expected-json expected.json --json
318
- buildchain audit publication-control-plane --repository kungfu-systems/buildchain --branch release/v3/v3.0
319
- buildchain verify artifact ./dist/buildchain-x86_64-unknown-linux-gnu.tar.gz --passport .buildchain/release-passport/buildchain.release.json
320
- buildchain verify artifact-envelope .buildchain/kfx/artifact-verification-envelope.json --json
321
- buildchain project kfx-admission .buildchain/kfx/artifact-verification-envelope.json --json
322
- buildchain verify infra-contract-evidence-bundle .buildchain/infra-contract-evidence-bundle.json
323
- buildchain verify observability-log .buildchain/logs/events.jsonl --min-events 4 --require-phase build
324
- buildchain infra-contract --mode plan --source-sha <sha>
325
- buildchain infra-contract --mode ci --source-sha <sha>
326
- buildchain infra-contract --mode plan --source-sha <sha> --execute-adapter-commands true
327
- buildchain infra-contract --mode apply --plan <plan.json> --source-sha <sha> --approval-id <id>
328
- buildchain infra-contract --mode apply --plan <plan.json> --source-sha <sha> --approval-id <id> --dry-run false --execute-adapter-commands true
329
- buildchain infra-contract --mode propagation-apply --propagation-plan <plan.json> --dry-run true
330
- buildchain infra-contract --mode evidence-bundle --artifact <artifact.json> --propagation-result <result.json>
331
- buildchain publication-artifact manifest --source-sha <sha> --json
332
- buildchain release-propagation plan --graph graph.json --upstream-release release.json --json
333
- buildchain kfd status --json
334
- buildchain kfd schema list --json
335
- buildchain kfd 1 witness --json
336
- buildchain kfd 2 claims --json
337
- buildchain kfd 2 trust-assessment --json
338
- buildchain kfd upstream collect --json
339
- buildchain kfd aggregate --json
340
- buildchain kfd 3 query buildchain --json
341
- `;
342
- }
112
+ const embeddedSourceSha = process.env.BUILDCHAIN_EMBEDDED_SOURCE_SHA || "";
343
113
 
344
114
  function readAttributes(args) {
345
115
  const attributes = {};
@@ -1456,10 +1226,9 @@ async function runProcessTreeSample(sampleArgs = []) {
1456
1226
  return report;
1457
1227
  }
1458
1228
 
1459
- async function main(argv = process.argv.slice(2)) {
1460
- const [command, ...args] = argv;
1229
+ async function runRegisteredCommand(command, args) {
1461
1230
  if (!command || command === "-h" || command === "--help" || command === "help") {
1462
- process.stdout.write(usage());
1231
+ process.stdout.write(BUILDCHAIN_USAGE);
1463
1232
  return;
1464
1233
  }
1465
1234
 
@@ -1814,10 +1583,25 @@ async function main(argv = process.argv.slice(2)) {
1814
1583
  runPublicationPackageCli(args.slice(1));
1815
1584
  return;
1816
1585
  }
1586
+ if (args[0] === "reproducibility" || args[0] === "reproducible") {
1587
+ runPublicationReproducibilityCli(args.slice(1));
1588
+ return;
1589
+ }
1817
1590
  runPublicationArtifactCli(args);
1818
1591
  return;
1819
1592
  }
1820
1593
 
1594
+ if (command === "paper") {
1595
+ await runPaperCli(args, {
1596
+ buildchainRoot: root,
1597
+ buildchainVersion: packageVersion(),
1598
+ buildchainRef: process.env.BUILDCHAIN_RUNTIME_REF || "v3",
1599
+ buildchainSha:
1600
+ process.env.BUILDCHAIN_RUNTIME_SHA || embeddedSourceSha || "",
1601
+ });
1602
+ return;
1603
+ }
1604
+
1821
1605
  if (command === "release-propagation") {
1822
1606
  runReleasePropagationCli(args);
1823
1607
  return;
@@ -1886,6 +1670,22 @@ async function main(argv = process.argv.slice(2)) {
1886
1670
  throw new Error(`unsupported buildchain command: ${command}`);
1887
1671
  }
1888
1672
 
1673
+ const BUILDCHAIN_COMMAND_HANDLERS = Object.freeze(Object.fromEntries(
1674
+ BUILDCHAIN_COMMAND_REGISTRY.map((entry) => [
1675
+ entry.id,
1676
+ (args) => runRegisteredCommand(entry.id, args),
1677
+ ]),
1678
+ ));
1679
+
1680
+ async function main(argv = process.argv.slice(2)) {
1681
+ const [command = "help", ...args] = argv;
1682
+ return dispatchRegisteredCommand({
1683
+ command,
1684
+ args,
1685
+ handlers: BUILDCHAIN_COMMAND_HANDLERS,
1686
+ });
1687
+ }
1688
+
1889
1689
  main().catch((error) => {
1890
1690
  console.error(`buildchain: ${error.message}`);
1891
1691
  process.exitCode = 1;
@@ -0,0 +1,82 @@
1
+ const BUILDCHAIN_COMMAND_REGISTRY = Object.freeze([
2
+ { id: "help", aliases: ["-h", "--help"] },
3
+ { id: "version", aliases: ["-v", "--version"] },
4
+ { id: "layout", aliases: [] },
5
+ { id: "portable-cache", aliases: [] },
6
+ { id: "candidate", aliases: [] },
7
+ { id: "init", aliases: [] },
8
+ { id: "validate", aliases: [] },
9
+ { id: "doctor", aliases: [] },
10
+ { id: "dev", aliases: [] },
11
+ { id: "log", aliases: [] },
12
+ { id: "diagnostics", aliases: [] },
13
+ { id: "facts", aliases: [] },
14
+ { id: "kfd", aliases: [] },
15
+ { id: "sample", aliases: [] },
16
+ { id: "mark", aliases: [] },
17
+ { id: "span", aliases: [] },
18
+ { id: "lifecycle", aliases: [] },
19
+ { id: "npm", aliases: [] },
20
+ { id: "audit", aliases: [] },
21
+ { id: "collect", aliases: [] },
22
+ { id: "create", aliases: [] },
23
+ { id: "explain", aliases: [] },
24
+ { id: "inspect", aliases: [] },
25
+ { id: "project", aliases: [] },
26
+ { id: "release", aliases: [] },
27
+ { id: "transaction", aliases: [] },
28
+ { id: "verify", aliases: [] },
29
+ { id: "web-surface", aliases: [] },
30
+ { id: "infra-contract", aliases: [] },
31
+ { id: "publication-artifact", aliases: ["publication"] },
32
+ { id: "paper", aliases: [] },
33
+ { id: "release-propagation", aliases: [] },
34
+ { id: "release-governance", aliases: [] },
35
+ { id: "github-governance", aliases: [] },
36
+ { id: "badges", aliases: [] },
37
+ { id: "homebrew", aliases: [] },
38
+ { id: "build-contract", aliases: [] },
39
+ { id: "publish-source", aliases: [] },
40
+ ]);
41
+
42
+ function buildCommandLookup(registry = BUILDCHAIN_COMMAND_REGISTRY) {
43
+ const lookup = new Map();
44
+ for (const entry of registry) {
45
+ for (const name of [entry.id, ...entry.aliases]) {
46
+ if (lookup.has(name)) {
47
+ throw new Error(
48
+ `duplicate Buildchain CLI command registration: ${name}`,
49
+ );
50
+ }
51
+ lookup.set(name, entry);
52
+ }
53
+ }
54
+ return lookup;
55
+ }
56
+
57
+ const BUILDCHAIN_COMMAND_LOOKUP = buildCommandLookup();
58
+
59
+ function resolveBuildchainCommand(command) {
60
+ return BUILDCHAIN_COMMAND_LOOKUP.get(command || "help");
61
+ }
62
+
63
+ async function dispatchRegisteredCommand({ command, args = [], handlers }) {
64
+ const registration = resolveBuildchainCommand(command);
65
+ if (!registration) {
66
+ throw new Error(`unsupported buildchain command: ${command}`);
67
+ }
68
+ const handler = handlers?.[registration.id];
69
+ if (typeof handler !== "function") {
70
+ throw new Error(
71
+ `Buildchain CLI command has no registered handler: ${registration.id}`,
72
+ );
73
+ }
74
+ return handler(args, { command, registration });
75
+ }
76
+
77
+ export {
78
+ BUILDCHAIN_COMMAND_REGISTRY,
79
+ buildCommandLookup,
80
+ dispatchRegisteredCommand,
81
+ resolveBuildchainCommand,
82
+ };
@@ -202,6 +202,7 @@ async function dispatchTrustReleaseCommand({ command, args, runScript, packageVe
202
202
  kfdProductGateJsons: readRepeatedFlag(collectArgs, "kfd-product-gate-json"),
203
203
  invariantPassportJsons: readRepeatedFlag(collectArgs, "invariant-passport-json"),
204
204
  invariantPassportCommand: readFlag(collectArgs, "invariant-passport-cmd", ""),
205
+ releaseEvidenceJsons: readRepeatedFlag(collectArgs, "release-evidence-json"),
205
206
  githubArtifactAttestationPolicyJsons: readRepeatedFlag(
206
207
  collectArgs,
207
208
  "github-artifact-attestation-policy-json",
@@ -131,6 +131,121 @@
131
131
  }
132
132
  }
133
133
  },
134
+ "responsive-web-delivery-v1": {
135
+ "extends": "web-delivery-v1",
136
+ "mode": "web-delivery",
137
+ "renditions": [
138
+ {
139
+ "path": "demo.gif",
140
+ "role": "readme-compatibility",
141
+ "mimeType": "image/gif",
142
+ "container": "gif",
143
+ "videoCodec": "gif",
144
+ "audioStreams": 0,
145
+ "maximumBytes": 1048576,
146
+ "budgetBasis": {
147
+ "evidence": "contracts/evidence/auditable-demo-web-delivery-v1.json",
148
+ "observedPath": "demo.gif",
149
+ "observedBytes": 40826,
150
+ "multiplier": 16,
151
+ "rounding": "next-power-of-two"
152
+ },
153
+ "dimensions": {
154
+ "policy": "exact-downscale-same-aspect",
155
+ "width": 1280,
156
+ "height": 720
157
+ }
158
+ },
159
+ {
160
+ "path": "demo.mp4",
161
+ "role": "primary-video",
162
+ "mimeType": "video/mp4",
163
+ "container": "mp4",
164
+ "videoCodec": "h264",
165
+ "pixelFormat": "yuv420p",
166
+ "audioStreams": 0,
167
+ "maximumBytes": 2097152,
168
+ "budgetBasis": {
169
+ "evidence": "contracts/evidence/auditable-demo-web-delivery-v1.json",
170
+ "observedPath": "demo.mp4",
171
+ "observedBytes": 27038,
172
+ "multiplier": 64,
173
+ "rounding": "next-power-of-two"
174
+ },
175
+ "progressiveDownload": "moov-before-mdat",
176
+ "frameRatePolicy": "scene-exact"
177
+ },
178
+ {
179
+ "path": "demo.webm",
180
+ "role": "alternate-video",
181
+ "mimeType": "video/webm",
182
+ "container": "webm",
183
+ "videoCodec": "vp9",
184
+ "pixelFormat": "yuv420p",
185
+ "audioStreams": 0,
186
+ "maximumBytes": 2097152,
187
+ "budgetBasis": {
188
+ "evidence": "contracts/evidence/auditable-demo-web-delivery-v1.json",
189
+ "observedPath": "demo.webm",
190
+ "observedBytes": 23383,
191
+ "multiplier": 64,
192
+ "rounding": "next-power-of-two"
193
+ },
194
+ "frameRatePolicy": "scene-exact"
195
+ },
196
+ {
197
+ "path": "demo-720p.mp4",
198
+ "role": "responsive-primary-video",
199
+ "mimeType": "video/mp4",
200
+ "container": "mp4",
201
+ "videoCodec": "h264",
202
+ "pixelFormat": "yuv420p",
203
+ "audioStreams": 0,
204
+ "maximumBytes": 2097152,
205
+ "budgetBasis": {
206
+ "evidence": "contracts/evidence/auditable-demo-web-delivery-v1.json",
207
+ "observedPath": "demo.mp4",
208
+ "observedBytes": 27038,
209
+ "multiplier": 64,
210
+ "rounding": "next-power-of-two"
211
+ },
212
+ "progressiveDownload": "moov-before-mdat",
213
+ "frameRatePolicy": "scene-exact",
214
+ "dimensions": {
215
+ "policy": "exact-downscale-same-aspect",
216
+ "width": 1280,
217
+ "height": 720
218
+ }
219
+ },
220
+ {
221
+ "path": "demo-720p.webm",
222
+ "role": "responsive-alternate-video",
223
+ "mimeType": "video/webm",
224
+ "container": "webm",
225
+ "videoCodec": "vp9",
226
+ "pixelFormat": "yuv420p",
227
+ "audioStreams": 0,
228
+ "maximumBytes": 2097152,
229
+ "budgetBasis": {
230
+ "evidence": "contracts/evidence/auditable-demo-web-delivery-v1.json",
231
+ "observedPath": "demo.webm",
232
+ "observedBytes": 23383,
233
+ "multiplier": 64,
234
+ "rounding": "next-power-of-two"
235
+ },
236
+ "frameRatePolicy": "scene-exact",
237
+ "dimensions": {
238
+ "policy": "exact-downscale-same-aspect",
239
+ "width": 1280,
240
+ "height": 720
241
+ }
242
+ }
243
+ ],
244
+ "singletonRoles": [
245
+ "responsive-primary-video",
246
+ "responsive-alternate-video"
247
+ ]
248
+ },
134
249
  "site-hero-v1": {
135
250
  "extends": "web-delivery-v1",
136
251
  "mode": "web-delivery",
@@ -155,7 +270,7 @@
155
270
  }
156
271
  },
157
272
  "qualification": {
158
- "dimensions": "exact-scene",
273
+ "dimensions": "exact-scene-or-profile-declared-downscale",
159
274
  "durationToleranceMs": 600,
160
275
  "memberRootAlgorithm": "sha256",
161
276
  "nonClaims": [
@@ -7,24 +7,6 @@
7
7
  "unclassifiedV2TokensAllowed": false
8
8
  },
9
9
  "entries": [
10
- {
11
- "path": ".github/workflows/.build.yml",
12
- "token": "BUILDCHAIN_DEFAULT_REF: v2",
13
- "expectedOccurrences": 1,
14
- "classification": "public-contract-compatibility-fallback",
15
- "callerStatus": "fallback-only-when-workflow-shell-ref-is-unavailable",
16
- "owner": "buildchain-maintainers",
17
- "sunsetCondition": "Change only at a governed major contract boundary after consumer migration."
18
- },
19
- {
20
- "path": ".github/workflows/.build.yml",
21
- "token": "BUILDCHAIN_DEFAULT_REF || \"v2\"",
22
- "expectedOccurrences": 1,
23
- "classification": "public-contract-compatibility-fallback",
24
- "callerStatus": "fallback-only-when-workflow-shell-ref-is-unavailable",
25
- "owner": "buildchain-maintainers",
26
- "sunsetCondition": "Change only at a governed major contract boundary after consumer migration."
27
- },
28
10
  {
29
11
  "path": ".github/workflows/.bump-minor-version.yml",
30
12
  "token": "kungfu-systems/buildchain/actions/bump-version@v2",
@@ -115,24 +97,6 @@
115
97
  "owner": "buildchain-maintainers",
116
98
  "sunsetCondition": "Remove only after the compatibility workflow entry itself is removed."
117
99
  },
118
- {
119
- "path": ".github/workflows/.web-surface.yml",
120
- "token": "BUILDCHAIN_DEFAULT_REF: v2",
121
- "expectedOccurrences": 1,
122
- "classification": "public-contract-compatibility-fallback",
123
- "callerStatus": "fallback-only-when-workflow-shell-ref-is-unavailable",
124
- "owner": "buildchain-maintainers",
125
- "sunsetCondition": "Change only at a governed major contract boundary after consumer migration."
126
- },
127
- {
128
- "path": ".github/workflows/.web-surface.yml",
129
- "token": "BUILDCHAIN_DEFAULT_REF || \"v2\"",
130
- "expectedOccurrences": 1,
131
- "classification": "public-contract-compatibility-fallback",
132
- "callerStatus": "fallback-only-when-workflow-shell-ref-is-unavailable",
133
- "owner": "buildchain-maintainers",
134
- "sunsetCondition": "Change only at a governed major contract boundary after consumer migration."
135
- },
136
100
  {
137
101
  "path": ".github/workflows/.wheel-release.yml",
138
102
  "token": "workflows v2 wheel release path is retired",
@@ -160,15 +124,6 @@
160
124
  "owner": "buildchain-maintainers",
161
125
  "sunsetCondition": "Remove after wheel consumers migrate to the lifecycle version command."
162
126
  },
163
- {
164
- "path": ".github/workflows/binary-distribution.yml",
165
- "token": "v2.2.0-alpha.0",
166
- "expectedOccurrences": 1,
167
- "classification": "artifact-version-example",
168
- "callerStatus": "manual-input",
169
- "owner": "buildchain-maintainers",
170
- "sunsetCondition": "Replace when the binary-distribution manual default is refreshed independently of runtime routing."
171
- },
172
127
  {
173
128
  "path": ".github/workflows/candidate-lab.yml",
174
129
  "token": "default: \"v2\"",