@kungfu-tech/buildchain 4.0.2-alpha.9 → 4.0.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 (157) hide show
  1. package/AGENTS.md +10 -1
  2. package/CONTRIBUTING.md +24 -0
  3. package/README.md +2 -2
  4. package/actions/promote-buildchain-ref/README.md +1 -1
  5. package/actions/v4-release-candidate-promote/README.md +28 -0
  6. package/architecture/agent-change-map.md +64 -7
  7. package/architecture/ci-lane-change-budget.json +366 -0
  8. package/architecture/internal-capabilities.json +53 -8
  9. package/architecture/maintainability-debt.json +147 -93
  10. package/architecture/maintainability-policy.json +32 -28
  11. package/architecture/release-tail-contract-inventory.json +6 -6
  12. package/architecture/v4-architecture-constitution.md +23 -20
  13. package/architecture/v4-cross-platform-adopter-qualification.json +1 -1
  14. package/architecture/v4-delivery-authority-parity.json +2 -2
  15. package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.json +1 -1
  16. package/architecture/v4-floating-consumer-policy.json +2 -2
  17. package/architecture/v4-next-development-parity.json +5 -5
  18. package/architecture/v4-partial-mutation-recovery-qualification.json +4 -1
  19. package/architecture/v4-platform-stage-checkpoints.json +1 -1
  20. package/architecture/v4-provider-operation-journal-contract.json +5 -2
  21. package/architecture/v4-publication-facade-patches.json +64 -0
  22. package/architecture/v4-release-activation-shadow-domain.json +5 -2
  23. package/architecture/v4-release-topology.json +74 -39
  24. package/architecture/v4-rust-wasm-production-authority.json +58 -0
  25. package/architecture/v4-stable-publication-fence.json +5 -2
  26. package/architecture/v4-stage-capsule-qualification.json +2 -2
  27. package/architecture/v4-tail-reseal-parity.json +8 -6
  28. package/architecture/v4-universal-workflow-bootstrap.json +171 -0
  29. package/architecture/v4-universal-workflow-fault-campaign.json +72 -0
  30. package/architecture/v4-universal-workflow-train-admission.json +40 -0
  31. package/architecture/workflow-taxonomy.json +1451 -0
  32. package/bin/buildchain.mjs +7 -7
  33. package/contracts/buildchain-v2-residuals-v1.json +57 -48
  34. package/contracts/dev-delivery-authority-v2.schema.json +16 -2
  35. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  36. package/contracts/v4-canonical-contracts-v1.schema.json +1 -0
  37. package/dist/site/buildchain-contract.json +93 -48
  38. package/dist/site/buildchain-site.json +222 -69
  39. package/dist/site/capability-registry.json +4 -4
  40. package/dist/site/controller-registry.json +50 -13
  41. package/dist/site/kfd-claims.json +2585 -1000
  42. package/dist/site/kfd-upstream-aggregate.json +1 -1
  43. package/dist/site/manual-registry.json +13 -13
  44. package/dist/site/node-api-registry.json +120 -115
  45. package/dist/site/page-registry.json +204 -51
  46. package/dist/site/public-surface-audit.json +3205 -1219
  47. package/dist/site/publication-authority-registry.json +1124 -362
  48. package/dist/site/publication-registry.json +4 -4
  49. package/dist/site/schemas/dev-delivery-authority-v2.schema.json +16 -2
  50. package/dist/site/site-manifest.json +17 -17
  51. package/dist/site/workflow-registry.json +5061 -1659
  52. package/docs/MAP.md +1 -0
  53. package/docs/auditable-demo.md +1 -1
  54. package/docs/cli.md +21 -8
  55. package/docs/dev-delivery-warrant.md +1 -1
  56. package/docs/engineering-housekeeper.md +3 -3
  57. package/docs/kfd-support.md +26 -2
  58. package/docs/next-development-transition.md +2 -2
  59. package/docs/node-api-reference.md +190 -190
  60. package/docs/publication-authority.md +2 -2
  61. package/docs/release-candidate.md +3 -3
  62. package/docs/release-flow.md +67 -19
  63. package/docs/release-governance.md +8 -8
  64. package/docs/release-passport.md +27 -2
  65. package/docs/reusable-build-surface.md +16 -0
  66. package/docs/v4-adopter-delivery.md +2 -2
  67. package/docs/v4-production-release.md +71 -8
  68. package/docs/v4-rust-wasm-production-authority.md +58 -0
  69. package/docs/v4-stage-capsule.md +2 -2
  70. package/docs/v4-tail-reseal.md +1 -1
  71. package/docs/workflow-catalog.md +154 -0
  72. package/docs/workflow-path-migration.md +109 -0
  73. package/package.json +10 -6
  74. package/packages/core/artifact-verification-envelope.js +5 -5
  75. package/packages/core/buildchain-contract.js +1 -1
  76. package/packages/core/buildchain-kfd-claims.js +2 -2
  77. package/packages/core/buildchain-publication-authority.js +42 -26
  78. package/packages/core/buildchain-v4-domain.wasm +0 -0
  79. package/packages/core/ci-lane-change-budget.js +14 -1
  80. package/packages/core/controller-evidence.js +4 -1
  81. package/packages/core/dev-delivery-candidate-identity.js +40 -6
  82. package/packages/core/dev-delivery-warrant-state.js +3 -4
  83. package/packages/core/dev-delivery-warrant.js +12 -2
  84. package/packages/core/github-governance-authority.js +4 -4
  85. package/packages/core/kfd-adopter-manifest.js +46 -47
  86. package/packages/core/next-development-projection.js +2 -2
  87. package/packages/core/paper-agent-entry.js +30 -4
  88. package/packages/core/paper-fleet.js +1 -1
  89. package/packages/core/paper-runtime-channels.js +348 -0
  90. package/packages/core/paper-scaffold-content.js +10 -0
  91. package/packages/core/paper.js +37 -71
  92. package/packages/core/release-line-dry-run.js +1 -1
  93. package/packages/core/release-passport-contract.js +5 -5
  94. package/packages/core/release-passport.js +5 -4
  95. package/packages/core/release-tail-provider-plane.js +68 -1048
  96. package/packages/core/v4-canonical-contracts.js +10 -75
  97. package/packages/core/v4-domain-wasm-artifact.js +7 -0
  98. package/packages/core/v4-domain-wasm.js +216 -0
  99. package/packages/core/v4-floating-consumer-evidence.js +1 -1
  100. package/packages/core/v4-floating-consumer-policy.js +1 -1
  101. package/packages/core/v4-partial-mutation-recovery-qualification.js +9 -386
  102. package/packages/core/v4-product-publication.js +19 -349
  103. package/packages/core/v4-protected-publication-source.js +19 -21
  104. package/packages/core/v4-provider-operation-journal.js +18 -487
  105. package/packages/core/v4-provider-readback-idempotency.js +12 -97
  106. package/packages/core/v4-release-activation-shadow.js +13 -500
  107. package/packages/core/v4-release-invocation.js +28 -389
  108. package/packages/core/v4-stable-publication-fence.js +13 -342
  109. package/packages/core/v4-universal-workflow-bootstrap.js +586 -0
  110. package/scripts/binary-publication-evidence.mjs +135 -0
  111. package/scripts/build-contract-core.mjs +1 -14
  112. package/scripts/build-v4-domain-wasm.mjs +189 -0
  113. package/scripts/check-action-bundles.mjs +12 -2
  114. package/scripts/check-ci-lane-change-budget.mjs +4 -1
  115. package/scripts/check-core-mechanism-inventory.mjs +4 -3
  116. package/scripts/check-inventory.mjs +35 -44
  117. package/scripts/check-maintainability.mjs +16 -113
  118. package/scripts/check-v4-floating-consumer-policy-contract.mjs +2 -2
  119. package/scripts/check-v4-public-dogfood-contract.mjs +22 -9
  120. package/scripts/check-v4-release-topology.mjs +90 -33
  121. package/scripts/check-v4-runtime-semantic-closure.mjs +4 -1
  122. package/scripts/check-v4-universal-workflow-bootstrap.mjs +266 -0
  123. package/scripts/check-workflow-taxonomy.mjs +6 -0
  124. package/scripts/copy-v4-domain-wasm.mjs +14 -0
  125. package/scripts/dev-delivery-authority-command-adapters.mjs +1 -1
  126. package/scripts/dev-delivery-authority.mjs +8 -8
  127. package/scripts/dev-delivery-source-proof-reuse.mjs +2 -1
  128. package/scripts/dev-delivery-warrant-options.mjs +14 -9
  129. package/scripts/dev-delivery-warrant-store.mjs +73 -7
  130. package/scripts/dev-delivery-warrant-transition.mjs +109 -0
  131. package/scripts/dev-delivery-warrant.mjs +76 -99
  132. package/scripts/dev-pr-auto-merge.mjs +15 -15
  133. package/scripts/generate-channel-build-workflow.mjs +7 -2
  134. package/scripts/generate-channel-promotion-workflow.mjs +7 -5
  135. package/scripts/generate-site-bundle.mjs +11 -11
  136. package/scripts/generate-v4-universal-workflow-facades.mjs +458 -0
  137. package/scripts/generate-workflow-taxonomy.mjs +25 -0
  138. package/scripts/github-output.mjs +31 -0
  139. package/scripts/maintainability-metrics.mjs +16 -5
  140. package/scripts/maintainability-public-surface.mjs +115 -0
  141. package/scripts/next-development-review.mjs +307 -0
  142. package/scripts/paper-work-fleet-cli.mjs +2 -0
  143. package/scripts/release-asset-client.mjs +91 -0
  144. package/scripts/release-candidate-resolver.mjs +9 -9
  145. package/scripts/source-verification-evidence.mjs +344 -0
  146. package/scripts/stable-candidate-qualification.mjs +1 -1
  147. package/scripts/universal-facade-maintainability.mjs +82 -0
  148. package/scripts/v4-product-publication-intent.mjs +13 -6
  149. package/scripts/v4-publication-settlement.mjs +211 -0
  150. package/scripts/v4-universal-workflow-backflow.mjs +212 -0
  151. package/scripts/v4-universal-workflow-engine.mjs +618 -0
  152. package/scripts/v4-universal-workflow-self-dogfood.mjs +205 -0
  153. package/scripts/verify-version-state-delta.mjs +173 -0
  154. package/scripts/workflow-taxonomy.mjs +507 -0
  155. package/templates/native-dev-delivery.yml +4 -7
  156. package/templates/universal-buildchain-bootstrap-recovery.yml +282 -0
  157. package/templates/universal-buildchain-bootstrap.yml +28 -0
