@kungfu-tech/buildchain 3.0.2 → 3.0.3-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.
Files changed (127) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +27 -1
  4. package/actions/promote-buildchain-ref/README.md +90 -19
  5. package/actions/report-buildchain-issue/README.md +20 -2
  6. package/actions/run-lifecycle/README.md +5 -0
  7. package/actions/validate-config/README.md +19 -1
  8. package/bin/buildchain.mjs +56 -2
  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 +146 -0
  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 +188 -46
  19. package/dist/site/buildchain-site.json +181 -90
  20. package/dist/site/capability-registry.json +5 -5
  21. package/dist/site/cli-registry.json +860 -98
  22. package/dist/site/controller-registry.json +118 -5
  23. package/dist/site/kfd-claims.json +233 -19
  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 +374 -59
  27. package/dist/site/page-registry.json +156 -65
  28. package/dist/site/public-surface-audit.json +231 -22
  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 +575 -79
  33. package/docs/MAP.md +22 -4
  34. package/docs/auditable-demo.md +54 -13
  35. package/docs/aws-us-elastic-runner-burst-plane.md +381 -0
  36. package/docs/cli.md +119 -12
  37. package/docs/consumer-issue-reporting.md +20 -2
  38. package/docs/dev-alpha-candidate-patrol.md +24 -10
  39. package/docs/github-governance-authority.md +24 -31
  40. package/docs/lifecycle-protocol.md +20 -2
  41. package/docs/migration-inventory.md +24 -5
  42. package/docs/observed-evidence-patrol.md +28 -12
  43. package/docs/ownership.md +19 -1
  44. package/docs/publication-artifacts.md +158 -18
  45. package/docs/publication-authority.md +4 -4
  46. package/docs/publish-transaction.md +78 -31
  47. package/docs/release-candidate.md +24 -0
  48. package/docs/release-flow.md +50 -32
  49. package/docs/release-governance.md +39 -32
  50. package/docs/release-passport.md +4 -0
  51. package/docs/release-propagation.md +57 -12
  52. package/docs/reusable-build-surface.md +218 -90
  53. package/docs/runtime-train-validation.md +20 -2
  54. package/docs/shifu-gate-profiles.md +7 -1
  55. package/docs/stable-candidate-patrol.md +6 -6
  56. package/docs/toolkit-observability.md +22 -0
  57. package/docs/versioning.md +46 -24
  58. package/docs/web-surface-deployments.md +82 -1
  59. package/package.json +7 -5
  60. package/packages/core/README.md +60 -4
  61. package/packages/core/artifact-signing.js +1 -0
  62. package/packages/core/buildchain-contract.js +9 -4
  63. package/packages/core/cache-evidence.js +1 -0
  64. package/packages/core/controller-evidence.js +2 -0
  65. package/packages/core/diagnostics.js +105 -30
  66. package/packages/core/github-governance-authority.js +25 -17
  67. package/packages/core/index.js +40 -0
  68. package/packages/core/paper.js +3226 -0
  69. package/packages/core/public-surface-audit.js +3 -0
  70. package/packages/core/publication-artifact.js +1 -6
  71. package/packages/core/publication-authority.js +1 -0
  72. package/packages/core/publication-control-plane-audit.js +28 -0
  73. package/packages/core/publication-reproducibility.js +947 -0
  74. package/packages/core/publication-sealed-bundle.js +190 -0
  75. package/packages/core/publish-transaction.js +147 -17
  76. package/packages/core/release-candidate.js +234 -0
  77. package/packages/core/release-passport.js +519 -228
  78. package/packages/core/release-propagation.js +175 -1
  79. package/packages/core/stable-release-gate.js +4 -1
  80. package/scripts/artifact-signing-delegation.mjs +268 -0
  81. package/scripts/audit-github-governance.mjs +32 -13
  82. package/scripts/audit-publication-control-plane.mjs +17 -8
  83. package/scripts/auditable-demo.mjs +266 -7
  84. package/scripts/aws-codebuild-toolchain.mjs +285 -0
  85. package/scripts/aws-macos-jit-core.mjs +378 -0
  86. package/scripts/aws-macos-jit.mjs +123 -0
  87. package/scripts/aws-runner-burst-core.mjs +248 -0
  88. package/scripts/aws-runner-burst.mjs +79 -0
  89. package/scripts/aws-windows-jit-core.mjs +374 -0
  90. package/scripts/aws-windows-jit.mjs +121 -0
  91. package/scripts/build-contract-core.mjs +69 -6
  92. package/scripts/build-standalone-binary.mjs +23 -0
  93. package/scripts/buildchain-contract-lock.mjs +1 -1
  94. package/scripts/buildchain-patrol.mjs +1 -1
  95. package/scripts/check-internal-architecture.mjs +69 -2
  96. package/scripts/check-inventory.mjs +70 -2
  97. package/scripts/check-javascript-syntax.mjs +31 -0
  98. package/scripts/check-maintainability.mjs +371 -0
  99. package/scripts/compiler-cache-evidence.mjs +221 -0
  100. package/scripts/dev-alpha-candidate-patrol.mjs +288 -43
  101. package/scripts/dispatch-artifact-signing-authority.mjs +7 -1
  102. package/scripts/finalize-native-artifact-signing-result.mjs +185 -31
  103. package/scripts/gate-profile-core.mjs +6 -1
  104. package/scripts/generate-channel-promotion-workflow.mjs +3 -12
  105. package/scripts/generate-release-candidate-passport.mjs +4 -0
  106. package/scripts/generate-site-bundle.mjs +84 -18
  107. package/scripts/import-artifact-signing-results.mjs +64 -5
  108. package/scripts/inspect-artifact-signing-requests.mjs +52 -14
  109. package/scripts/maintainability-metrics.mjs +339 -0
  110. package/scripts/npm-publish-transaction.mjs +57 -6
  111. package/scripts/observed-evidence.mjs +151 -33
  112. package/scripts/paper.mjs +645 -0
  113. package/scripts/promotion-channel-router.mjs +16 -4
  114. package/scripts/publication-reproducibility.mjs +62 -0
  115. package/scripts/reconcile-github-governance.mjs +8 -1
  116. package/scripts/release-propagation.mjs +39 -0
  117. package/scripts/resolve-artifact-signing-upload-route.mjs +55 -0
  118. package/scripts/resolve-build-contract.mjs +6 -0
  119. package/scripts/route-offline-runners.mjs +236 -0
  120. package/scripts/run-candidate-body-prefix-renderer.mjs +187 -0
  121. package/scripts/run-lifecycle-core.mjs +62 -1
  122. package/scripts/runtime-ref-core.mjs +36 -4
  123. package/scripts/seal-artifact-signing-requests.mjs +64 -12
  124. package/scripts/stable-candidate-qualification.mjs +50 -0
  125. package/scripts/verify-artifact-signing-results.mjs +26 -1
  126. package/scripts/web-surface-core.mjs +272 -86
  127. package/scripts/web-surface-production-decision.mjs +19 -3
