@kungfu-tech/buildchain 4.0.5 → 4.0.6
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/architecture/maintainability-policy.json +4 -4
- package/architecture/release-topology.json +4 -2
- package/architecture/workflow-taxonomy.json +1 -1
- package/dist/site/buildchain-contract.json +2 -2
- package/dist/site/buildchain-site.json +11 -6
- package/dist/site/kfd-claims.json +2 -2
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/page-registry.json +7 -2
- package/dist/site/public-surface-audit.json +2 -2
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/site-manifest.json +4 -4
- package/dist/site/workflow-registry.json +5 -5
- package/docs/v4-production-release.md +19 -1
- package/package.json +1 -1
- package/scripts/next-development-review.mjs +23 -4
- package/scripts/release-finalization-review.mjs +53 -0
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"repositoryBudgets": {
|
|
28
28
|
"baselineRevision": "9569f69c2cb609372b8a3d65ce5dec8fb7b34a84",
|
|
29
|
-
"maxHandMaintainedSourceFiles":
|
|
30
|
-
"maxHandMaintainedSourceLines":
|
|
29
|
+
"maxHandMaintainedSourceFiles": 510,
|
|
30
|
+
"maxHandMaintainedSourceLines": 175456,
|
|
31
31
|
"maxWorkflowFiles": 80,
|
|
32
32
|
"maxWorkflowLines": 26791,
|
|
33
|
-
"latestTransition": "
|
|
34
|
-
"latestTransitionRationale": "Charge
|
|
33
|
+
"latestTransition": "Complete protected stable publication without operator finalization handoffs.",
|
|
34
|
+
"latestTransitionRationale": "Charge two bounded modules for independent stable version regeneration and exact protected finalization waiting, plus their caller wiring, at the measured source total. Reuse the existing protected review workflow and source snapshot helper. Preserve all per-file, per-function, workflow, exception and aggregate debt ceilings; require independent governance review.",
|
|
35
35
|
"rationale": "Bounded modules separate candidate, evidence, native proof and execution, canonical failure verification, closed-set execution transfer, process-boundary verification, Warrant state and qualification, authority state, qualification, Landing acquisition, verified-attempt admission, Landing settlement and fence validation, provider attempt and heartbeat readback, sealed terminal evidence, hosted heartbeat, resume, store, options, command-specific adapters, and CLI orchestration responsibilities. The protected delivery workflow gives candidate and seal jobs no provider write credential, recursively rejects transfer drift, scopes every transfer artifact to the exact provider run attempt, chains every durable heartbeat state and receipt root on a distinct hosted runner domain, and permits qualification or exact failure settlement only after the finalizer verifies live jobs and the latest durable authority state. Public Landing admission and heartbeat always perform non-injectable fresh exact-attempt provider readback, tolerate only a not-yet-materialized seal job while retaining exact native and duplicate-job rejection, and heartbeat-loss coordination never invokes GitHub's run-scoped cancellation API where a successor rerun could race. The hosted process boundary anchors trust in the kernel-resolved versioned Runner.Worker path while accepting an equivalent argv-zero spelling with the same basename; its public boundary marker is allowed only at the one exact non-secret value, so a forged value under the same credential-like name still fails closed. The credentialless transfer seal validates the rooted native reuse decision against the Warrant-bound source, closure, dependency, toolchain, environment and command inputs; qualifiedBase stays in the proof and decision where it is rooted and later independently rechecked, rather than being assumed on the Warrant schema. V2 mutation cannot initialize a second empty authority beside a legacy ref: migration reads and roots the canonical live v1 ref, rechecks it, applies the explicit configured v2 policy, and atomically replaces its bytes through one expected-old non-force update, so old v1 controllers fail closed while the prior commit remains immutable history. Candidate ancestry classifies the GitHub artifact runtime token as credential authority. Every Landing settlement, including an unexpired fence, requires product-owned terminal readback. Terminal cleanup reads the immutable historical attempt, derives workflow and hosted Landing job identity from live run data, reads the exact protected ref head and compares containment against that immutable SHA, and seals merged only when the admitted merge-group head is contained by that protected base; a later different-head merge settles the old attempt as dequeued. Terminal normalization preserves transfer, finalizer boundary, native and seal job, admitted provider attempt, protected-base head, containment result, and terminal readback coordinates. The public reusable workflow truthfully retains its single-flight v1 authority without advertising v2 migration, while bounded v2 remains a separate opt-in CLI, Node API, and schema contract; the tracked self-caller stays on public v4-alpha with matching stable and alpha locks, and transient train selection is dispatch-only. Next-development parity adds one versioned transition authority, one durable controller, one bounded reservation adapter, and pure public-contract recovery evidence while retaining the existing thin floating-channel callers byte-for-byte. The floating-consumer gate reuses the existing contract-world evaluator so SHA drift passes only under the selected lock's compatibility policy, breaking surface drift still fails closed, and external certification reconstructs the receipt from the observed workflow SHA rather than the lock's historical evidence SHA. Tail reseal adds no Stage Capsule effect or general rebuild authority: it verifies the exact retained four-platform bytes, admits one known macOS tail failure through live provider readback, fences signing and finalization to explicit credentials and Warrant identity, and requires standard candidate Passport plus provider and protected readback. Compatibility Facts parity isolates canonical encoding, temporal verification, lifecycle validation, fixture projection, public authority projection, and CLI adaptation into bounded modules; legacy digest and proof arrays are derived only from exact current Fact lineage. Publication Rehearsal adds no production release authority: the content-addressed capsule contract binds source, candidate, manifest, config, canonical data-only provider bindings, provider policy, observations and core version separately from filesystem, runtime and rehearsal-only provider authority; simulate, replay and explicitly authorized provider rehearsal all reuse the release-tail planner, while same-commit local dogfood resolves the new reusable contract and exact current runtime before external callers remain on floating v4-alpha. Cross-runtime candidate recovery preserves original runtime and provider roots and creates resume lineage only after exact public ref, tag, ancestry, npm version and integrity readback. Adopter Delivery restores the reviewed public v3 gate, drivers, Passport binding, N-1 bootstrap and exact archive loader through one public v4 surface while keeping provider and release authority explicit non-claims. Floating Alpha bootstrap uses only the existing exact resolver and protected Alpha private shell to move an otherwise stale floating shell, retains public v4 stable promotion, and removes itself after protected readback. CI lane change-budget enforcement adds a bounded parser, evaluator, guard, and tests without creating another merge authority.",
|
|
36
36
|
"governance": "legacy-debt-sunset-2026q4"
|
|
37
37
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"Paper product release",
|
|
60
60
|
"npm dry-run",
|
|
61
61
|
"v3 rollback workflows",
|
|
62
|
-
"
|
|
62
|
+
"Protected generated version review: no package, tag or Release mutation; independently inventoried in closedWorld and privilegedExecutableClosure. Stable finalization review consumes the exact tag and regenerates the rooted version state before protected auto-merge.",
|
|
63
63
|
"Post-publication protected development review: no package, tag or Release mutation; independently inventoried in closedWorld and privilegedExecutableClosure.",
|
|
64
64
|
"Post-publication OCI Compose preview activation is measured separately in postPublicationScope; it consumes completed publication and qualification, copies one manifest to the sealed alias, and cannot materialize versions or release refs."
|
|
65
65
|
]
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"actions/release-candidate-promote/next-development-queue.js",
|
|
144
144
|
"actions/release-candidate-promote/oci-provider.js",
|
|
145
145
|
"actions/release-candidate-promote/oci-registry-client.js",
|
|
146
|
+
"actions/release-candidate-promote/product-finalization-wait.js",
|
|
146
147
|
"actions/release-candidate-promote/product-provider-adapters.js",
|
|
147
148
|
"actions/release-candidate-promote/product-provider-github-adapters.js",
|
|
148
149
|
"actions/release-candidate-promote/product-provider.js",
|
|
@@ -208,9 +209,10 @@
|
|
|
208
209
|
"scripts/oci-compose-preview.mjs",
|
|
209
210
|
"scripts/publication-settlement.mjs",
|
|
210
211
|
"scripts/release-asset-client.mjs",
|
|
212
|
+
"scripts/release-finalization-review.mjs",
|
|
211
213
|
"scripts/verify-version-state-delta.mjs"
|
|
212
214
|
],
|
|
213
|
-
"root": "sha256:
|
|
215
|
+
"root": "sha256:7a51840f34c85125fc7b65c6b1881d59e62ea05ad8265f7c8f3a66a3d11539f7"
|
|
214
216
|
},
|
|
215
217
|
"rustWasmAuthority": {
|
|
216
218
|
"loader": "packages/core/domain-wasm.js",
|
|
@@ -870,7 +870,7 @@
|
|
|
870
870
|
"owner": "kungfu-origin",
|
|
871
871
|
"status": "active",
|
|
872
872
|
"invocation": "repository",
|
|
873
|
-
"rationale": "Independently regenerate
|
|
873
|
+
"rationale": "Independently regenerate generated next-development or stable finalization version deltas from protected source, verify the exact publication receipt or stable tag and rooted state, and approve only the verified head under existing CODEOWNER and merge protection."
|
|
874
874
|
},
|
|
875
875
|
{
|
|
876
876
|
"id": "npm-publish",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"product": {
|
|
5
5
|
"name": "Buildchain",
|
|
6
6
|
"package": "@kungfu-tech/buildchain",
|
|
7
|
-
"version": "4.0.
|
|
7
|
+
"version": "4.0.6",
|
|
8
8
|
"repository": "https://github.com/kungfu-systems/buildchain"
|
|
9
9
|
},
|
|
10
10
|
"majorLine": "v4",
|
|
@@ -5444,5 +5444,5 @@
|
|
|
5444
5444
|
"compatibilityFactCutRoot": "sha256:f61b975d4a96c921cc4bd37fb3ed9a0596b47004fe34dc7219979d697e3707f9",
|
|
5445
5445
|
"compatibilityProofRegistryRoot": "sha256:b7194b811e4d3af2df4390bc4d1731e16a86215bd64ee18cb630dd5492f4fb63",
|
|
5446
5446
|
"compatibilityDigest": "sha256:a0d4f48bb6236f6932466cfb2802b866035c5be5861a9d41c2975307a640fb18",
|
|
5447
|
-
"contractDigest": "sha256:
|
|
5447
|
+
"contractDigest": "sha256:a51fd9f7c5b297ddc04ca27905a8778ca32e41f444553d64c68fa36c8d689185"
|
|
5448
5448
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"contract": "kungfu-buildchain-site-bundle",
|
|
4
|
-
"generatedAt": "2026-09-
|
|
5
|
-
"publishedAt": "2026-09-
|
|
4
|
+
"generatedAt": "2026-09-08T03:41:34.000Z",
|
|
5
|
+
"publishedAt": "2026-09-08T03:41:34.000Z",
|
|
6
6
|
"reproducible": true,
|
|
7
7
|
"timestampPolicy": "ci-injected",
|
|
8
8
|
"deterministicInputs": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"declared Buildchain surface manifest contract"
|
|
20
20
|
],
|
|
21
21
|
"sourceDateEpoch": "0",
|
|
22
|
-
"sourceRevision": "
|
|
22
|
+
"sourceRevision": "8d71f97f81bf1c53a960aec19008b64bfd36b42d",
|
|
23
23
|
"timestampPolicyDetails": {
|
|
24
24
|
"contract": "kungfu-buildchain-surface-timestamp-policy",
|
|
25
25
|
"timestampFields": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"package": {
|
|
39
39
|
"name": "@kungfu-tech/buildchain",
|
|
40
|
-
"version": "4.0.
|
|
40
|
+
"version": "4.0.6",
|
|
41
41
|
"versionSource": "package.json#version"
|
|
42
42
|
},
|
|
43
43
|
"source": {
|
|
@@ -5128,7 +5128,7 @@
|
|
|
5128
5128
|
],
|
|
5129
5129
|
"maturity": "stable",
|
|
5130
5130
|
"sourcePath": "docs/v4-production-release.md",
|
|
5131
|
-
"digest": "sha256:
|
|
5131
|
+
"digest": "sha256:3753fa5ae591dd706f4838d2b0a3e07428de8ea0a089a30b42a3820d3c2aa4d3",
|
|
5132
5132
|
"headings": [
|
|
5133
5133
|
{
|
|
5134
5134
|
"level": 1,
|
|
@@ -5150,13 +5150,18 @@
|
|
|
5150
5150
|
"title": "Publication settlement and binary recovery",
|
|
5151
5151
|
"anchor": "publication-settlement-and-binary-recovery"
|
|
5152
5152
|
},
|
|
5153
|
+
{
|
|
5154
|
+
"level": 2,
|
|
5155
|
+
"title": "Protected stable finalization",
|
|
5156
|
+
"anchor": "protected-stable-finalization"
|
|
5157
|
+
},
|
|
5153
5158
|
{
|
|
5154
5159
|
"level": 2,
|
|
5155
5160
|
"title": "Automatic next-development review",
|
|
5156
5161
|
"anchor": "automatic-next-development-review"
|
|
5157
5162
|
}
|
|
5158
5163
|
],
|
|
5159
|
-
"markdown": "---\nstatus: active\nperiod: ongoing\ntheme: buildchain-v4-production-release\ndoc_type: runbook\nsource_level: repository-contracts + protected-provider-readback\nconfidence: high\nsensitivity: public\nevidence_grade: A\nreview_state: unreviewed\nlast_reviewed: 2026-09-08\nai_provenance:\n model_family: GPT-6\n product: Codex\n generated_at: 2026-09-08\n invisible_context: Provider credentials and private provider state were not read.\n---\n\n# Buildchain v4 production release\n\nBuildchain v4 is the production release authority for the `v4.0` line. The\nprotected source path is:\n\n```text\ndev/v4/v4.0 -> alpha/v4/v4.0 -> release/v4/v4.0\n```\n\nPublic consumers use `v4-alpha` for the current prerelease channel and `v4`\nfor stable, with matching stable and alpha contract locks. Exact commits and\nimmutable release tags identify retained evidence and explicitly admitted runtime\ninputs; tracked v4 reusable-workflow selectors remain `@v4` or `@v4-alpha`.\n\nBefore qualifying a new release, run `node scripts/check-universal-workflow-bootstrap.mjs`.\nThe required repository check rejects an expired or not-yet-valid candidate admission\npolicy before publication. Renew the bounded validity window through protected review;\nkeep its capability, permission, reviewer and exact-source requirements unchanged.\nHistorical publication receipts remain immutable when a later admission window expires.\n\nThe release transaction is fail-closed. The v4 provider-operation journal,\nactivation plan, stable publication fence, and partial-mutation recovery plan\nbind the exact source, qualification, policy, provider readback, protected\nancestry, and target roots. Confirmed operations are never replayed; uncertain\noperations require provider readback before retry; stable publication requires\nan N-1 or independently sealed qualification.\n\n## Provider readback\n\nA stable release is complete only when all of these coordinates agree:\n\n- `release/v4/v4.0`, `v4`, `v4.0`, and the exact `v4.0.x` tag;\n- the GitHub Release tag and attached Release Passport evidence;\n- npm `@kungfu-tech/buildchain@4.0.x`, its `gitHead`, and the `latest` tag;\n- the protected source and release transaction roots.\n\nThe alpha channel applies the same rule to `alpha/v4/v4.0`, `v4-alpha`, the\nexact alpha tag, and npm's `alpha` tag.\n\n## Non-destructive rollback\n\nRollback never rewrites an exact tag, release, package version, Passport, or\nprovider journal. Stop forward promotion and select the last verified exact\nv4 runtime through an admitted, non-persistent recovery input; keep tracked v4\nworkflow selectors on their locked floating channel. Use `release/v3/v3.0`\ncoordinate only as an explicit compatibility rollback reference. Restoring v3\nas production authority requires a new reviewed cutover; it is not an implicit\nfallback.\n\nBefore any retry, compare the current provider state with the retained\ntransaction and operation roots. Resume only missing eligible operations.\nConflicting state remains `repair-required` or terminal and must not be\nconverted into success by moving a floating ref.\n\n## Publication settlement and binary recovery\n\nPublication, next-development advancement, and binary distribution have separate\nresults. A completed native ReleaseReceipt remains publication evidence when the\nlater generated Dev PR is still pending or its enqueue call fails. SETTLE verifies\nthe immutable invocation, transaction, both provider states, receipt and Passport\nroots even when APPLY fails after publication. It has no provider write permission.\n\nAPPLY retains that exact chain before waiting for next-development in the existing GitHub Release as\n`buildchain-publication-settlement.json`; it reads the exact tag and original\n`buildchain.release.json` before adding the packet. The APPLY artifact also retains\n`delivery-summary.json`, which reports publication and next-development separately.\nA green workflow label cannot substitute for this receipt verification.\n\nRecovery verifies both its current execution chain and any already published\nsettlement against the exact tag, source and original Passport. It preserves\nthe existing settlement bytes and uses that original receipt for development\nadvancement. A corrected runtime may produce different recovery observations;\nthey do not authorize replacing the completed publication packet. Ambiguous,\ntampered or mismatched retained evidence still blocks recovery.\n\nBinary Distribution reads this settlement and the original publication Passport.\nTag creation can precede settlement, so it waits at most
|
|
5164
|
+
"markdown": "---\nstatus: active\nperiod: ongoing\ntheme: buildchain-v4-production-release\ndoc_type: runbook\nsource_level: repository-contracts + protected-provider-readback\nconfidence: high\nsensitivity: public\nevidence_grade: A\nreview_state: unreviewed\nlast_reviewed: 2026-09-08\nai_provenance:\n model_family: GPT-6\n product: Codex\n generated_at: 2026-09-08\n invisible_context: Provider credentials and private provider state were not read.\n---\n\n# Buildchain v4 production release\n\nBuildchain v4 is the production release authority for the `v4.0` line. The\nprotected source path is:\n\n```text\ndev/v4/v4.0 -> alpha/v4/v4.0 -> release/v4/v4.0\n```\n\nPublic consumers use `v4-alpha` for the current prerelease channel and `v4`\nfor stable, with matching stable and alpha contract locks. Exact commits and\nimmutable release tags identify retained evidence and explicitly admitted runtime\ninputs; tracked v4 reusable-workflow selectors remain `@v4` or `@v4-alpha`.\n\nBefore qualifying a new release, run `node scripts/check-universal-workflow-bootstrap.mjs`.\nThe required repository check rejects an expired or not-yet-valid candidate admission\npolicy before publication. Renew the bounded validity window through protected review;\nkeep its capability, permission, reviewer and exact-source requirements unchanged.\nHistorical publication receipts remain immutable when a later admission window expires.\n\nThe release transaction is fail-closed. The v4 provider-operation journal,\nactivation plan, stable publication fence, and partial-mutation recovery plan\nbind the exact source, qualification, policy, provider readback, protected\nancestry, and target roots. Confirmed operations are never replayed; uncertain\noperations require provider readback before retry; stable publication requires\nan N-1 or independently sealed qualification.\n\n## Provider readback\n\nA stable release is complete only when all of these coordinates agree:\n\n- `release/v4/v4.0`, `v4`, `v4.0`, and the exact `v4.0.x` tag;\n- the GitHub Release tag and attached Release Passport evidence;\n- npm `@kungfu-tech/buildchain@4.0.x`, its `gitHead`, and the `latest` tag;\n- the protected source and release transaction roots.\n\nThe alpha channel applies the same rule to `alpha/v4/v4.0`, `v4-alpha`, the\nexact alpha tag, and npm's `alpha` tag.\n\n## Non-destructive rollback\n\nRollback never rewrites an exact tag, release, package version, Passport, or\nprovider journal. Stop forward promotion and select the last verified exact\nv4 runtime through an admitted, non-persistent recovery input; keep tracked v4\nworkflow selectors on their locked floating channel. Use `release/v3/v3.0`\ncoordinate only as an explicit compatibility rollback reference. Restoring v3\nas production authority requires a new reviewed cutover; it is not an implicit\nfallback.\n\nBefore any retry, compare the current provider state with the retained\ntransaction and operation roots. Resume only missing eligible operations.\nConflicting state remains `repair-required` or terminal and must not be\nconverted into success by moving a floating ref.\n\n## Publication settlement and binary recovery\n\nPublication, next-development advancement, and binary distribution have separate\nresults. A completed native ReleaseReceipt remains publication evidence when the\nlater generated Dev PR is still pending or its enqueue call fails. SETTLE verifies\nthe immutable invocation, transaction, both provider states, receipt and Passport\nroots even when APPLY fails after publication. It has no provider write permission.\n\nAPPLY retains that exact chain before waiting for next-development in the existing GitHub Release as\n`buildchain-publication-settlement.json`; it reads the exact tag and original\n`buildchain.release.json` before adding the packet. The APPLY artifact also retains\n`delivery-summary.json`, which reports publication and next-development separately.\nA green workflow label cannot substitute for this receipt verification.\n\nRecovery verifies both its current execution chain and any already published\nsettlement against the exact tag, source and original Passport. It preserves\nthe existing settlement bytes and uses that original receipt for development\nadvancement. A corrected runtime may produce different recovery observations;\nthey do not authorize replacing the completed publication packet. Ambiguous,\ntampered or mismatched retained evidence still blocks recovery.\n\nBinary Distribution reads this settlement and the original publication Passport.\nTag creation can precede settlement, so it waits at most 160 observations, 15 seconds\napart, for missing evidence. A mismatched source, tag, Passport or receipt fails\nimmediately. It no longer requires a legacy `buildchain/release-state/*` ref for v4.\n\nThe sealed binary publisher retains the publication Passport and writes its own\nPassport as `buildchain.binary.release.json`. All v4 asset collisions are checked\nbefore uploads: identical bytes are preserved, absent assets are added, and\nconflicting bytes are rejected. Each publication authorization is retained as\n`buildchain.binary.capability-<sha256>.json`, so a fresh recovery capability does\nnot overwrite an earlier grant. Existing assets are never clobbered. Recovery uses\nthe same exact successful Binary Distribution evidence run through\n`self-release-binary-assets.yml`; it does not rebuild already admitted archives or\ncreate another npm version. Read back all three platform archives, checksums,\nboth Passports and the settlement packet before declaring distribution complete.\n\nThe native publication receipt authorizes no stable promotion and makes no claim\nthat a pending next-development PR has merged. Inspect the exact PR head, protected\nbase and merge result independently. A retry of the publication phase must first\nread retained provider facts and resume only missing operations.\n\n## Protected stable finalization\n\nA successful protected `Verify` on the release branch starts the same floating\nalpha publisher used for prereleases. The publisher creates the stable version\nPR and waits within the original transaction for protected merge and the exact\nmerged commit's successful `Verify`, before moving floating tags and completing\nthe publication receipt. Generated finalization heads are classified from their\nrooted product state and exact source tag, so their checks do not publish again.\n\nThe independent version reviewer also handles generated stable finalization PRs.\nIt requires the exact protected source parent, the rooted version-state parent,\nthe matching immutable stable tag, and byte-for-byte regeneration of the complete\ndeclared version delta. Verification uses protected source code without approval\ncredentials. A separate step approves only the verified head and enables normal\nprotected auto-merge. Changed source/base, modified PR contents, requested changes,\nfailed final checks, and timeout remain failures. Recover an interrupted run using\nthe original source and retained provider evidence; never rewrite published bytes.\n\n## Automatic next-development review\n\nAfter stable completion, the producer generates the next patch at `alpha.0`\nfrom an isolated Git checkout of the exact current protected Dev commit. The\ncheckout explicitly fetches the exact Dev commit into its own object database;\nshallow local clones alone may omit commits fetched only into `FETCH_HEAD`.\nIt retains its own index so version verification can inspect the actual\ngenerated delta, and uses the admitted runtime dependency bridge. A source\narchive without Git metadata cannot perform that verification. The publication\nreceipt remains complete if development preparation fails; recover the original\ntransaction with corrected, reviewed tooling before publishing the next version.\n\n`self-release-next-development.yml` observes a successful exact `Verify` PR run\nfor a same-repository `chore/next-development/*` branch. It executes only the\nprotected default branch runtime. The PR must have one parent equal to the\ncurrent protected Dev head. The protected generator reconstructs every tracked\nbyte, permits only the declared immediate alpha version increment, and verifies\nthe completed alpha settlement against the exact tag and original Passport.\nThe published source tree must equal the protected development base tree.\n\nThe verification step receives no approval credential and never executes PR\ncode. A separate step uses `BUILDCHAIN_APPROVAL_TOKEN`, verifies that its identity\nis the independent `kungfu-origin` CODEOWNER, rereads the exact PR/run/base, and\napproves only that commit. Existing requests for changes stop automation.\nThe exact approval is read back before queue admission with the separate\n`BUILDCHAIN_PROMOTION_TOKEN`. Required checks, CODEOWNER protection and native\nmerge-group verification remain enforced. Missing credentials or evidence,\nforks, source changes and base/head drift fail closed.\n\nThe producer waits for pending independent review and required checks with a\nbounded retry budget. Publication evidence is already durable during this wait,\nso binaries can proceed independently. The reviewer also enqueues the verified\nhead idempotently, allowing a producer interruption to leave a recoverable PR.\nAn interrupted producer run remains failed; a successful later release is needed\nto establish an uninterrupted end-to-end publication."
|
|
5160
5165
|
},
|
|
5161
5166
|
{
|
|
5162
5167
|
"id": "manual:v4-publication-rehearsal",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"contract": "kungfu-buildchain-public-surface-reverse-audit",
|
|
22
22
|
"path": "dist/site/public-surface-audit.json",
|
|
23
23
|
"status": "passed",
|
|
24
|
-
"sha256": "
|
|
24
|
+
"sha256": "d0c0ce15e3a976c62c0070f5c135206636c57eae756768270d00a6da9e61d3fb",
|
|
25
25
|
"summary": {
|
|
26
26
|
"cliCommandCount": 117,
|
|
27
27
|
"workflowCount": 115,
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
"contract": "kungfu-buildchain-public-surface-reverse-audit",
|
|
247
247
|
"path": "dist/site/public-surface-audit.json",
|
|
248
248
|
"status": "passed",
|
|
249
|
-
"sha256": "
|
|
249
|
+
"sha256": "d0c0ce15e3a976c62c0070f5c135206636c57eae756768270d00a6da9e61d3fb",
|
|
250
250
|
"summary": {
|
|
251
251
|
"cliCommandCount": 117,
|
|
252
252
|
"workflowCount": 115,
|
|
@@ -5062,7 +5062,7 @@
|
|
|
5062
5062
|
],
|
|
5063
5063
|
"maturity": "stable",
|
|
5064
5064
|
"sourcePath": "docs/v4-production-release.md",
|
|
5065
|
-
"digest": "sha256:
|
|
5065
|
+
"digest": "sha256:3753fa5ae591dd706f4838d2b0a3e07428de8ea0a089a30b42a3820d3c2aa4d3",
|
|
5066
5066
|
"headings": [
|
|
5067
5067
|
{
|
|
5068
5068
|
"level": 1,
|
|
@@ -5084,13 +5084,18 @@
|
|
|
5084
5084
|
"title": "Publication settlement and binary recovery",
|
|
5085
5085
|
"anchor": "publication-settlement-and-binary-recovery"
|
|
5086
5086
|
},
|
|
5087
|
+
{
|
|
5088
|
+
"level": 2,
|
|
5089
|
+
"title": "Protected stable finalization",
|
|
5090
|
+
"anchor": "protected-stable-finalization"
|
|
5091
|
+
},
|
|
5087
5092
|
{
|
|
5088
5093
|
"level": 2,
|
|
5089
5094
|
"title": "Automatic next-development review",
|
|
5090
5095
|
"anchor": "automatic-next-development-review"
|
|
5091
5096
|
}
|
|
5092
5097
|
],
|
|
5093
|
-
"markdown": "---\nstatus: active\nperiod: ongoing\ntheme: buildchain-v4-production-release\ndoc_type: runbook\nsource_level: repository-contracts + protected-provider-readback\nconfidence: high\nsensitivity: public\nevidence_grade: A\nreview_state: unreviewed\nlast_reviewed: 2026-09-08\nai_provenance:\n model_family: GPT-6\n product: Codex\n generated_at: 2026-09-08\n invisible_context: Provider credentials and private provider state were not read.\n---\n\n# Buildchain v4 production release\n\nBuildchain v4 is the production release authority for the `v4.0` line. The\nprotected source path is:\n\n```text\ndev/v4/v4.0 -> alpha/v4/v4.0 -> release/v4/v4.0\n```\n\nPublic consumers use `v4-alpha` for the current prerelease channel and `v4`\nfor stable, with matching stable and alpha contract locks. Exact commits and\nimmutable release tags identify retained evidence and explicitly admitted runtime\ninputs; tracked v4 reusable-workflow selectors remain `@v4` or `@v4-alpha`.\n\nBefore qualifying a new release, run `node scripts/check-universal-workflow-bootstrap.mjs`.\nThe required repository check rejects an expired or not-yet-valid candidate admission\npolicy before publication. Renew the bounded validity window through protected review;\nkeep its capability, permission, reviewer and exact-source requirements unchanged.\nHistorical publication receipts remain immutable when a later admission window expires.\n\nThe release transaction is fail-closed. The v4 provider-operation journal,\nactivation plan, stable publication fence, and partial-mutation recovery plan\nbind the exact source, qualification, policy, provider readback, protected\nancestry, and target roots. Confirmed operations are never replayed; uncertain\noperations require provider readback before retry; stable publication requires\nan N-1 or independently sealed qualification.\n\n## Provider readback\n\nA stable release is complete only when all of these coordinates agree:\n\n- `release/v4/v4.0`, `v4`, `v4.0`, and the exact `v4.0.x` tag;\n- the GitHub Release tag and attached Release Passport evidence;\n- npm `@kungfu-tech/buildchain@4.0.x`, its `gitHead`, and the `latest` tag;\n- the protected source and release transaction roots.\n\nThe alpha channel applies the same rule to `alpha/v4/v4.0`, `v4-alpha`, the\nexact alpha tag, and npm's `alpha` tag.\n\n## Non-destructive rollback\n\nRollback never rewrites an exact tag, release, package version, Passport, or\nprovider journal. Stop forward promotion and select the last verified exact\nv4 runtime through an admitted, non-persistent recovery input; keep tracked v4\nworkflow selectors on their locked floating channel. Use `release/v3/v3.0`\ncoordinate only as an explicit compatibility rollback reference. Restoring v3\nas production authority requires a new reviewed cutover; it is not an implicit\nfallback.\n\nBefore any retry, compare the current provider state with the retained\ntransaction and operation roots. Resume only missing eligible operations.\nConflicting state remains `repair-required` or terminal and must not be\nconverted into success by moving a floating ref.\n\n## Publication settlement and binary recovery\n\nPublication, next-development advancement, and binary distribution have separate\nresults. A completed native ReleaseReceipt remains publication evidence when the\nlater generated Dev PR is still pending or its enqueue call fails. SETTLE verifies\nthe immutable invocation, transaction, both provider states, receipt and Passport\nroots even when APPLY fails after publication. It has no provider write permission.\n\nAPPLY retains that exact chain before waiting for next-development in the existing GitHub Release as\n`buildchain-publication-settlement.json`; it reads the exact tag and original\n`buildchain.release.json` before adding the packet. The APPLY artifact also retains\n`delivery-summary.json`, which reports publication and next-development separately.\nA green workflow label cannot substitute for this receipt verification.\n\nRecovery verifies both its current execution chain and any already published\nsettlement against the exact tag, source and original Passport. It preserves\nthe existing settlement bytes and uses that original receipt for development\nadvancement. A corrected runtime may produce different recovery observations;\nthey do not authorize replacing the completed publication packet. Ambiguous,\ntampered or mismatched retained evidence still blocks recovery.\n\nBinary Distribution reads this settlement and the original publication Passport.\nTag creation can precede settlement, so it waits at most
|
|
5098
|
+
"markdown": "---\nstatus: active\nperiod: ongoing\ntheme: buildchain-v4-production-release\ndoc_type: runbook\nsource_level: repository-contracts + protected-provider-readback\nconfidence: high\nsensitivity: public\nevidence_grade: A\nreview_state: unreviewed\nlast_reviewed: 2026-09-08\nai_provenance:\n model_family: GPT-6\n product: Codex\n generated_at: 2026-09-08\n invisible_context: Provider credentials and private provider state were not read.\n---\n\n# Buildchain v4 production release\n\nBuildchain v4 is the production release authority for the `v4.0` line. The\nprotected source path is:\n\n```text\ndev/v4/v4.0 -> alpha/v4/v4.0 -> release/v4/v4.0\n```\n\nPublic consumers use `v4-alpha` for the current prerelease channel and `v4`\nfor stable, with matching stable and alpha contract locks. Exact commits and\nimmutable release tags identify retained evidence and explicitly admitted runtime\ninputs; tracked v4 reusable-workflow selectors remain `@v4` or `@v4-alpha`.\n\nBefore qualifying a new release, run `node scripts/check-universal-workflow-bootstrap.mjs`.\nThe required repository check rejects an expired or not-yet-valid candidate admission\npolicy before publication. Renew the bounded validity window through protected review;\nkeep its capability, permission, reviewer and exact-source requirements unchanged.\nHistorical publication receipts remain immutable when a later admission window expires.\n\nThe release transaction is fail-closed. The v4 provider-operation journal,\nactivation plan, stable publication fence, and partial-mutation recovery plan\nbind the exact source, qualification, policy, provider readback, protected\nancestry, and target roots. Confirmed operations are never replayed; uncertain\noperations require provider readback before retry; stable publication requires\nan N-1 or independently sealed qualification.\n\n## Provider readback\n\nA stable release is complete only when all of these coordinates agree:\n\n- `release/v4/v4.0`, `v4`, `v4.0`, and the exact `v4.0.x` tag;\n- the GitHub Release tag and attached Release Passport evidence;\n- npm `@kungfu-tech/buildchain@4.0.x`, its `gitHead`, and the `latest` tag;\n- the protected source and release transaction roots.\n\nThe alpha channel applies the same rule to `alpha/v4/v4.0`, `v4-alpha`, the\nexact alpha tag, and npm's `alpha` tag.\n\n## Non-destructive rollback\n\nRollback never rewrites an exact tag, release, package version, Passport, or\nprovider journal. Stop forward promotion and select the last verified exact\nv4 runtime through an admitted, non-persistent recovery input; keep tracked v4\nworkflow selectors on their locked floating channel. Use `release/v3/v3.0`\ncoordinate only as an explicit compatibility rollback reference. Restoring v3\nas production authority requires a new reviewed cutover; it is not an implicit\nfallback.\n\nBefore any retry, compare the current provider state with the retained\ntransaction and operation roots. Resume only missing eligible operations.\nConflicting state remains `repair-required` or terminal and must not be\nconverted into success by moving a floating ref.\n\n## Publication settlement and binary recovery\n\nPublication, next-development advancement, and binary distribution have separate\nresults. A completed native ReleaseReceipt remains publication evidence when the\nlater generated Dev PR is still pending or its enqueue call fails. SETTLE verifies\nthe immutable invocation, transaction, both provider states, receipt and Passport\nroots even when APPLY fails after publication. It has no provider write permission.\n\nAPPLY retains that exact chain before waiting for next-development in the existing GitHub Release as\n`buildchain-publication-settlement.json`; it reads the exact tag and original\n`buildchain.release.json` before adding the packet. The APPLY artifact also retains\n`delivery-summary.json`, which reports publication and next-development separately.\nA green workflow label cannot substitute for this receipt verification.\n\nRecovery verifies both its current execution chain and any already published\nsettlement against the exact tag, source and original Passport. It preserves\nthe existing settlement bytes and uses that original receipt for development\nadvancement. A corrected runtime may produce different recovery observations;\nthey do not authorize replacing the completed publication packet. Ambiguous,\ntampered or mismatched retained evidence still blocks recovery.\n\nBinary Distribution reads this settlement and the original publication Passport.\nTag creation can precede settlement, so it waits at most 160 observations, 15 seconds\napart, for missing evidence. A mismatched source, tag, Passport or receipt fails\nimmediately. It no longer requires a legacy `buildchain/release-state/*` ref for v4.\n\nThe sealed binary publisher retains the publication Passport and writes its own\nPassport as `buildchain.binary.release.json`. All v4 asset collisions are checked\nbefore uploads: identical bytes are preserved, absent assets are added, and\nconflicting bytes are rejected. Each publication authorization is retained as\n`buildchain.binary.capability-<sha256>.json`, so a fresh recovery capability does\nnot overwrite an earlier grant. Existing assets are never clobbered. Recovery uses\nthe same exact successful Binary Distribution evidence run through\n`self-release-binary-assets.yml`; it does not rebuild already admitted archives or\ncreate another npm version. Read back all three platform archives, checksums,\nboth Passports and the settlement packet before declaring distribution complete.\n\nThe native publication receipt authorizes no stable promotion and makes no claim\nthat a pending next-development PR has merged. Inspect the exact PR head, protected\nbase and merge result independently. A retry of the publication phase must first\nread retained provider facts and resume only missing operations.\n\n## Protected stable finalization\n\nA successful protected `Verify` on the release branch starts the same floating\nalpha publisher used for prereleases. The publisher creates the stable version\nPR and waits within the original transaction for protected merge and the exact\nmerged commit's successful `Verify`, before moving floating tags and completing\nthe publication receipt. Generated finalization heads are classified from their\nrooted product state and exact source tag, so their checks do not publish again.\n\nThe independent version reviewer also handles generated stable finalization PRs.\nIt requires the exact protected source parent, the rooted version-state parent,\nthe matching immutable stable tag, and byte-for-byte regeneration of the complete\ndeclared version delta. Verification uses protected source code without approval\ncredentials. A separate step approves only the verified head and enables normal\nprotected auto-merge. Changed source/base, modified PR contents, requested changes,\nfailed final checks, and timeout remain failures. Recover an interrupted run using\nthe original source and retained provider evidence; never rewrite published bytes.\n\n## Automatic next-development review\n\nAfter stable completion, the producer generates the next patch at `alpha.0`\nfrom an isolated Git checkout of the exact current protected Dev commit. The\ncheckout explicitly fetches the exact Dev commit into its own object database;\nshallow local clones alone may omit commits fetched only into `FETCH_HEAD`.\nIt retains its own index so version verification can inspect the actual\ngenerated delta, and uses the admitted runtime dependency bridge. A source\narchive without Git metadata cannot perform that verification. The publication\nreceipt remains complete if development preparation fails; recover the original\ntransaction with corrected, reviewed tooling before publishing the next version.\n\n`self-release-next-development.yml` observes a successful exact `Verify` PR run\nfor a same-repository `chore/next-development/*` branch. It executes only the\nprotected default branch runtime. The PR must have one parent equal to the\ncurrent protected Dev head. The protected generator reconstructs every tracked\nbyte, permits only the declared immediate alpha version increment, and verifies\nthe completed alpha settlement against the exact tag and original Passport.\nThe published source tree must equal the protected development base tree.\n\nThe verification step receives no approval credential and never executes PR\ncode. A separate step uses `BUILDCHAIN_APPROVAL_TOKEN`, verifies that its identity\nis the independent `kungfu-origin` CODEOWNER, rereads the exact PR/run/base, and\napproves only that commit. Existing requests for changes stop automation.\nThe exact approval is read back before queue admission with the separate\n`BUILDCHAIN_PROMOTION_TOKEN`. Required checks, CODEOWNER protection and native\nmerge-group verification remain enforced. Missing credentials or evidence,\nforks, source changes and base/head drift fail closed.\n\nThe producer waits for pending independent review and required checks with a\nbounded retry budget. Publication evidence is already durable during this wait,\nso binaries can proceed independently. The reviewer also enqueues the verified\nhead idempotently, allowing a producer interruption to leave a recoverable PR.\nAn interrupted producer run remains failed; a successful later release is needed\nto establish an uninterrupted end-to-end publication."
|
|
5094
5099
|
},
|
|
5095
5100
|
{
|
|
5096
5101
|
"id": "manual:v4-publication-rehearsal",
|
|
@@ -10948,8 +10948,8 @@
|
|
|
10948
10948
|
"workflowRegistryPath": "dist/site/workflow-registry.json",
|
|
10949
10949
|
"pageRegistryPath": "dist/site/page-registry.json",
|
|
10950
10950
|
"cliRegistryDigest": "fbc23073bbae240489a2f826b2c26daadc58e704050c5f8df366509f5c5a1c3e",
|
|
10951
|
-
"workflowRegistryDigest": "
|
|
10952
|
-
"pageRegistryDigest": "
|
|
10951
|
+
"workflowRegistryDigest": "8e92a07f774abe3edcd64394458cd4543a5bf9a1f42f69b9e12ea42e8d0c9eee",
|
|
10952
|
+
"pageRegistryDigest": "a303f98d4abb6e02e4ddb5510d9c4794642391c5a2f6b274b49d823461991b4c"
|
|
10953
10953
|
},
|
|
10954
10954
|
"comparison": {
|
|
10955
10955
|
"missingCliRegistry": [],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"contract": "kungfu-buildchain-publication-release-registry",
|
|
4
|
-
"generatedAt": "2026-09-
|
|
5
|
-
"publishedAt": "2026-09-
|
|
4
|
+
"generatedAt": "2026-09-08T03:41:34.000Z",
|
|
5
|
+
"publishedAt": "2026-09-08T03:41:34.000Z",
|
|
6
6
|
"reproducible": true,
|
|
7
7
|
"timestampPolicy": "ci-injected",
|
|
8
8
|
"deterministicInputs": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"declared Buildchain surface manifest contract"
|
|
20
20
|
],
|
|
21
21
|
"sourceDateEpoch": "0",
|
|
22
|
-
"sourceRevision": "
|
|
22
|
+
"sourceRevision": "8d71f97f81bf1c53a960aec19008b64bfd36b42d",
|
|
23
23
|
"timestampPolicyDetails": {
|
|
24
24
|
"contract": "kungfu-buildchain-surface-timestamp-policy",
|
|
25
25
|
"timestampFields": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"package": {
|
|
34
34
|
"name": "@kungfu-tech/buildchain",
|
|
35
|
-
"version": "4.0.
|
|
35
|
+
"version": "4.0.6",
|
|
36
36
|
"versionSource": "package.json#version"
|
|
37
37
|
},
|
|
38
38
|
"sourceKind": "package-site-bundle",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"contract": "kungfu-buildchain-site-manifest",
|
|
4
|
-
"generatedAt": "2026-09-
|
|
5
|
-
"publishedAt": "2026-09-
|
|
4
|
+
"generatedAt": "2026-09-08T03:41:34.000Z",
|
|
5
|
+
"publishedAt": "2026-09-08T03:41:34.000Z",
|
|
6
6
|
"reproducible": true,
|
|
7
7
|
"timestampPolicy": "ci-injected",
|
|
8
8
|
"deterministicInputs": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"declared Buildchain surface manifest contract"
|
|
20
20
|
],
|
|
21
21
|
"sourceDateEpoch": "0",
|
|
22
|
-
"sourceRevision": "
|
|
22
|
+
"sourceRevision": "8d71f97f81bf1c53a960aec19008b64bfd36b42d",
|
|
23
23
|
"timestampPolicyDetails": {
|
|
24
24
|
"contract": "kungfu-buildchain-surface-timestamp-policy",
|
|
25
25
|
"timestampFields": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"package": {
|
|
39
39
|
"name": "@kungfu-tech/buildchain",
|
|
40
|
-
"version": "4.0.
|
|
40
|
+
"version": "4.0.6",
|
|
41
41
|
"versionSource": "package.json#version"
|
|
42
42
|
},
|
|
43
43
|
"entrypoint": "buildchain-site.json",
|
|
@@ -2746,7 +2746,7 @@
|
|
|
2746
2746
|
"status": "preview",
|
|
2747
2747
|
"owner": "buildchain-workflows",
|
|
2748
2748
|
"maturity": "preview",
|
|
2749
|
-
"introducedVersion": "4.0.
|
|
2749
|
+
"introducedVersion": "4.0.6",
|
|
2750
2750
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
2751
2751
|
"deprecationReplacement": "",
|
|
2752
2752
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -3943,7 +3943,7 @@
|
|
|
3943
3943
|
"status": "preview",
|
|
3944
3944
|
"owner": "buildchain-workflows",
|
|
3945
3945
|
"maturity": "preview",
|
|
3946
|
-
"introducedVersion": "4.0.
|
|
3946
|
+
"introducedVersion": "4.0.6",
|
|
3947
3947
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
3948
3948
|
"deprecationReplacement": "",
|
|
3949
3949
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -6004,7 +6004,7 @@
|
|
|
6004
6004
|
"status": "preview",
|
|
6005
6005
|
"owner": "buildchain-workflows",
|
|
6006
6006
|
"maturity": "preview",
|
|
6007
|
-
"introducedVersion": "4.0.
|
|
6007
|
+
"introducedVersion": "4.0.6",
|
|
6008
6008
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
6009
6009
|
"deprecationReplacement": "",
|
|
6010
6010
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -6035,7 +6035,7 @@
|
|
|
6035
6035
|
"status": "preview",
|
|
6036
6036
|
"owner": "buildchain-workflows",
|
|
6037
6037
|
"maturity": "preview",
|
|
6038
|
-
"introducedVersion": "4.0.
|
|
6038
|
+
"introducedVersion": "4.0.6",
|
|
6039
6039
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
6040
6040
|
"deprecationReplacement": "",
|
|
6041
6041
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -6066,7 +6066,7 @@
|
|
|
6066
6066
|
"status": "preview",
|
|
6067
6067
|
"owner": "buildchain-workflows",
|
|
6068
6068
|
"maturity": "preview",
|
|
6069
|
-
"introducedVersion": "4.0.
|
|
6069
|
+
"introducedVersion": "4.0.6",
|
|
6070
6070
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
6071
6071
|
"deprecationReplacement": "",
|
|
6072
6072
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -92,7 +92,7 @@ they do not authorize replacing the completed publication packet. Ambiguous,
|
|
|
92
92
|
tampered or mismatched retained evidence still blocks recovery.
|
|
93
93
|
|
|
94
94
|
Binary Distribution reads this settlement and the original publication Passport.
|
|
95
|
-
Tag creation can precede settlement, so it waits at most
|
|
95
|
+
Tag creation can precede settlement, so it waits at most 160 observations, 15 seconds
|
|
96
96
|
apart, for missing evidence. A mismatched source, tag, Passport or receipt fails
|
|
97
97
|
immediately. It no longer requires a legacy `buildchain/release-state/*` ref for v4.
|
|
98
98
|
|
|
@@ -112,6 +112,24 @@ that a pending next-development PR has merged. Inspect the exact PR head, protec
|
|
|
112
112
|
base and merge result independently. A retry of the publication phase must first
|
|
113
113
|
read retained provider facts and resume only missing operations.
|
|
114
114
|
|
|
115
|
+
## Protected stable finalization
|
|
116
|
+
|
|
117
|
+
A successful protected `Verify` on the release branch starts the same floating
|
|
118
|
+
alpha publisher used for prereleases. The publisher creates the stable version
|
|
119
|
+
PR and waits within the original transaction for protected merge and the exact
|
|
120
|
+
merged commit's successful `Verify`, before moving floating tags and completing
|
|
121
|
+
the publication receipt. Generated finalization heads are classified from their
|
|
122
|
+
rooted product state and exact source tag, so their checks do not publish again.
|
|
123
|
+
|
|
124
|
+
The independent version reviewer also handles generated stable finalization PRs.
|
|
125
|
+
It requires the exact protected source parent, the rooted version-state parent,
|
|
126
|
+
the matching immutable stable tag, and byte-for-byte regeneration of the complete
|
|
127
|
+
declared version delta. Verification uses protected source code without approval
|
|
128
|
+
credentials. A separate step approves only the verified head and enables normal
|
|
129
|
+
protected auto-merge. Changed source/base, modified PR contents, requested changes,
|
|
130
|
+
failed final checks, and timeout remain failures. Recover an interrupted run using
|
|
131
|
+
the original source and retained provider evidence; never rewrite published bytes.
|
|
132
|
+
|
|
115
133
|
## Automatic next-development review
|
|
116
134
|
|
|
117
135
|
After stable completion, the producer generates the next patch at `alpha.0`
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { verifyVersionStateDelta } from "./verify-version-state-delta.mjs";
|
|
|
7
7
|
import { readBinaryPublicationEvidence } from "./binary-publication-evidence.mjs";
|
|
8
8
|
import { releaseAssetClient } from "./release-asset-client.mjs";
|
|
9
9
|
import { enqueueNextDevelopmentPullRequest } from "../actions/release-candidate-promote/next-development-queue.js";
|
|
10
|
+
import { FINALIZATION_BRANCH, verifyReleaseFinalization } from "./release-finalization-review.mjs";
|
|
10
11
|
|
|
11
12
|
const REPOSITORY = "kungfu-systems/buildchain";
|
|
12
13
|
const WORKFLOW = ".github/workflows/self-build-verify.yml";
|
|
@@ -26,7 +27,7 @@ export function assertReviewRun(run, { repository, runId, headSha } = {}) {
|
|
|
26
27
|
run.status !== "completed" ||
|
|
27
28
|
run.conclusion !== "success" ||
|
|
28
29
|
!SHA.test(run.head_sha || "") ||
|
|
29
|
-
!BRANCH.test(run.head_branch || "") ||
|
|
30
|
+
!(BRANCH.test(run.head_branch || "") || FINALIZATION_BRANCH.test(run.head_branch || "")) ||
|
|
30
31
|
(headSha && run.head_sha !== headSha)
|
|
31
32
|
)
|
|
32
33
|
throw new Error("unqualified next-development verification run");
|
|
@@ -36,6 +37,9 @@ export function assertReviewPull(
|
|
|
36
37
|
pull,
|
|
37
38
|
{ repository, headSha, baseSha, branch },
|
|
38
39
|
) {
|
|
40
|
+
const finalization = FINALIZATION_BRANCH.exec(branch || "");
|
|
41
|
+
const expectedBase = finalization ? `release/v${finalization[1]}/v${finalization[1]}.${finalization[2]}` :
|
|
42
|
+
`dev/v${BRANCH.exec(branch)?.[1].split(".")[0]}/v${BRANCH.exec(branch)?.[1].split(".").slice(0, 2).join(".")}`;
|
|
39
43
|
if (
|
|
40
44
|
repository !== REPOSITORY ||
|
|
41
45
|
pull.head?.repo?.full_name !== repository ||
|
|
@@ -43,8 +47,8 @@ export function assertReviewPull(
|
|
|
43
47
|
pull.head?.sha !== headSha ||
|
|
44
48
|
pull.base?.sha !== baseSha ||
|
|
45
49
|
pull.head?.ref !== branch ||
|
|
46
|
-
!BRANCH.test(branch || "") ||
|
|
47
|
-
pull.base?.ref !==
|
|
50
|
+
!(BRANCH.test(branch || "") || finalization) ||
|
|
51
|
+
pull.base?.ref !== expectedBase ||
|
|
48
52
|
pull.state !== "open" ||
|
|
49
53
|
pull.draft ||
|
|
50
54
|
pull.merged_at ||
|
|
@@ -107,6 +111,12 @@ export async function verifyNextDevelopmentReview({
|
|
|
107
111
|
publication,
|
|
108
112
|
}) {
|
|
109
113
|
const { run, pull, baseSha } = observe(client, repository, runId);
|
|
114
|
+
if (FINALIZATION_BRANCH.test(run.head_branch)) {
|
|
115
|
+
git("fetch", "--no-tags", "origin", baseSha, run.head_sha);
|
|
116
|
+
const plan = verifyReleaseFinalization({ client, repository, run, pull, baseSha, git });
|
|
117
|
+
observe(client, repository, runId, plan);
|
|
118
|
+
return plan;
|
|
119
|
+
}
|
|
110
120
|
if (git("rev-parse", "HEAD") !== baseSha)
|
|
111
121
|
throw new Error(
|
|
112
122
|
"review runtime is not the exact protected development base",
|
|
@@ -181,7 +191,7 @@ export async function approveNextDevelopment({ client, reviewer, plan }) {
|
|
|
181
191
|
await reviewer.post(endpoint, {
|
|
182
192
|
event: "APPROVE",
|
|
183
193
|
commit_id: plan.headSha,
|
|
184
|
-
body: `Verified the exact version-only transition by regenerating all tracked bytes from protected base ${plan.baseSha}.
|
|
194
|
+
body: `Verified the exact version-only transition by regenerating all tracked bytes from protected base ${plan.baseSha}. Publication binding: ${plan.publicationReceiptRoot || plan.publicationSourceSha}. Verification run: https://github.com/${plan.repository}/actions/runs/${plan.runId}.`,
|
|
185
195
|
});
|
|
186
196
|
}
|
|
187
197
|
observe(client, plan.repository, plan.runId, plan);
|
|
@@ -287,6 +297,15 @@ async function main(mode) {
|
|
|
287
297
|
)
|
|
288
298
|
)
|
|
289
299
|
throw new Error("independent approval no longer qualifies enqueue");
|
|
300
|
+
if (plan.kind === "stable-finalization") {
|
|
301
|
+
// Release branches use protected auto-merge; Dev retains its required merge queue.
|
|
302
|
+
const result = client.post("graphql", {
|
|
303
|
+
query: "mutation($input: EnablePullRequestAutoMergeInput!) { enablePullRequestAutoMerge(input: $input) { pullRequest { id } } }",
|
|
304
|
+
variables: { input: { pullRequestId: pull.node_id, mergeMethod: "MERGE" } },
|
|
305
|
+
});
|
|
306
|
+
if (result.errors?.length) throw new Error(result.errors.map((error) => error.message).join("; "));
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
290
309
|
await enqueueNextDevelopmentPullRequest({
|
|
291
310
|
pull,
|
|
292
311
|
headSha: plan.headSha,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { localVersionFiles } from "../actions/release-candidate-promote/product-provider-adapters.js";
|
|
3
|
+
import { prepareDevelopmentSource } from "../actions/release-candidate-promote/development-source.js";
|
|
4
|
+
|
|
5
|
+
export const FINALIZATION_BRANCH = /^chore\/v4-product-pr\/release-v(\d+)-v\1\.(\d+)\/([a-f0-9]{12})-([a-f0-9]{12})-([a-f0-9]{12})$/u;
|
|
6
|
+
|
|
7
|
+
export function regenerateReleaseFinalization({ baseSha, headSha, version, sourceTimestamp, git }) {
|
|
8
|
+
const source = prepareDevelopmentSource({ cwd: process.cwd(), sourceSha: baseSha });
|
|
9
|
+
try {
|
|
10
|
+
const files = localVersionFiles(source.cwd, { channel: "stable", version, sourceSha: baseSha, sourceTimestamp });
|
|
11
|
+
const allowed = new Map(files.map((file) => [file.path, file.content]));
|
|
12
|
+
const changes = git("diff", "--raw", "--no-renames", baseSha, headSha).split("\n").filter(Boolean);
|
|
13
|
+
if (!changes.length) throw new Error("no stable finalization delta");
|
|
14
|
+
for (const change of changes) {
|
|
15
|
+
const match = change.match(/^:100644 100644 [a-f0-9]+ [a-f0-9]+ M\t(.+)$/u);
|
|
16
|
+
if (!match || !allowed.has(match[1])) throw new Error("undeclared stable finalization delta");
|
|
17
|
+
}
|
|
18
|
+
for (const [file, content] of allowed) {
|
|
19
|
+
const actual = execFileSync("git", ["show", `${headSha}:${file}`], { maxBuffer: 64 * 1024 * 1024 });
|
|
20
|
+
if (!actual.equals(Buffer.from(content))) throw new Error(`stable finalization regeneration mismatch: ${file}`);
|
|
21
|
+
}
|
|
22
|
+
return { version, baseSha, headSha, changedPaths: changes.map((line) => line.split("\t")[1]) };
|
|
23
|
+
} finally {
|
|
24
|
+
source.dispose();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function verifyReleaseFinalization({ client, repository, run, pull, baseSha, git, regenerate = regenerateReleaseFinalization }) {
|
|
29
|
+
const match = FINALIZATION_BRANCH.exec(run.head_branch);
|
|
30
|
+
const parents = git("show", "-s", "--format=%P", run.head_sha).split(" ");
|
|
31
|
+
if (!match || parents.length !== 2 || parents[0] !== baseSha ||
|
|
32
|
+
parents[1].slice(0, 12) !== match[3] || baseSha.slice(0, 12) !== match[4] || run.head_sha.slice(0, 12) !== match[5])
|
|
33
|
+
throw new Error("stable finalization parent or branch identity mismatch");
|
|
34
|
+
const baseVersion = JSON.parse(git("show", `${baseSha}:package.json`)).version;
|
|
35
|
+
const version = JSON.parse(git("show", `${run.head_sha}:package.json`)).version;
|
|
36
|
+
if (!/^\d+\.\d+\.\d+-alpha\.\d+$/u.test(baseVersion) || version !== baseVersion.split("-alpha.")[0] ||
|
|
37
|
+
!version.startsWith(`${match[1]}.${match[2]}.`)) throw new Error("stable finalization is not the exact alpha successor");
|
|
38
|
+
const prefix = `repos/${repository}`;
|
|
39
|
+
const state = client.json(`${prefix}/git/ref/heads/buildchain/v4-product-state/${baseSha}-${version.replaceAll(".", "-")}`);
|
|
40
|
+
const tag = client.json(`${prefix}/git/ref/tags/v${version}`);
|
|
41
|
+
if (state.object?.sha !== parents[1] || tag.object?.type !== "commit" || tag.object?.sha !== baseSha ||
|
|
42
|
+
git("show", "-s", "--format=%P", parents[1]) !== baseSha ||
|
|
43
|
+
git("rev-parse", `${parents[1]}^{tree}`) !== git("rev-parse", `${run.head_sha}^{tree}`))
|
|
44
|
+
throw new Error("stable finalization state or exact publication tag mismatch");
|
|
45
|
+
const source = client.json(`${prefix}/git/commits/${baseSha}`);
|
|
46
|
+
const sourceTimestamp = new Date(source.committer?.date || source.author?.date).toISOString();
|
|
47
|
+
const projection = regenerate({ baseSha, headSha: run.head_sha, version, sourceTimestamp, git });
|
|
48
|
+
return {
|
|
49
|
+
schema: "buildchain.next-development-review/v1", kind: "stable-finalization",
|
|
50
|
+
repository, runId: run.id, number: pull.number, headSha: run.head_sha, baseSha,
|
|
51
|
+
branch: run.head_branch, publicationSourceSha: baseSha, projection,
|
|
52
|
+
};
|
|
53
|
+
}
|