@@ -227,7 +227,7 @@ buildchain audit publication-control-plane \
227
227
  --source-sha <exact-merged-branch-sha> \
228
228
  --workflow .github/workflows/release-candidate-promote.yml \
229
229
  --workflow-ref <exact-buildchain-sha> \
230
- --publisher-workflow .github/workflows/buildchain-ref-promotion.yml \
230
+ --publisher-workflow .github/workflows/self-release-promote.yml \
231
231
  --job promote \
232
232
  --environment none
233
233
 
@@ -236,7 +236,7 @@ buildchain audit publication-control-plane \
236
236
  --repository kungfu-systems/buildchain \
237
237
  --branch dev/v3/v3.0 \
238
238
  --workflow .github/workflows/release-candidate-promote.yml \
239
- --publisher-workflow .github/workflows/buildchain-ref-promotion.yml \
239
+ --publisher-workflow .github/workflows/self-release-promote.yml \
240
240
  --job promote \
241
241
  --environment none \
242
242
  --npm-trust-json sanitized-npm-trust.json
@@ -265,7 +265,7 @@ in the release passport.
265
265
 
266
266
  Standalone binary publication is a separate consumer capability. The promotion
267
267
  wrapper does not assume that an npm-only repository provides
268
- `.github/workflows/binary-distribution.yml`. Repositories that own that workflow
268
+ `.github/workflows/self-build-binary-distribution.yml`. Repositories that own that workflow
269
269
  opt in with `standalone-binary-distribution: true`; Buildchain's self-promotion