@@ -1,3 +1,21 @@
1
+ ---
2
+ status: draft
3
+ period: ongoing
4
+ theme: buildchain-versioning
5
+ doc_type: policy
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-07-31
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-07-30
16
+ invisible_context_boundary: Live release and provider state must be verified independently.
17
+ ---
18
+
1
19
  # Buildchain Versioning
2
20
 
3
21
  Buildchain uses semantic version lines to describe public contracts, not only
@@ -7,15 +25,15 @@ on.
7
25
 
8
26
  ## Lines
9
27
 
10
- | Line | Meaning |
11
- | --- | --- |
12
- | Patch | Compatible fix, hardening, documentation correction, or implementation repair inside an existing surface. |
28
+ | Line | Meaning |
29
+ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
+ | Patch | Compatible fix, hardening, documentation correction, or implementation repair inside an existing surface. |
13
31
  | Minor | New compatible welded surface: reusable workflow output, CLI command family, config protocol, published subpath, evidence file, runner contract, or agent-readable artifact. |
14
- | Major | Breaking semantic change, removed stable surface, changed branch/tag governance, or incompatible protocol rewrite. |
32
+ | Major | Breaking semantic change, removed stable surface, changed branch/tag governance, or incompatible protocol rewrite. |
15
33
 
16
- Kungfu minor lines are long-lived trains. `v2.0`, `v2.1`, and `v2.2` can each
17
- receive many patch releases. The major ref, such as `v2`, points at the
18
- selected stable major entrypoint; the minor ref, such as `v2.2`, points at the
34
+ Kungfu minor lines are long-lived trains. `v3.0`, `v3.1`, and `v3.2` can each
35
+ receive many patch releases. The major ref, such as `v3`, points at the
36
+ selected stable major entrypoint; the minor ref, such as `v3.2`, points at the
19
37
  latest stable production patch for that minor line.
20
38
 
21
39
  ## Welded Surfaces
@@ -59,23 +77,27 @@ repository changes are patch".
59
77
 
60
78
  ## Decision Log
61
79
 
