@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.
- package/AGENTS.md +10 -1
- package/CONTRIBUTING.md +24 -0
- package/README.md +2 -2
- package/actions/promote-buildchain-ref/README.md +1 -1
- package/actions/v4-release-candidate-promote/README.md +28 -0
- package/architecture/agent-change-map.md +64 -7
- package/architecture/ci-lane-change-budget.json +366 -0
- package/architecture/internal-capabilities.json +53 -8
- package/architecture/maintainability-debt.json +147 -93
- package/architecture/maintainability-policy.json +32 -28
- package/architecture/release-tail-contract-inventory.json +6 -6
- package/architecture/v4-architecture-constitution.md +23 -20
- package/architecture/v4-cross-platform-adopter-qualification.json +1 -1
- package/architecture/v4-delivery-authority-parity.json +2 -2
- package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.json +1 -1
- package/architecture/v4-floating-consumer-policy.json +2 -2
- package/architecture/v4-next-development-parity.json +5 -5
- package/architecture/v4-partial-mutation-recovery-qualification.json +4 -1
- package/architecture/v4-platform-stage-checkpoints.json +1 -1
- package/architecture/v4-provider-operation-journal-contract.json +5 -2
- package/architecture/v4-publication-facade-patches.json +64 -0
- package/architecture/v4-release-activation-shadow-domain.json +5 -2
- package/architecture/v4-release-topology.json +74 -39
- package/architecture/v4-rust-wasm-production-authority.json +58 -0
- package/architecture/v4-stable-publication-fence.json +5 -2
- package/architecture/v4-stage-capsule-qualification.json +2 -2
- package/architecture/v4-tail-reseal-parity.json +8 -6
- package/architecture/v4-universal-workflow-bootstrap.json +171 -0
- package/architecture/v4-universal-workflow-fault-campaign.json +72 -0
- package/architecture/v4-universal-workflow-train-admission.json +40 -0
- package/architecture/workflow-taxonomy.json +1451 -0
- package/bin/buildchain.mjs +7 -7
- package/contracts/buildchain-v2-residuals-v1.json +57 -48
- package/contracts/dev-delivery-authority-v2.schema.json +16 -2
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/contracts/v4-canonical-contracts-v1.schema.json +1 -0
- package/dist/site/buildchain-contract.json +93 -48
- package/dist/site/buildchain-site.json +222 -69
- package/dist/site/capability-registry.json +4 -4
- package/dist/site/controller-registry.json +50 -13
- package/dist/site/kfd-claims.json +2585 -1000
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +13 -13
- package/dist/site/node-api-registry.json +120 -115
- package/dist/site/page-registry.json +204 -51
- package/dist/site/public-surface-audit.json +3205 -1219
- package/dist/site/publication-authority-registry.json +1124 -362
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/schemas/dev-delivery-authority-v2.schema.json +16 -2
- package/dist/site/site-manifest.json +17 -17
- package/dist/site/workflow-registry.json +5061 -1659
- package/docs/MAP.md +1 -0
- package/docs/auditable-demo.md +1 -1
- package/docs/cli.md +21 -8
- package/docs/dev-delivery-warrant.md +1 -1
- package/docs/engineering-housekeeper.md +3 -3
- package/docs/kfd-support.md +26 -2
- package/docs/next-development-transition.md +2 -2
- package/docs/node-api-reference.md +190 -190
- package/docs/publication-authority.md +2 -2
- package/docs/release-candidate.md +3 -3
- package/docs/release-flow.md +67 -19
- package/docs/release-governance.md +8 -8
- package/docs/release-passport.md +27 -2
- package/docs/reusable-build-surface.md +16 -0
- package/docs/v4-adopter-delivery.md +2 -2
- package/docs/v4-production-release.md +71 -8
- package/docs/v4-rust-wasm-production-authority.md +58 -0
- package/docs/v4-stage-capsule.md +2 -2
- package/docs/v4-tail-reseal.md +1 -1
- package/docs/workflow-catalog.md +154 -0
- package/docs/workflow-path-migration.md +109 -0
- package/package.json +10 -6
- package/packages/core/artifact-verification-envelope.js +5 -5
- package/packages/core/buildchain-contract.js +1 -1
- package/packages/core/buildchain-kfd-claims.js +2 -2
- package/packages/core/buildchain-publication-authority.js +42 -26
- package/packages/core/buildchain-v4-domain.wasm +0 -0
- package/packages/core/ci-lane-change-budget.js +14 -1
- package/packages/core/controller-evidence.js +4 -1
- package/packages/core/dev-delivery-candidate-identity.js +40 -6
- package/packages/core/dev-delivery-warrant-state.js +3 -4
- package/packages/core/dev-delivery-warrant.js +12 -2
- package/packages/core/github-governance-authority.js +4 -4
- package/packages/core/kfd-adopter-manifest.js +46 -47
- package/packages/core/next-development-projection.js +2 -2
- package/packages/core/paper-agent-entry.js +30 -4
- package/packages/core/paper-fleet.js +1 -1
- package/packages/core/paper-runtime-channels.js +348 -0
- package/packages/core/paper-scaffold-content.js +10 -0
- package/packages/core/paper.js +37 -71
- package/packages/core/release-line-dry-run.js +1 -1
- package/packages/core/release-passport-contract.js +5 -5
- package/packages/core/release-passport.js +5 -4
- package/packages/core/release-tail-provider-plane.js +68 -1048
- package/packages/core/v4-canonical-contracts.js +10 -75
- package/packages/core/v4-domain-wasm-artifact.js +7 -0
- package/packages/core/v4-domain-wasm.js +216 -0
- package/packages/core/v4-floating-consumer-evidence.js +1 -1
- package/packages/core/v4-floating-consumer-policy.js +1 -1
- package/packages/core/v4-partial-mutation-recovery-qualification.js +9 -386
- package/packages/core/v4-product-publication.js +19 -349
- package/packages/core/v4-protected-publication-source.js +19 -21
- package/packages/core/v4-provider-operation-journal.js +18 -487
- package/packages/core/v4-provider-readback-idempotency.js +12 -97
- package/packages/core/v4-release-activation-shadow.js +13 -500
- package/packages/core/v4-release-invocation.js +28 -389
- package/packages/core/v4-stable-publication-fence.js +13 -342
- package/packages/core/v4-universal-workflow-bootstrap.js +586 -0
- package/scripts/binary-publication-evidence.mjs +135 -0
- package/scripts/build-contract-core.mjs +1 -14
- package/scripts/build-v4-domain-wasm.mjs +189 -0
- package/scripts/check-action-bundles.mjs +12 -2
- package/scripts/check-ci-lane-change-budget.mjs +4 -1
- package/scripts/check-core-mechanism-inventory.mjs +4 -3
- package/scripts/check-inventory.mjs +35 -44
- package/scripts/check-maintainability.mjs +16 -113
- package/scripts/check-v4-floating-consumer-policy-contract.mjs +2 -2
- package/scripts/check-v4-public-dogfood-contract.mjs +22 -9
- package/scripts/check-v4-release-topology.mjs +90 -33
- package/scripts/check-v4-runtime-semantic-closure.mjs +4 -1
- package/scripts/check-v4-universal-workflow-bootstrap.mjs +266 -0
- package/scripts/check-workflow-taxonomy.mjs +6 -0
- package/scripts/copy-v4-domain-wasm.mjs +14 -0
- package/scripts/dev-delivery-authority-command-adapters.mjs +1 -1
- package/scripts/dev-delivery-authority.mjs +8 -8
- package/scripts/dev-delivery-source-proof-reuse.mjs +2 -1
- package/scripts/dev-delivery-warrant-options.mjs +14 -9
- package/scripts/dev-delivery-warrant-store.mjs +73 -7
- package/scripts/dev-delivery-warrant-transition.mjs +109 -0
- package/scripts/dev-delivery-warrant.mjs +76 -99
- package/scripts/dev-pr-auto-merge.mjs +15 -15
- package/scripts/generate-channel-build-workflow.mjs +7 -2
- package/scripts/generate-channel-promotion-workflow.mjs +7 -5
- package/scripts/generate-site-bundle.mjs +11 -11
- package/scripts/generate-v4-universal-workflow-facades.mjs +458 -0
- package/scripts/generate-workflow-taxonomy.mjs +25 -0
- package/scripts/github-output.mjs +31 -0
- package/scripts/maintainability-metrics.mjs +16 -5
- package/scripts/maintainability-public-surface.mjs +115 -0
- package/scripts/next-development-review.mjs +307 -0
- package/scripts/paper-work-fleet-cli.mjs +2 -0
- package/scripts/release-asset-client.mjs +91 -0
- package/scripts/release-candidate-resolver.mjs +9 -9
- package/scripts/source-verification-evidence.mjs +344 -0
- package/scripts/stable-candidate-qualification.mjs +1 -1
- package/scripts/universal-facade-maintainability.mjs +82 -0
- package/scripts/v4-product-publication-intent.mjs +13 -6
- package/scripts/v4-publication-settlement.mjs +211 -0
- package/scripts/v4-universal-workflow-backflow.mjs +212 -0
- package/scripts/v4-universal-workflow-engine.mjs +618 -0
- package/scripts/v4-universal-workflow-self-dogfood.mjs +205 -0
- package/scripts/verify-version-state-delta.mjs +173 -0
- package/scripts/workflow-taxonomy.mjs +507 -0
- package/templates/native-dev-delivery.yml +4 -7
- package/templates/universal-buildchain-bootstrap-recovery.yml +282 -0
- 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/
|
|
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/
|
|
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/
|
|
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/
|
|
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: ""
|
package/docs/release-flow.md
CHANGED
|
@@ -8,17 +8,17 @@ confidence: high
|
|
|
8
8
|
sensitivity: public
|
|
9
9
|
evidence_grade: A
|
|
10
10
|
review_state: unreviewed
|
|
11
|
-
last_reviewed: 2026-
|
|
11
|
+
last_reviewed: 2026-09-05
|
|
12
12
|
ai_provenance:
|
|
13
|
-
model_family: GPT-
|
|
13
|
+
model_family: GPT-6
|
|
14
14
|
product: Codex
|
|
15
|
-
generated_at: 2026-
|
|
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
|
|
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
|
|
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 `
|
|
255
|
-
`alpha/
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
release/
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
alpha/
|
|
273
|
-
dev/
|
|
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/
|
|
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/
|
|
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
|
-
`
|
|
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/
|
|
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`
|
package/docs/release-passport.md
CHANGED
|
@@ -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
|
|
407
|
-
and the existing product-gate roots.
|
|
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/
|
|
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
|
-
[`
|
|
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:
|
|
11
|
-
last_reviewed: 2026-
|
|
10
|
+
review_state: unreviewed
|
|
11
|
+
last_reviewed: 2026-09-05
|
|
12
12
|
ai_provenance:
|
|
13
|
-
model_family: GPT-
|
|
13
|
+
model_family: GPT-6
|
|
14
14
|
product: Codex
|
|
15
|
-
generated_at: 2026-
|
|
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
|
|
30
|
-
|
|
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
|
|
55
|
-
|
|
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 不写第二套相同领域规则。
|
package/docs/v4-stage-capsule.md
CHANGED
|
@@ -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/
|
|
140
|
-
`.github/workflows/
|
|
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
|
package/docs/v4-tail-reseal.md
CHANGED
|
@@ -56,7 +56,7 @@ receipt creation and verification.
|
|
|
56
56
|
## Reusable workflow
|
|
57
57
|
|
|
58
58
|
Consumers invoke
|
|
59
|
-
`kungfu-systems/buildchain/.github/workflows/
|
|
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:
|