270
270
  does so explicitly. Once enabled, a missing or invalid binary workflow remains a
271
271
  hard failure rather than being silently skipped.
@@ -303,7 +303,7 @@ short-lived admission JSON in repository-specific workflow code:
303
303
  ```yaml
304
304
  publication-auto-admission: true
305
305
  publication-auto-no-gate: true
306
- publication-publisher-workflow-path: .github/workflows/buildchain-ref-promotion.yml
306
+ publication-publisher-workflow-path: .github/workflows/self-release-promote.yml
307
307
  publication-product: Example Product
308
308
  publication-target: npm:@example/product
309
309
  publication-package-name: "@example/product"
@@ -339,7 +339,7 @@ an npm package identity:
339
339
  ```yaml
340
340
  publication-auto-admission: true
341
341
  publication-auto-no-gate: true
342
- publication-publisher-workflow-path: .github/workflows/buildchain-ref-promotion.yml
342
+ publication-publisher-workflow-path: .github/workflows/self-release-promote.yml
343
343
  publication-product: Example Binary
344
344
  publication-target: github-release:example/example-binary
345
345
  publication-package-name: ""
@@ -8,17 +8,17 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-07-31
11
+ last_reviewed: 2026-09-05
12
12
  ai_provenance:
13
- model_family: GPT-5
13
+ model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-07-31
15
+ generated_at: 2026-09-05
16
16
  invisible_context: not asserted
17
17
  ---
18
18
 
19
19
  # Release Flow Diagrams
20
20
 
21
- This document describes the Buildchain v4 branch, tag, and version-state flow.
21
+ This document describes v4 alpha publication and the legacy v3 release flow.
22
22
  See [Release governance](release-governance.md) for the design rationale.
23
23
 
24
24
  ## Architecture
@@ -142,7 +142,21 @@ published. Queue reconciliation runs after branch protection and before the
142
142
  default-branch switch, so a failed governance apply leaves the old active line
143
143
  in place and the idempotently created new refs can be retried.
144
144
 