62
- | Date | Action | Line | Faces | Class | Rationale | PR |
63
- | --- | --- | --- | --- | --- | --- | --- |
64
- | 2026-07-28 | extend-minor | `v3.0` | auditable-demo-workflow, auditable-demo-media-profile, auditable-demo-media-receipt | additive | Add opt-in archive, web-delivery, and site-hero profiles; independently bind codec, container, audio, layout, byte-budget, role, and fast-start facts into a v2 media receipt while preserving the existing archive default. | |
65
- | 2026-07-26 | extend-minor | `v3.0` | auditable-demo-workflow, auditable-demo-evidence | additive | Forward-port the consumer-neutral reusable Gate that binds exact same-run GitHub Artifacts to checked-in adapters and immutable renderer evidence, with optional media rendering only from the exact passing Gate bundle. | #1862 |
66
- | 2026-07-23 | extend-minor | `v2.14` | credential-island-macos-input, protected-signer-job, macos-signing-evidence, action-subpaths | additive | The reusable build surface can seal an exact source-bound macOS app and hand it to a protected caller environment, where an immutable Buildchain action signs, notarizes, staples, Gatekeeper-assesses, and returns an auditable additional release-candidate platform without exposing credentials to consumer lifecycle jobs. | |
67
- | 2026-07-20 | extend-minor | `v2.14` | anchored-derived-version-material, build-controller-evidence, release-passport, package-subpaths, release-propagation-controller | additive | Anchored/manual consumers can declare derived version witnesses that Buildchain regenerates and verifies before heavy builds, binds to exact alpha/release trees and passports, and admits during protected promotion; propagation receipts now model their existing optional consumer stages. | |
68
- | 2026-07-17 | extend-minor | `v2.14` | merge-queue-config, release-line-governance-inheritance | additive | Buildchain config can explicitly enable, inherit, or disable exact dev-channel merge queues, and release-line bootstrap reconciles the declared or inherited policy before moving the repository default branch. | |
69
- | 2026-07-16 | open-minor | `v2.14` | dev-merge-queue-governance | additive | The public CLI adds a dry-run-first, idempotent merge-queue governance command that verifies required workflow event compatibility before applying an exact dev-channel ruleset and removing the strict up-to-date race. | |
70
- | 2026-07-15 | open-minor | `v2.13` | artifact-verification-envelope, package-subpaths | additive | The public envelope seals exact artifact, provenance, identity, lifecycle, revocation, and existing KFD assessment roots into one consumer-ready KFX admission input, with a dedicated Node API export and fail-closed verifier. | |
71
- | 2026-07-11 | open-minor | `v2.12` | channel-build-router, channel-selection-protocol | additive | The public `build.yml` reusable workflow lets consumers declare one build job while Buildchain selects generic major alpha for development/prerelease intent and stable major for production release intent, with explicit overrides, separate locks, and fail-closed ambiguity handling. | |
72
- | 2026-07-08 | open-minor | `v2.9` | build-facts-contract | additive | Build Facts add a public CLI command family, Node API export, config protocol, module/product fact contracts, release-passport evidence section, and Kungfu legacy buildinfo projection from the same source facts. | |
73
- | 2026-07-06 | open-minor | `v2.8` | kfd-1-contract-world-release-gate, kfd-2-release-trust-passport-audit, kfd-3-collaboration-interface-trust-proof, publish-source-lock-enforcement, required-check-protection | additive | KFD release gates add KFD-1 self contract verification, KFD-2 public release trust claim audit, KFD-3 collaboration-interface trust proofs, publish-side source-lock enforcement for promote-only wrappers, and protected channel required checks repaired to bind GitHub Actions check runs instead of legacy commit status contexts. | |
74
- | 2026-07-04 | open-minor | `v2.5` | scheduled-integration-governance | additive | Scheduled integration governance adds scheduled feature-branch discovery, conflict-free integration, reporting, and agent-visible governance automation for dev-line maintenance. | |
75
- | 2026-07-03 | open-minor | `v2.4` | infra-contract-lifecycle | additive | Infra contract lifecycle adds the provider-neutral `infra-contract` CLI command family, project type, adapter capability contract, lifecycle evidence bundle, propagation evidence, CI evidence mode, and consumer-facing contract artifacts. | |
76
- | 2026-07-02 | open-minor | `v2.3` | web-surface-host-mapping | additive | Web surface host mapping adds first-class multi-host surface bindings, reusable workflow URL outputs, per-surface deployment overrides, and an agent-readable fixture contract. | |
77
- | 2026-07-02 | open-minor | `v2.2` | release-passport, binary-distribution | additive | Release passport and binary distribution add agent-readable release passport files, artifact evidence, impact ledger, agent index, GitHub Release collection and verification commands, and standalone binary assets. | |
78
- | 2026-07-02 | open-minor | `v2.1` | logging-sdk, cli-observability, package-subpaths | additive | Buildchain toolkit observability adds the public logging SDK, CLI observability commands, and package subpaths that consumers can import. | |
80
+ | Date | Action | Line | Faces | Class | Rationale | PR |
81
+ | ---------- | ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
82
+ | 2026-07-31 | extend-minor | `v3.0` | auditable-demo-workflow, auditable-demo-media-profile, auditable-demo-media-receipt | additive | Add an opt-in responsive profile that binds source-resolution and exact 1280x720 MP4/WebM/GIF renditions to one Gate and receipt while rejecting upscales, aspect-ratio drift, and profile changes between Gate-only and full-render paths. | |
83
+ | 2026-07-31 | extend-minor | `v3.0` | release-candidate-family-evidence, release-passport-evidence-attachment, promotion-action, release-passport-cli | additive | Restore all-ref v2 parity for optional Initiative-family candidate binding and typed product-owned release evidence attachments while retaining Kungfu native Family State authority and the newer v3 post-activation released-evidence stage. | #2089 |
84
+ | 2026-07-30 | extend-minor | `v3.0` | reusable-build-workflow, observed-evidence-bundle, release-passport-json-reader, web-surface-release-governance | additive | Add bounded artifact compression and remote-read controls plus transactional derived evidence projections while repairing release-PR runtime handoff so production remains protected-main-only. | |
85
+ | 2026-07-29 | extend-minor | `v3.0` | artifact-signing-config, apple-developer-id-authority, artifact-signing-evidence | additive | Extend the consumer-neutral signing declaration to macOS compound archives, including nested wheel Mach-O signing, PEP 427 RECORD repair, safe archive reconstruction, and whole-product notarization under the same protected authority. | |
86
+ | 2026-07-28 | extend-minor | `v3.0` | auditable-demo-workflow, auditable-demo-media-profile, auditable-demo-media-receipt | additive | Add opt-in archive, web-delivery, and site-hero profiles; independently bind codec, container, audio, layout, byte-budget, role, and fast-start facts into a v2 media receipt while preserving the existing archive default. | |
87
+ | 2026-07-26 | extend-minor | `v3.0` | auditable-demo-workflow, auditable-demo-evidence | additive | Forward-port the consumer-neutral reusable Gate that binds exact same-run GitHub Artifacts to checked-in adapters and immutable renderer evidence, with optional media rendering only from the exact passing Gate bundle. | #1862 |
88
+ | 2026-07-23 | extend-minor | `v2.14` | credential-island-macos-input, protected-signer-job, macos-signing-evidence, action-subpaths | additive | The reusable build surface can seal an exact source-bound macOS app and hand it to a protected caller environment, where an immutable Buildchain action signs, notarizes, staples, Gatekeeper-assesses, and returns an auditable additional release-candidate platform without exposing credentials to consumer lifecycle jobs. | |
89
+ | 2026-07-20 | extend-minor | `v2.14` | anchored-derived-version-material, build-controller-evidence, release-passport, package-subpaths, release-propagation-controller | additive | Anchored/manual consumers can declare derived version witnesses that Buildchain regenerates and verifies before heavy builds, binds to exact alpha/release trees and passports, and admits during protected promotion; propagation receipts now model their existing optional consumer stages. | |
90
+ | 2026-07-17 | extend-minor | `v2.14` | merge-queue-config, release-line-governance-inheritance | additive | Buildchain config can explicitly enable, inherit, or disable exact dev-channel merge queues, and release-line bootstrap reconciles the declared or inherited policy before moving the repository default branch. | |
91
+ | 2026-07-16 | open-minor | `v2.14` | dev-merge-queue-governance | additive | The public CLI adds a dry-run-first, idempotent merge-queue governance command that verifies required workflow event compatibility before applying an exact dev-channel ruleset and removing the strict up-to-date race. | |
92
+ | 2026-07-15 | open-minor | `v2.13` | artifact-verification-envelope, package-subpaths | additive | The public envelope seals exact artifact, provenance, identity, lifecycle, revocation, and existing KFD assessment roots into one consumer-ready KFX admission input, with a dedicated Node API export and fail-closed verifier. | |
93
+ | 2026-07-11 | open-minor | `v2.12` | channel-build-router, channel-selection-protocol | additive | The public `build.yml` reusable workflow lets consumers declare one build job while Buildchain selects generic major alpha for development/prerelease intent and stable major for production release intent, with explicit overrides, separate locks, and fail-closed ambiguity handling. | |
94
+ | 2026-07-08 | open-minor | `v2.9` | build-facts-contract | additive | Build Facts add a public CLI command family, Node API export, config protocol, module/product fact contracts, release-passport evidence section, and Kungfu legacy buildinfo projection from the same source facts. | |
95
+ | 2026-07-06 | open-minor | `v2.8` | kfd-1-contract-world-release-gate, kfd-2-release-trust-passport-audit, kfd-3-collaboration-interface-trust-proof, publish-source-lock-enforcement, required-check-protection | additive | KFD release gates add KFD-1 self contract verification, KFD-2 public release trust claim audit, KFD-3 collaboration-interface trust proofs, publish-side source-lock enforcement for promote-only wrappers, and protected channel required checks repaired to bind GitHub Actions check runs instead of legacy commit status contexts. | |
96
+ | 2026-07-04 | open-minor | `v2.5` | scheduled-integration-governance | additive | Scheduled integration governance adds scheduled feature-branch discovery, conflict-free integration, reporting, and agent-visible governance automation for dev-line maintenance. | |
97
+ | 2026-07-03 | open-minor | `v2.4` | infra-contract-lifecycle | additive | Infra contract lifecycle adds the provider-neutral `infra-contract` CLI command family, project type, adapter capability contract, lifecycle evidence bundle, propagation evidence, CI evidence mode, and consumer-facing contract artifacts. | |
98
+ | 2026-07-02 | open-minor | `v2.3` | web-surface-host-mapping | additive | Web surface host mapping adds first-class multi-host surface bindings, reusable workflow URL outputs, per-surface deployment overrides, and an agent-readable fixture contract. | |
99
+ | 2026-07-02 | open-minor | `v2.2` | release-passport, binary-distribution | additive | Release passport and binary distribution add agent-readable release passport files, artifact evidence, impact ledger, agent index, GitHub Release collection and verification commands, and standalone binary assets. | |
100
+ | 2026-07-02 | open-minor | `v2.1` | logging-sdk, cli-observability, package-subpaths | additive | Buildchain toolkit observability adds the public logging SDK, CLI observability commands, and package subpaths that consumers can import. | |
79
101
 
80
102
  ## Runner Policy
81
103
 
@@ -1,3 +1,21 @@
1
+ ---
2
+ status: draft
3
+ period: ongoing
4
+ theme: web-surface-deployments
5
+ doc_type: contract
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-07-30
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-07-30
16
+ invisible_context_boundary: No credentials, private logs, or unpublished deployment values are included.
17
+ ---
18
+
1
19
  # Web-Surface Deployment Contract
2
20
 
3
21
  Buildchain supports `project.type = "web-surface"` for repositories that publish
@@ -441,6 +459,68 @@ the owning and parent surface syncs carried their required delete exclusions.
441
459
  The runner must provide an AWS CLI version whose `s3 sync` supports
442
460
  `--no-overwrite`.
443
461
 
462
+ ### Qualified publication package-pin fast path
463
+
464
+ A consumer may narrow one deployment to the exact paper version introduced by
465
+ a package-pin-only PR. The artifact root `manifest.json` must carry a
466
+ consumer-owned qualification envelope:
467
+
468
+ ```json
469
+ {
470
+ "publicationFastPath": {
471
+ "contract": "kungfu-buildchain-publication-package-pin-fast-path",
472
+ "mode": "package-pin-only",
473
+ "targetSurface": "papers",
474
+ "qualificationRoot": "sha256:...",
475
+ "immutablePrefixes": [
476
+ "archive/observer-declared-timelines/v0.1.0-alpha.10"
477
+ ],
478
+ "mutableFiles": [
479
+ "archive/index.html",
480
+ "index.html",
481
+ "manifest.json",
482
+ "observer-declared-timelines/index.html",
483
+ "observer-declared-timelines/latest/index.html",
484
+ "registry.json"
485
+ ],
486
+ "invalidationPaths": [
487
+ "/",
488
+ "/archive/",
489
+ "/archive/observer-declared-timelines/v0.1.0-alpha.10*",
490
+ "/observer-declared-timelines/",
491
+ "/observer-declared-timelines/latest/",
492
+ "/manifest.json",
493
+ "/registry.json"
494
+ ]
495
+ }
496
+ }
497
+ ```
498
+
499
+ Buildchain validates that the target surface exists, every immutable prefix is
500
+ declared by that surface's archive manifest, every mutable file exists outside
501
+ those prefixes, and the qualification root is exact. A qualified plan:
502
+
503
+ - selects only `targetSurface`;
504
+ - verifies/uploads only the declared immutable prefixes with the normal
505
+ no-overwrite digest safeguards;
506
+ - copies only the declared mutable files;
507
+ - skips full `sync --delete` and directory-index alias writes;
508
+ - invalidates only the declared viewer paths plus the deployment manifest.
509
+
510
+ Any missing, malformed, or unqualified envelope keeps the normal full-surface
511
+ plan. The fast path narrows bytes; it does not weaken channel controls.
512
+ `package-published`, `alpha-complete`, `staging-visible`, and
513
+ `production-visible` remain separate facts, and a package qualification never
514
+ authorizes production by itself.
515
+
516
+ Publication manifests may retain release history without rematerializing every
517
+ historical package into the current site artifact. When at least one version
518
+ declares `immutableIndex`, Buildchain treats that field as the materialization
519
+ envelope: all declared version prefixes remain protected from deletion, while
520
+ only prefixes with `immutableIndex` must exist locally and are eligible for
521
+ upload. Manifests without the envelope retain the legacy rule that every
522
+ declared prefix must exist.
523
+
444
524
  For multi-surface sites, each surface host is treated as a root-relative view
445
525
  of that surface's artifact path prefix. For example, a `buildchain` surface with
446
526
  `path = "/buildchain/"` and preview URL
@@ -680,8 +760,9 @@ The reusable workflow maps GitHub events to Buildchain web-surface semantics:
680
760
  | --- | --- |
681
761
  | `pull_request` opened / synchronized / reopened | validate, build, verify, and plan `preview` for `pr-N` |
682
762
  | `pull_request` closed | plan apply-mode cleanup for the `pr-N` preview alias and manifest |
763
+ | `pull_request` closed for a matching release PR | verify the release intent and exact workflow-shell runtime, then wait for the protected `main` push; do not plan or apply production from `refs/pull/*/merge` |
683
764
  | `push` to `main` | validate, build, verify, plan and apply `staging` from the merged `main` SHA, then optionally open a production release PR |
684
- | `push` to `main` from a matching release PR merge | validate the associated release PR, plan `production`, and enter the configured GitHub Environment gate |
765
+ | `push` to `main` from a matching release PR merge | validate the associated release PR, plan `production`, and enter the configured GitHub Environment gate from the protected mainline ref |
685
766
  | `workflow_dispatch` with `production-approved = true` | plan `production` and enter the configured GitHub Environment gate |
686
767
 
687
768
  The optional `buildchain-ref` input is empty by default. Empty keeps the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "3.0.2",
3
+ "version": "3.0.3-alpha.1",
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",
@@ -41,6 +41,9 @@
41
41
  "./portable-dev-cache": "./packages/core/portable-dev-cache.js",
42
42
  "./publication-artifact": "./packages/core/publication-artifact.js",
43
43
  "./publication-package": "./packages/core/publication-package.js",
44
+ "./publication-reproducibility": "./packages/core/publication-reproducibility.js",
45
+ "./publication-sealed-bundle": "./packages/core/publication-sealed-bundle.js",
46
+ "./paper": "./packages/core/paper.js",
44
47
  "./publication-authority": "./packages/core/publication-authority.js",
45
48
  "./publication-control-plane-audit": "./packages/core/publication-control-plane-audit.js",
46
49
  "./buildchain-publication-authority": "./packages/core/buildchain-publication-authority.js",
@@ -105,7 +108,8 @@
105
108
  },
106
109
  "packageManager": "pnpm@11.7.0",
107
110
  "scripts": {
108
- "check": "node scripts/check-internal-architecture.mjs && node scripts/check-inventory.mjs && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && node scripts/check-action-bundles.mjs",
111
+ "check": "pnpm run check:static && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/check-inventory.mjs && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && node scripts/check-action-bundles.mjs",
112
+ "check:static": "node scripts/check-javascript-syntax.mjs && prettier --check architecture/*.json bin/internal/command-registry.mjs scripts/authorize-promotion-runtime-override.cjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs scripts/maintainability-metrics.mjs tests/authorize-promotion-runtime-override.test.mjs tests/command-registry.test.mjs tests/maintainability.test.mjs tests/promotion-responsibilities.test.mjs",
109
113
  "check:workflows": "bash scripts/check-workflows.sh",
110
114
  "generate:site": "node scripts/generate-site-bundle.mjs",
111
115
  "check:site": "node scripts/generate-site-bundle.mjs --check",
@@ -116,11 +120,9 @@
116
120
  "pack:check": "npm pack --dry-run --json --registry=https://registry.npmjs.org/"
117
121
  },
118
122
  "devDependencies": {
119
- "@types/node": "^24.0.0",
120
123
  "prettier": "^3.9.0",
121
124
  "tsup": "^8.5.0",
122
- "typescript": "^5.9.0",
123
- "vitest": "^4.1.9"
125
+ "typescript": "^5.9.0"
124
126
  },
125
127
  "dependencies": {
126
128
  "@kungfu-tech/kfd": "1.0.0-alpha.47",
@@ -24,6 +24,12 @@ Current shared surfaces:
24
24
  through `@kungfu-tech/buildchain/badges`.
25
25
  - publication artifact manifests, source bundles, and publication artifact
26
26
  passports through `@kungfu-tech/buildchain/publication-artifact`.
27
+ - two-clean-build byte reproducibility receipts through
28
+ `@kungfu-tech/buildchain/publication-reproducibility`.
29
+ - build-once publication bundle manifests and exact-byte verification through
30
+ `@kungfu-tech/buildchain/publication-sealed-bundle`.
31
+ - governed paper scaffold, preflight, status, npm bootstrap, build, Alpha, and
32
+ resume plans through `@kungfu-tech/buildchain/paper`.
27
33
 
28
34
  ## Toolkit Imports
29
35
 
@@ -56,15 +62,20 @@ import {
56
62
  CommonJS scripts can use dynamic imports for the same package surfaces:
57
63
 
58
64
  ```js
59
- const { createBuildchainLogger } = await import("@kungfu-tech/buildchain/logging");
60
- const { collectRunnerDiagnostics } = await import("@kungfu-tech/buildchain/diagnostics");
65
+ const { createBuildchainLogger } =
66
+ await import("@kungfu-tech/buildchain/logging");
67
+ const { collectRunnerDiagnostics } =
68
+ await import("@kungfu-tech/buildchain/diagnostics");
61
69
  ```
62
70
 
63
71
  Build facts consumers can collect source-bound module/product facts before
64
72
  publishing and pass those facts into the release passport:
65
73
 
66
74
  ```js
67
- import { collectModuleBuildFacts, writeBuildFacts } from "@kungfu-tech/buildchain/build-facts";
75
+ import {
76
+ collectModuleBuildFacts,
77
+ writeBuildFacts,
78
+ } from "@kungfu-tech/buildchain/build-facts";
68
79
 
69
80
  const fact = collectModuleBuildFacts({ moduleId: "native-core" });
70
81
  writeBuildFacts({ fact, output: ".buildchain/facts/native-core.json" });
@@ -94,6 +105,48 @@ import { writePublicationArtifact } from "@kungfu-tech/buildchain/publication-ar
94
105
  writePublicationArtifact({ sourceSha: process.env.GITHUB_SHA });
95
106
  ```
96
107
 
108
+ Before publication admission, prove the exact PDF, source bundle, manifests,
109
+ and npm tarball twice from the same Git commit:
110
+
111
+ ```js
112
+ import { verifyPublicationReproducibility } from "@kungfu-tech/buildchain/publication-reproducibility";
113
+
114
+ const receipt = verifyPublicationReproducibility({
115
+ sourceSha: process.env.GITHUB_SHA,
116
+ promote: true,
117
+ });
118
+ if (!receipt.qualifying) throw new Error("publication is not reproducible");
119
+ ```
120
+
121
+ Bind the promoted bytes into the durable build-once publication envelope:
122
+
123
+ ```js
124
+ import {
125
+ createPublicationSealedBundle,
126
+ verifyPublicationSealedBundle,
127
+ } from "@kungfu-tech/buildchain/publication-sealed-bundle";
128
+ ```
129
+
130
+ The sealed manifest names the exact npm tarball and release assets. Promotion
131
+ persists those binary files before registry publication and verifies them again
132
+ when a fresh runner resumes.
133
+
134
+ Paper automation can use the same typed contracts as the CLI:
135
+
136
+ ```js
137
+ import {
138
+ collectPaperPreflight,
139
+ collectPaperStatus,
140
+ planPaperMigration,
141
+ planPaperScaffold,
142
+ writePaperMigration,
143
+ } from "@kungfu-tech/buildchain/paper";
144
+ ```
145
+
146
+ Planning and observation are side-effect free. `writePaperScaffold()` and
147
+ `writePaperMigration()` perform the bounded local writes, while external
148
+ mutations remain explicit CLI operations guarded by `--execute`.
149
+
97
150
  Web-surface validation stays in core because both local scripts and GitHub
98
151
  Actions need the same fail-closed interpretation of project, channel, deploy,
99
152
  retention, and staging security declarations.
@@ -102,7 +155,10 @@ README badge consumers should import the public badge subpath and treat
102
155
  Markdown as a projection of the returned facts:
103
156
 
104
157
  ```js
105
- import { collectBadgeBundleFacts, renderBadgeBundleBlock } from "@kungfu-tech/buildchain/badges";
158
+ import {
159
+ collectBadgeBundleFacts,
160
+ renderBadgeBundleBlock,
161
+ } from "@kungfu-tech/buildchain/badges";
106
162
 
107
163
  const facts = await collectBadgeBundleFacts({ cwd: process.cwd() });
108
164
  const markdown = renderBadgeBundleBlock(facts);
@@ -25,6 +25,7 @@ const PROFILE_REGISTRY = Object.freeze({
25
25
  "plugin-bundle",
26
26
  "xpc-bundle",
27
27
  "dylib",
28
+ "archive",
28
29
  "pkg",
29
30
  "dmg",
30
31
  ],
@@ -69,7 +69,7 @@ function surface(root, value) {
69
69
 
70
70
  function majorLineFromPackageVersion(version = "") {
71
71
  const match = String(version || "").match(/^(\d+)\./);
72
- return match ? `v${match[1]}` : "v2";
72
+ return match ? `v${match[1]}` : "v3";
73
73
  }
74
74
 
75
75
  export function createBuildchainContractWorld({
@@ -113,7 +113,7 @@ export function createBuildchainContractWorld({
113
113
  "release-candidate-artifact",
114
114
  ],
115
115
  breakingDefaults: {
116
- buildchainRefDefault: "workflow-shell-ref-or-v2",
116
+ buildchainRefDefault: "workflow-shell-ref-or-v3",
117
117
  promoteOnlyHeavyBuildPolicy: "pr-stage-only",
118
118
  },
119
119
  optionalInputs: [
@@ -198,6 +198,8 @@ export function createBuildchainContractWorld({
198
198
  "release-passport-kfd-3-artifact-verify-command",
199
199
  "release-passport-invariant-passport-jsons",
200
200
  "release-passport-invariant-passport-command",
201
+ "release-passport-evidence-jsons",
202
+ "release-passport-attachment-command",
201
203
  "github-artifact-attestation-policy-json",
202
204
  "github-artifact-attestation-environment",
203
205
  "github-artifact-attestation-retention-days",
@@ -280,7 +282,7 @@ export function createBuildchainContractWorld({
280
282
  "web-surface-manifest-json",
281
283
  ],
282
284
  breakingDefaults: {
283
- buildchainRefDefault: "workflow-shell-ref-or-v2",
285
+ buildchainRefDefault: "workflow-shell-ref-or-v3",
284
286
  contractCompatibilityPolicy: "major-compatible",
285
287
  breakingDriftPolicy: "fail-closed-before-build",
286
288
  },
@@ -382,6 +384,8 @@ export function createBuildchainContractWorld({
382
384
  "release-passport-kfd-3-artifact-verify-command",
383
385
  "release-passport-invariant-passport-jsons",
384
386
  "release-passport-invariant-passport-command",
387
+ "release-passport-evidence-jsons",
388
+ "release-passport-attachment-command",
385
389
  "release-passport-github-artifact-attestation-policy-jsons",
386
390
  "github-release",
387
391
  "github-release-title",
@@ -692,6 +696,7 @@ export function createBuildchainContractWorld({
692
696
  ? {
693
697
  compatibleBreakingDigests: [
694
698
  "sha256:e264a79f9f399038c2fcfd21e4168c68c2e1485ee5c651c02242a02b622ac2be",
699
+ "sha256:30745921541e9b0f70475bb2178c2559f6aef248f6680670ccd44d8c5a69a6b1",
695
700
  ],
696
701
  }
697
702
  : {}),
@@ -745,7 +750,7 @@ export function finalizeBuildchainContractWorld(contractWorld) {
745
750
  }
746
751
 
747
752
  export function createBuildchainContractLock({
748
- buildchainRef = "v2",
753
+ buildchainRef = "v3",
749
754
  resolvedSha = "",
750
755
  contractWorld,
751
756
  compatibilityPolicy = DEFAULT_POLICY,
@@ -88,6 +88,7 @@ function normalizeBindings(bindings = {}) {
88
88
  "policyRoot",
89
89
  "platformRoot",
90
90
  "cacheProfileRoot",
91
+ "compilerCachePreparationRoot",
91
92
  ]),
92
93
  "bindings",
93
94
  );
@@ -25,6 +25,7 @@ const CONTROLLER_SPECS = [
25
25
  capabilities: [
26
26
  "source-lock",
27
27
  "lifecycle-build",
28
+ "artifact-signing-finalization",
28
29
  "credential-island",
29
30
  "lifecycle-verify",
30
31
  "artifact-admission",
@@ -34,6 +35,7 @@ const CONTROLLER_SPECS = [
34
35
  "resolve-source",
35
36
  "anchored-release-preflight",
36
37
  "build",
38
+ "signing-finalization",
37
39
  "credential-island",
38
40
  "verify",
39
41
  "aggregate",