145
- ## Alpha Promotion
145
+ ## V4 Alpha Publication
146
+
147
+ The protected `dev/v4/v4.0 -> alpha/v4/v4.0` channel PR admits the source.
148
+ Publication creates the immutable `v4.0.Z-alpha.N` tag and advances the eligible
149
+ floating alpha refs to that published source. Its completed receipt and original
150
+ Release Passport remain the publication authority.
151
+
152
+ A separate protected next-development PR prepares `4.0.Z-alpha.(N+1)` on
153
+ `dev/v4/v4.0`. Preparing that version does not publish another exact tag or move
154
+ the alpha refs. A review, queue, or transient API failure in that PR leaves
155
+ publication complete and next-development incomplete; recovery resumes the
156
+ missing tail. Binary distribution has its own evidence and completion state.
157
+ See [What each verification proves](#what-each-verification-proves).
158
+
159
+ ## Legacy V3 Alpha Promotion
146
160
 
147
161
  ```mermaid
148
162
  sequenceDiagram
@@ -180,7 +194,7 @@ dev/vX/vX.Y
180
194
 
181
195
  all point at the generated alpha version-state commit.
182
196
 
183
- ## Release Promotion
197
+ ## Legacy V3 Release Promotion
184
198
 
185
199
  ```mermaid
186
200
  sequenceDiagram
@@ -234,7 +248,7 @@ dev/vX/vX.Y
234
248
 
235
249
  point at the next alpha version-state commit.
236
250
 
237
- ## State Machine
251
+ ## Legacy V3 State Machine
238
252
 
239
253
  ```mermaid
240
254
  stateDiagram-v2
@@ -249,28 +263,28 @@ stateDiagram-v2
249
263
 
250
264
  The same minor line can loop through this state machine many times.
251
265
 
252
- ## Version Examples
266
+ ## Legacy V3 Version Examples
253
267
 
254
- Assume `v4.0.2-alpha.1` has been tested and a maintainer merges
255
- `alpha/v4/v4.0 -> release/v4/v4.0`.
268
+ Assume `v3.0.2-alpha.1` has been tested and a maintainer merges
269
+ `alpha/v3/v3.0 -> release/v3/v3.0`.
256
270
 
257
271
  Buildchain should produce:
258
272
 
259
273
  ```text
260
- v4.0.2 exact production tag
261
- v4.0 floating minor tag
262
- v4 floating major tag when v4.0 is the selected major line
263
- release/v4/v4.0 production channel branch
274
+ v3.0.2 exact production tag
275
+ v3.0 floating minor tag
276
+ v3 floating major tag when v3.0 is the selected major line
277
+ release/v3/v3.0 production channel branch
264
278
  ```
265
279
 
266
280
  It should also prepare:
267
281
 
268
282
  ```text
269
- v4.0.3-alpha.0 exact next alpha tag
270
- v4.0-alpha floating alpha tag
271
- v4-alpha floating major alpha tag when v4.0 is the highest published alpha minor
272
- alpha/v4/v4.0 alpha channel branch
273
- dev/v4/v4.0 development channel branch
283
+ v3.0.3-alpha.0 exact next alpha tag
284
+ v3.0-alpha floating alpha tag
285
+ v3-alpha floating major alpha tag when v3.0 is the highest published alpha minor
286
+ alpha/v3/v3.0 alpha channel branch
287
+ dev/v3/v3.0 development channel branch
274
288
  ```
275
289
 
276
290
  This is expected behavior. A production release closes one patch and opens the
@@ -333,3 +347,37 @@ the current target ref contains or corresponds to the recorded
333
347
  `release_material_sha`. It must then tolerate exact tags, dev refs, or alpha
334
348
  refs that have already moved and continue filling any missing floating tags
335
349
  before writing the transaction state as `complete`.
350
+
351
+ ## What each verification proves
352
+
353
+ | Evidence | Meaning and reuse boundary |
354
+ | --- | --- |
355
+ | Full source execution | `pnpm run check` runs source tests, Rust gates, policy checks and generated artifact checks. Each Node test file runs once; the focused `check:v4-contracts` command still includes its 22 contract test files. |
356
+ | Merge queue proof | A successful full merge-group run seals its exact source SHA/tree, workflow, check definition, WASM runtime, toolchain versions, dependency locks, hosted image and platform. The proof expires after six hours and is verified against the completed GitHub run attempt and artifact archive digest. |
357
+ | Push reuse | A Dev push may reuse that exact full execution. Its summary links the original run and proof; it does not claim to have rerun tests. Missing, failed, expired, ambiguous, tampered or unavailable evidence executes the full check. |
358
+ | Version-state projection | Requires an authenticated full-source proof for the exact base and an ancestor-bound delta containing only declared version files and derived material. The base generator reconstructs every tracked byte, including derived digests. Any source, workflow, lock, configuration, file-mode or unexplained output change executes the full check. Projection results cannot issue a new full-source proof. |
359
+ | Generated version-state check | `Version-state projection / <context>` describes generated material. It never uses a protected full-source check's name on v4. Required PR lineage, review and merge queue gates remain independent. |
360
+ | Candidate qualification | Validates the sealed candidate, admitted runtime, source lock and publication authority. Source test reuse grants no provider mutation authority. |
361
+ | Provider readback and settlement | Verifies actual tags, npm integrity, release assets and native receipt roots. Publication, next-development and binary distribution are reported separately. |
362
+
363
+ The protected `check` context keeps its stable name while step names and summaries
364
+ identify full execution, exact proof reuse, or generated projection. The two
365
+ consumer-policy checks execute inside the root check, without duplicate Verify
366
+ pre-steps. The root check uses the Rust-only contract command before its complete
367
+ Node suite, removing 22 repeated test-file executions without removing tests.
368
+
369
+ The public v4 consumer remains a thin floating-channel caller with both locks.
370
+ Linux, macOS and Windows each execute the declared lifecycle, clean-process
371
+ restore and runtime/source binding. Their platform and called-runtime identities
372
+ differ from the source Verify lane, so a Linux source proof cannot replace them.
373
+ The Stage Capsule checkpoint matrix also retains all three platforms. Shared
374
+ platform-independent logic lives in the root check and public runtime; there is
375
+ no Buildchain-only dogfood exception or persisted candidate runtime selector.
376
+
377
+ A local Linux sample on 2026-09-05 measured the original full check at
378
+ `a41c00a0c0b2dbd57c238cd9b326b167a1d27ca8` at 148.772 seconds and the updated check
379
+ at 126.731 seconds, both exit 0. The original plan executed 226 Node test files
380
+ plus 22 duplicate selections; the updated plan executes all 231 files once,
381
+ including the new negative and recovery tests (2,047 tests). These are individual
382
+ local measurements with existing tool caches; hosted queue/push reuse is proved
383
+ separately by the exact run attempt and evidence roots in each job summary.
@@ -77,8 +77,8 @@ line.
77
77
 
78
78
  Buildchain implements the same governance loop with:
79
79
 
80
- - `.github/workflows/release-verify.yml` for PR verification;
81
- - `.github/workflows/buildchain-ref-promotion.yml` for post-verify ref
80
+ - `.github/workflows/self-build-release-verify-compat.yml` for PR verification;
81
+ - `.github/workflows/self-release-promote.yml` for post-verify ref
82
82
  promotion; this workflow dogfoods the declarative
83
83
  `release-candidate-promote.yml` wrapper and does not hand-wire resolver,
84
84
  artifact download, publish-gate, or promote action steps;
@@ -246,7 +246,7 @@ while exact tags and SHAs remain the reproducible audit choice.
246
246
  ### Buildchain Alpha Self-Dogfood
247
247
 
248
248
  Buildchain continuously consumes its own current major alpha through
249
- `.github/workflows/buildchain-alpha-self-dogfood.yml`. Both lanes call the
249
+ `.github/workflows/self-build-alpha-dogfood.yml`. Both lanes call the
250
250
  released channel router at `build.yml@v3-alpha`. The auto lane must resolve
251
251
  `v3-alpha`; the explicit stable lane must resolve `v3`. Both execute the same
252
252
  declared install, build, and verify fixture, proving that a single consumer
@@ -295,7 +295,7 @@ resolution and evidence comparison.
295
295
 
296
296
  This is a post-publication consumer canary, not a release bootstrap. Source
297
297
  verification still runs the current commit, and
298
- `buildchain-ref-promotion.yml` still passes the verified exact SHA into the
298
+ `self-release-promote.yml` still passes the verified exact SHA into the
299
299
  promotion workflow. Patrol, dev-merge, repair, and promotion defaults remain on
300
300
  stable or exact refs so a broken alpha cannot prevent Buildchain from publishing
301
301
  its fix. When Buildchain opens a new major, inventory validation requires this
@@ -526,7 +526,7 @@ The repository policy can be declared once instead of repeated as CLI flags:
526
526
  ```toml
527
527
  [governance.dev.merge_queue]
528
528
  mode = "inherit"
529
- required_workflows = [".github/workflows/verify.yml"]
529
+ required_workflows = [".github/workflows/self-build-verify.yml"]
530
530
  ```
531
531
 
532
532
  `enabled` explicitly requires Buildchain to create or update an exact-branch
@@ -632,7 +632,7 @@ binds the caller commit/tree and both workflow digests.
632
632
  ```sh
633
633
  node .buildchain/workflow-contract-runtime/scripts/workflow-call-contract.mjs check \
634
634
  --caller-root . \
635
- --caller-workflow .github/workflows/release-new-version.yml \
635
+ --caller-workflow .github/workflows/self-release-new-version-compat.yml \
636
636
  --caller-repository kungfu-systems/example \
637
637
  --job promote \
638
638
  --callee-root .buildchain/workflow-contract-runtime \
@@ -1009,8 +1009,8 @@ v3.0.1-alpha.0
1009
1009
  When debugging or extending release behavior, read in this order:
1010
1010
 
1011
1011
  1. `docs/release-flow.md`
1012
- 2. `.github/workflows/release-verify.yml`
1013
- 3. `.github/workflows/buildchain-ref-promotion.yml`
1012
+ 2. `.github/workflows/self-build-release-verify-compat.yml`
1013
+ 3. `.github/workflows/self-release-promote.yml`
1014
1014
  4. `.github/workflows/release-candidate-promote.yml`
1015
1015
  5. `.github/workflows/.release-candidate-promote.yml`
1016
1016
  6. `actions/promote-buildchain-ref/README.md`
@@ -1,3 +1,22 @@
1
+ ---
2
+ status: active
3
+ period: ongoing
4
+ theme: generic-kfd-adopter-binding
5
+ doc_type: reference
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: B
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-09-06
12
+ ai_provenance:
13
+ model_family: GPT-6
14
+ product: Codex
15
+ generated_at: 2026-09-06
16
+ visible_context: Buildchain v3 implementation and v4 source and regression tests.
17
+ invisible_context_boundary: No credentials or private runtime evidence inspected.
18
+ ---
19
+
1
20
  # Release Passport
2
21
 
3
22
  Buildchain Release Passport is the core product mechanism: a mature product
@@ -403,8 +422,14 @@ Pass the standard full-cut declaration with `--kfd-adopter-manifest-json`
403
422
  together with three `--kfd-product-gate-json` arguments for KFD-4, KFD-5, and
404
423
  KFD-7. The collector invokes the verifier from the exact installed
405
424
  `@kungfu-tech/kfd` package, binds the package artifact, registry and verifier
406
- roots, the exact Buildchain source, the manifest/report/bundle witness roots,
407
- and the existing product-gate roots. It emits `kfd-adopter-manifest.json`,
425
+ roots, the collector's exact product repository and source, the
426
+ manifest/report/bundle witness roots, and the existing product-gate roots. A
427
+ non-Buildchain adopter is accepted only when its manifest identity, artifact
428
+ coordinate, and all three product-gate repositories match the collector's
429
+ `--repository` value. The lower-level Node API exposes the same boundary as
430
+ `expectedAdopterId`, `expectedSourceRepository`, and `expectedSourceSha`, while
431
+ omitted identity/repository values retain the Buildchain self-release default.
432
+ It emits `kfd-adopter-manifest.json`,
408
433
  `kfd-adopter-manifest-gate.json`, and a legacy `kfd-support.json` projection.
409
434
  The release passport and `artifact-evidence.json` carry the same rooted
410
435
  `kfdAdopter` binding.
@@ -132,6 +132,22 @@ See the normative
132
132
  and its machine declaration for the exact acceptance boundary. This policy does
133
133
  not change v3 behavior.
134
134
 
135
+ ### Universal Bootstrap verified-caller admission
136
+
137
+ The v4 Universal Bootstrap does not maintain a repository allowlist. Any
138
+ repository that can call the public reusable workflow may submit the single
139
+ versioned request envelope. Admission still fails closed unless the request's
140
+ consumer repository, caller workflow path, and source SHA exactly match the
141
+ GitHub-observed caller context.
142
+
143
+ Open consumer admission does not mean open execution authority. The candidate
144
+ must still be an exact Buildchain SHA selected through a governed discovery
145
+ ref, bind the current candidate-owned admission root, have exact-head
146
+ independent review and required checks, request an admitted capability and
147
+ contract-root set, stay within the permission ceiling and validity window, and
148
+ inherit only authority available from the caller. The candidate engine exposes
149
+ bounded capability adapters; it does not accept caller-provided shell or code.
150
+
135
151
  ## Advanced Workflow
136
152
 
137
153
  Consumers that need direct workflow-shell or runtime control call the advanced
@@ -110,12 +110,12 @@ artifact_profile_selector = "package"
110
110
  ```
111
111
 
112
112
  The public reusable workflow is
113
- `kungfu-systems/buildchain/.github/workflows/v4-adopter-delivery.yml@v4` for
113
+ `kungfu-systems/buildchain/.github/workflows/public-build-adopter-qualification.yml@v4` for
114
114
  stable use and `@v4-alpha` during prerelease evaluation. It resolves the exact
115
115
  called-workflow SHA, enforces floating selector plus dual-lock consumer
116
116
  admission, and runs the same CLI on Linux, macOS, and Windows. Buildchain
117
117
  dogfoods it through the thin
118
- [`v4-adopter-delivery-dogfood.yml`](../.github/workflows/v4-adopter-delivery-dogfood.yml)
118
+ [`self-build-adopter-dogfood.yml`](../.github/workflows/self-build-adopter-dogfood.yml)
119
119
  caller, which contains no steps or local orchestration and persists only the
120
120
  floating `@v4-alpha` selector.
121
121
 
@@ -7,12 +7,12 @@ source_level: repository-contracts + protected-provider-readback
7
7
  confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
- review_state: self-reviewed
11
- last_reviewed: 2026-08-13
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-09-05
12
12
  ai_provenance:
13
- model_family: GPT-5
13
+ model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-08-13
15
+ generated_at: 2026-09-05
16
16
  invisible_context: Provider credentials and private provider state were not read.
17
17
  ---
18
18
 
@@ -26,8 +26,9 @@ dev/v4/v4.0 -> alpha/v4/v4.0 -> release/v4/v4.0
26
26
  ```
27
27
 
28
28
  Public consumers use `v4-alpha` for the current prerelease channel and `v4`
29
- for stable. Reproducible consumers may pin an exact 40-character commit or an
30
- exact immutable release tag such as `v4.0.0`.
29
+ for stable, with matching stable and alpha contract locks. Exact commits and
30
+ immutable release tags identify retained evidence and explicitly admitted runtime
31
+ inputs; tracked v4 reusable-workflow selectors remain `@v4` or `@v4-alpha`.
31
32
 
32
33
  The release transaction is fail-closed. The v4 provider-operation journal,
33
34
  activation plan, stable publication fence, and partial-mutation recovery plan
@@ -51,8 +52,9 @@ exact alpha tag, and npm's `alpha` tag.
51
52
  ## Non-destructive rollback
52
53
 
53
54
  Rollback never rewrites an exact tag, release, package version, Passport, or
54
- provider journal. Stop forward promotion, pin consumers to the last verified
55
- exact v4 SHA or exact stable tag, and use the retained `release/v3/v3.0`
55
+ provider journal. Stop forward promotion and select the last verified exact
56
+ v4 runtime through an admitted, non-persistent recovery input; keep tracked v4
57
+ workflow selectors on their locked floating channel. Use `release/v3/v3.0`
56
58
  coordinate only as an explicit compatibility rollback reference. Restoring v3
57
59
  as production authority requires a new reviewed cutover; it is not an implicit
58
60
  fallback.
@@ -61,3 +63,64 @@ Before any retry, compare the current provider state with the retained
61
63
  transaction and operation roots. Resume only missing eligible operations.
62
64
  Conflicting state remains `repair-required` or terminal and must not be
63
65
  converted into success by moving a floating ref.
66
+
67
+ ## Publication settlement and binary recovery
68
+
69
+ Publication, next-development advancement, and binary distribution have separate
70
+ results. A completed native ReleaseReceipt remains publication evidence when the
71
+ later generated Dev PR is still pending or its enqueue call fails. SETTLE verifies
72
+ the immutable invocation, transaction, both provider states, receipt and Passport
73
+ roots even when APPLY fails after publication. It has no provider write permission.
74
+
75
+ APPLY retains that exact chain before waiting for next-development in the existing GitHub Release as
76
+ `buildchain-publication-settlement.json`; it reads the exact tag and original
77
+ `buildchain.release.json` before adding the packet. The APPLY artifact also retains
78
+ `delivery-summary.json`, which reports publication and next-development separately.
79
+ A green workflow label cannot substitute for this receipt verification.
80
+
81
+ Binary Distribution reads this settlement and the original publication Passport.
82
+ Tag creation can precede settlement, so it waits at most 40 observations, 15 seconds
83
+ apart, for missing evidence. A mismatched source, tag, Passport or receipt fails
84
+ immediately. It no longer requires a legacy `buildchain/release-state/*` ref for v4.
85
+
86
+ The sealed binary publisher retains the publication Passport and writes its own
87
+ Passport as `buildchain.binary.release.json`. All v4 asset collisions are checked
88
+ before uploads: identical bytes are preserved, absent assets are added, and
89
+ conflicting bytes are rejected. Each publication authorization is retained as
90
+ `buildchain.binary.capability-<sha256>.json`, so a fresh recovery capability does
91
+ not overwrite an earlier grant. Existing assets are never clobbered. Recovery uses
92
+ the same exact successful Binary Distribution evidence run through
93
+ `self-release-binary-assets.yml`; it does not rebuild already admitted archives or
94
+ create another npm version. Read back all three platform archives, checksums,
95
+ both Passports and the settlement packet before declaring distribution complete.
96
+
97
+ The native publication receipt authorizes no stable promotion and makes no claim
98
+ that a pending next-development PR has merged. Inspect the exact PR head, protected
99
+ base and merge result independently. A retry of the publication phase must first
100
+ read retained provider facts and resume only missing operations.
101
+
102
+ ## Automatic next-development review
103
+
104
+ `self-release-next-development.yml` observes a successful exact `Verify` PR run
105
+ for a same-repository `chore/next-development/*` branch. It executes only the
106
+ protected default branch runtime. The PR must have one parent equal to the
107
+ current protected Dev head. The protected generator reconstructs every tracked
108
+ byte, permits only the declared immediate alpha version increment, and verifies
109
+ the completed alpha settlement against the exact tag and original Passport.
110
+ The published source tree must equal the protected development base tree.
111
+
112
+ The verification step receives no approval credential and never executes PR
113
+ code. A separate step uses `BUILDCHAIN_APPROVAL_TOKEN`, verifies that its identity
114
+ is the independent `kungfu-origin` CODEOWNER, rereads the exact PR/run/base, and
115
+ approves only that commit. Existing requests for changes stop automation.
116
+ The exact approval is read back before queue admission with the separate
117
+ `BUILDCHAIN_PROMOTION_TOKEN`. Required checks, CODEOWNER protection and native
118
+ merge-group verification remain enforced. Missing credentials or evidence,
119
+ forks, source changes and base/head drift fail closed.
120
+
121
+ The producer waits for pending independent review and required checks with a
122
+ bounded retry budget. Publication evidence is already durable during this wait,
123
+ so binaries can proceed independently. The reviewer also enqueues the verified
124
+ head idempotently, allowing a producer interruption to leave a recoverable PR.
125
+ An interrupted producer run remains failed; a successful later release is needed
126
+ to establish an uninterrupted end-to-end publication.
@@ -0,0 +1,58 @@
1
+ ---
2
+ status: draft
3
+ period: 2026-09-04
4
+ theme: buildchain-v4-rust-wasm-production-authority
5
+ doc_type: architecture
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: self-reviewed
11
+ last_reviewed: 2026-09-04
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-09-04
16
+ invisible_context: not-claimed
17
+ ---
18
+
19
+ # Buildchain v4 Rust/WASM production authority
20
+
21
+ Buildchain v4 的确定性发布语义由
22
+ `crates/buildchain-v4-contracts` 编译出的同一份 WebAssembly artifact 执行。Node
23
+ 仍是 GitHub Action 和 npm 包的宿主,但只负责 provider SDK、文件系统、凭据、环境变量及
24
+ workflow 输入输出等副作用边界。权威契约见
25
+ `architecture/v4-rust-wasm-production-authority.json`。
26
+
27
+ ## 分发与调用
28
+
29
+ `packages/core/buildchain-v4-domain.wasm` 与 JavaScript 一起提交和发布。三个生产 Action
30
+ 在构建时把完全相同的字节复制到各自 `dist/`;运行时不进入调用方仓库寻找 Rust
31
+ 源码,也不要求安装 Rust。`packages/core/v4-domain-wasm.js` 从自身相邻路径同步读取
32
+ artifact,先核验生成元数据中的 SHA-256,再实例化 WebAssembly 并通过封闭 JSON/bytes
33
+ ABI 调用领域操作。
34
+
35
+ 缺失、被篡改、无法实例化、缺少导出、ABI 版本不符、trap 或非法响应都会失败关闭;
36
+ 不存在 JavaScript 领域算法回退。公共 JavaScript API 保留为薄 facade,调用者无须改成
37
+ 直接操作 WASM 内存。
38
+
39
+ ## 构建和审计
40
+
41
+ `pnpm run build:v4-wasm` 使用锁定的 Rust 工具链和 `wasm32-unknown-unknown` target 生成
42
+ artifact 与绑定元数据,并把 Cargo 依赖源目录映射到稳定的虚拟路径,禁止主机 Cargo
43
+ registry 路径进入 artifact。`pnpm run check:v4-wasm` 在干净临时 target 目录重新构建并逐字节
44
+ 比较已跟踪 artifact。这个检查不是生产运行时的重复编译:生产只加载已提交字节;检查
45
+ 用于证明这些字节仍能由当前 Rust 真相源和锁定工具链唯一导出,从而阻止源码、二进制或
46
+ 生成元数据静默漂移。
47
+
48
+ 受保护的 Verify 在 Linux 完成可复现构建,并在 Linux x64、macOS arm64 和 Windows x64
49
+ 上用 Node 24 直接加载同一提交中的 artifact。Action bundle 检查同时证明三个 `dist/`
50
+ 副本与核心 artifact 完全一致。
51
+
52
+ ## 权威边界
53
+
54
+ Rust/WASM 决定 canonical JSON/content root、release invocation、product publication、
55
+ provider journal/readback fold、activation、stable fence、partial-mutation recovery 与
56
+ release-tail 的计划、状态转换、重试/readback 和 receipt。Node 执行 Rust 返回的明确
57
+ instruction,把 provider observation 或归类后的 provider fault 回送给 Rust,由 Rust
58
+ 决定下一状态;Node 不写第二套相同领域规则。
@@ -136,8 +136,8 @@ shadow-only: it does not skip a v3 production stage or move v3 authority.
136
136
  `architecture/v4-stage-capsule-qualification.json` closes the Wave 2
137
137
  qualification boundary. Buildchain and external repositories use the same
138
138
  Buildchain-owned public reusable workflow,
139
- `.github/workflows/v4-stage-capsule-canary.yml`. Buildchain's caller is the thin
140
- `.github/workflows/v4-public-consumer-dogfood.yml`; it has no steps, copied
139
+ `.github/workflows/public-build-stage-capsule-canary.yml`. Buildchain's caller is the thin
140
+ `.github/workflows/self-build-public-consumer-dogfood.yml`; it has no steps, copied
141
141
  orchestration, local action, direct qualification invocation, or private
142
142
  consumer profile. Candidate recursion is resolved only by publishing the exact
143
143
  candidate at `train/v4/v4.0/<capability>` and calling that fully qualified
@@ -56,7 +56,7 @@ receipt creation and verification.
56
56
  ## Reusable workflow
57
57
 
58
58
  Consumers invoke
59
- `kungfu-systems/buildchain/.github/workflows/v4-tail-reseal.yml@v4-alpha` from a
59
+ `kungfu-systems/buildchain/.github/workflows/public-ops-tail-reseal.yml@v4-alpha` from a
60
60
  trusted, same-repository workflow. The caller supplies the rooted request, the
61
61
  original candidate consumer-policy receipt, a reviewed macOS finalization
62
62
  command, and the explicitly named signing secret. The command must write: