@kungfu-tech/buildchain 4.1.3-alpha.9 → 4.1.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/AGENTS.md +11 -13
  2. package/CONTRIBUTING.md +32 -9
  3. package/README.md +56 -140
  4. package/actions/release/promotion/ref/README.md +1 -1
  5. package/architecture/action-taxonomy.json +1 -1
  6. package/architecture/agent-change-map.md +32 -45
  7. package/architecture/build-orchestration.json +1 -1
  8. package/architecture/capability-state-machine-manifest.json +5 -5
  9. package/architecture/ci-lane-change-budget.json +92 -92
  10. package/architecture/code-layout.json +2 -12
  11. package/architecture/core-mechanisms.json +38 -39
  12. package/architecture/cross-platform-adopter-qualification.json +1 -1
  13. package/architecture/dev-delivery-orchestration.json +2 -2
  14. package/architecture/floating-consumer-policy.json +3 -3
  15. package/architecture/internal-capabilities.json +27 -28
  16. package/architecture/maintainability-debt.json +60 -94
  17. package/architecture/maintainability-policy.json +7 -13
  18. package/architecture/minimal-consumer-migration.json +43 -5014
  19. package/architecture/platform-stage-checkpoints.json +1 -1
  20. package/architecture/release-tail-contract.json +2 -2
  21. package/architecture/release-topology.json +33 -25
  22. package/architecture/stage-capsule-qualification.json +1 -1
  23. package/architecture/universal-workflow-bootstrap.json +60 -60
  24. package/architecture/universal-workflow-capability-policy.json +3 -3
  25. package/architecture/universal-workflow-fault-campaign.json +7 -7
  26. package/architecture/workflow-taxonomy.json +59 -60
  27. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  28. package/dist/site/buildchain-contract.json +138 -66
  29. package/dist/site/buildchain-site.json +257 -331
  30. package/dist/site/capability-registry.json +4 -4
  31. package/dist/site/cli-registry.json +6 -142
  32. package/dist/site/controller-registry.json +19 -19
  33. package/dist/site/kfd-claims.json +481 -529
  34. package/dist/site/kfd-upstream-aggregate.json +1 -1
  35. package/dist/site/manual-registry.json +22 -22
  36. package/dist/site/node-api-registry.json +82 -339
  37. package/dist/site/page-registry.json +229 -304
  38. package/dist/site/public-surface-audit.json +544 -754
  39. package/dist/site/publication-authority-registry.json +316 -316
  40. package/dist/site/publication-registry.json +1 -1
  41. package/dist/site/site-manifest.json +23 -23
  42. package/dist/site/workflow-registry.json +1071 -1027
  43. package/docs/MAP.md +28 -20
  44. package/docs/auditable-demo.md +17 -49
  45. package/docs/bootstrap-recovery.md +46 -37
  46. package/docs/cli-reference.md +2 -46
  47. package/docs/cli.md +97 -186
  48. package/docs/code-organization.md +7 -5
  49. package/docs/dev-alpha-candidate-patrol.md +19 -42
  50. package/docs/dev-delivery-orchestration.md +15 -11
  51. package/docs/dev-delivery-qualification-landing-adr.md +10 -9
  52. package/docs/dev-delivery-warrant.md +17 -16
  53. package/docs/dev-qualification-patrol.md +25 -20
  54. package/docs/getting-started.md +80 -139
  55. package/docs/github-artifact-attestation.md +31 -81
  56. package/docs/install.md +66 -30
  57. package/docs/lifecycle-protocol.md +19 -57
  58. package/docs/migration-inventory.md +17 -45
  59. package/docs/next-development-transition.md +13 -13
  60. package/docs/node-api-reference.md +122 -138
  61. package/docs/oci-publication.md +13 -10
  62. package/docs/publication-artifacts.md +128 -486
  63. package/docs/publication-authority.md +15 -45
  64. package/docs/publish-transaction.md +13 -11
  65. package/docs/release-candidate.md +126 -355
  66. package/docs/release-discussions.md +36 -67
  67. package/docs/release-flow.md +80 -339
  68. package/docs/release-governance.md +114 -962
  69. package/docs/release-promotion-request.md +45 -43
  70. package/docs/release-propagation.md +13 -27
  71. package/docs/release-tail-provider-plane.md +38 -65
  72. package/docs/reusable-build-surface.md +78 -196
  73. package/docs/runtime-train-validation.md +8 -6
  74. package/docs/stable-candidate-patrol.md +13 -66
  75. package/docs/v4-adopter-delivery.md +15 -15
  76. package/docs/v4-declarative-release-tail-migration.md +19 -17
  77. package/docs/v4-production-release.md +11 -6
  78. package/docs/v4-publication-rehearsal.md +12 -27
  79. package/docs/v4-stage-capsule.md +14 -20
  80. package/docs/v4-tail-reseal.md +34 -20
  81. package/docs/web-surface-deployments.md +26 -264
  82. package/docs/workflow-catalog.md +31 -31
  83. package/docs/workflow-path-migration.md +10 -4
  84. package/package.json +5 -4
  85. package/packages/core/adoption/buildchain-kfd-claims.js +7 -7
  86. package/packages/core/adoption/cli/output.mjs +1 -9
  87. package/packages/core/adoption/cli/product-gate.mjs +1 -15
  88. package/packages/core/adoption/cli/project.mjs +9 -10
  89. package/packages/core/adoption/cli/standards.mjs +1 -14
  90. package/packages/core/adoption/cli/support.mjs +0 -2
  91. package/packages/core/adoption/cli/surface-register.mjs +0 -2
  92. package/packages/core/adoption/commands/init-repo.mjs +77 -485
  93. package/packages/core/adoption/consumer-init.js +279 -0
  94. package/packages/core/adoption/qualification/admission.js +1 -1
  95. package/packages/core/build/cli/cache.mjs +0 -2
  96. package/packages/core/build/cli/facts.mjs +0 -3
  97. package/packages/core/build/cli/homebrew.mjs +0 -4
  98. package/packages/core/build/cli/lifecycle.mjs +0 -3
  99. package/packages/core/build/github-artifact-attestation.js +2 -2
  100. package/packages/core/build/platform-stage-checkpoints.js +1 -1
  101. package/packages/core/build/signing/dispatch.js +1 -1
  102. package/packages/core/consumer/buildchain-config.js +9 -0
  103. package/packages/core/consumer/contract/inspection.js +351 -9
  104. package/packages/core/consumer/contract/javascript-syntax.js +439 -0
  105. package/packages/core/consumer/contract/javascript-values.js +61 -0
  106. package/packages/core/consumer/contract/javascript.js +555 -0
  107. package/packages/core/consumer/contract/local-validation.js +84 -0
  108. package/packages/core/contracts/buildchain-contract.js +39 -8
  109. package/packages/core/contracts/cli/introspection.mjs +1 -9
  110. package/packages/core/contracts/public-surface-cli.js +0 -1
  111. package/packages/core/dev-delivery/dev-delivery-contract-surface.js +2 -2
  112. package/packages/core/governance/buildchain-publication-authority.js +24 -24
  113. package/packages/core/governance/cli/doctor.mjs +58 -42
  114. package/packages/core/governance/commands/architecture.mjs +6 -1
  115. package/packages/core/governance/commands/audit-publication-control-plane.mjs +1 -1
  116. package/packages/core/governance/commands/workflow-friction-report.mjs +1 -1
  117. package/packages/core/governance/github-governance-authority.js +2 -2
  118. package/packages/core/governance/publication/collection.js +1 -1
  119. package/packages/core/index.js +1 -3
  120. package/packages/core/observability/cli/candidate.mjs +0 -2
  121. package/packages/core/observability/cli/context.mjs +0 -5
  122. package/packages/core/observability/cli/diagnostics.mjs +0 -7
  123. package/packages/core/observability/cli/events.mjs +2 -10
  124. package/packages/core/paper/commands/paper-work-fleet-cli.mjs +1 -1
  125. package/packages/core/paper/commands/paper.mjs +33 -422
  126. package/packages/core/paper/consumer-status.js +72 -0
  127. package/packages/core/paper/operations/identity.js +0 -3
  128. package/packages/core/paper/operations/migration.js +460 -0
  129. package/packages/core/paper/operations/preflight-checks.js +8 -68
  130. package/packages/core/paper/operations/scaffold.js +16 -326
  131. package/packages/core/paper/operations/status.js +27 -53
  132. package/packages/core/paper/paper-agent-entry.js +36 -147
  133. package/packages/core/paper/paper-fleet.js +24 -39
  134. package/packages/core/paper/paper-repository.js +16 -0
  135. package/packages/core/paper/paper-runtime-channels.js +1 -1
  136. package/packages/core/paper/paper-scaffold-content.js +153 -162
  137. package/packages/core/paper/paper-work.js +3 -10
  138. package/packages/core/paper/paper.js +43 -5
  139. package/packages/core/providers/github/artifact-attestation.js +1 -1
  140. package/packages/core/providers/github/pipeline-context-artifacts.js +172 -0
  141. package/packages/core/providers/github/pipeline-release-evidence.js +17 -98
  142. package/packages/core/providers/github/pipeline-stable-baseline.js +86 -0
  143. package/packages/core/providers/github/pipeline-stable-source.js +22 -4
  144. package/packages/core/providers/github/release-evidence-assets.js +97 -0
  145. package/packages/core/publication/authority/control-plane.js +2 -2
  146. package/packages/core/publication/authority/seal.js +1 -1
  147. package/packages/core/publication/cli/dispatch.mjs +1 -12
  148. package/packages/core/publication/pipeline/actions.js +16 -9
  149. package/packages/core/publication/pipeline/apply.js +17 -9
  150. package/packages/core/publication/pipeline/context.js +29 -0
  151. package/packages/core/publication/pipeline/journal.js +13 -1
  152. package/packages/core/publication/pipeline/prepare.js +15 -6
  153. package/packages/core/publication/pipeline/recovery-import.js +1 -1
  154. package/packages/core/publication/pipeline/recovery-materials.js +63 -1
  155. package/packages/core/publication/pipeline/recovery-prepare.js +21 -9
  156. package/packages/core/publication/pipeline/stable-entry.js +12 -3
  157. package/packages/core/publication/pipeline/stable-products.js +21 -19
  158. package/packages/core/publication/pipeline/version-actions.js +15 -6
  159. package/packages/core/publication/publication-rehearsal-projection.js +0 -9
  160. package/packages/core/release/cli/dispatch.mjs +1 -4
  161. package/packages/core/release/cli/inspection-handlers.mjs +1 -33
  162. package/packages/core/release/cli/release-handlers.mjs +2 -19
  163. package/packages/core/release/cli/verification-handlers.mjs +4 -25
  164. package/packages/core/release/next-development-projection.js +13 -13
  165. package/packages/core/release/passport/locations.js +13 -8
  166. package/packages/core/release/release-passport.js +70 -5
  167. package/packages/core/web/cli/badges.mjs +0 -4
  168. package/packages/core/web/publication-admission.js +1 -1
  169. package/packages/core/web/publication-capability.js +1 -1
  170. package/packages/core/web/readme-badges.js +1 -1
  171. package/packages/core/workflow/cli/main.mjs +1 -4
  172. package/packages/core/workflow/cli/process.mjs +1 -1
  173. package/packages/core/workflow/commands/buildchain-cli-help.mjs +2 -8
  174. package/packages/core/workflow/engine/conformance.js +1 -1
  175. package/packages/core/workflow/pipeline/build.js +21 -1
  176. package/packages/core/workflow/pipeline/delivery-observation.js +6 -2
  177. package/packages/core/workflow/workflow-taxonomy.mjs +61 -17
  178. package/scripts/check-code-layout.mjs +2 -0
  179. package/scripts/check-core-mechanism-inventory.mjs +29 -13
  180. package/scripts/check-floating-consumer-policy-contract.mjs +3 -3
  181. package/scripts/check-inventory.mjs +27 -27
  182. package/scripts/check-maintainability.mjs +28 -5
  183. package/scripts/check-public-dogfood-contract.mjs +3 -3
  184. package/scripts/check-release-topology.mjs +1 -1
  185. package/scripts/check-self-consumer-contract.mjs +7 -7
  186. package/scripts/check-universal-workflow-bootstrap.mjs +1 -1
  187. package/scripts/generate-channel-promotion-workflow.mjs +1 -1
  188. package/scripts/generate-minimal-consumer-contract.mjs +21 -1
  189. package/scripts/generate-site-bundle.mjs +2 -1
  190. package/scripts/generate-tail-reseal-fixture.mjs +3 -3
  191. package/scripts/inventory/promotion.mjs +1 -1
  192. package/scripts/next-development-self-dogfood-harness.mjs +1 -1
  193. package/scripts/next-development-self-dogfood.mjs +4 -4
  194. package/scripts/site-capability-metadata.mjs +2 -6
  195. package/scripts/source-metric-lineage.mjs +62 -7
  196. package/scripts/verify-golden-path.mjs +31 -35
  197. package/templates/native-dev-delivery.yml +1 -1
  198. package/templates/universal-buildchain-bootstrap.yml +1 -1
  199. package/packages/core/paper/operations/bootstrap.js +0 -75
  200. package/packages/core/paper/operations/plans.js +0 -213
  201. package/packages/core/paper/operations/provisioning.js +0 -113
  202. package/packages/core/paper/operations/scaffold-config.js +0 -77
  203. package/packages/core/paper/operations/scaffold-workflows.js +0 -116
  204. package/packages/core/paper/operations/workspace.js +0 -60
  205. package/packages/core/paper/paper-npm-bootstrap.js +0 -492
@@ -1,20 +1,20 @@
1
1
  ---
2
- status: draft
2
+ status: active
3
3
  period: ongoing
4
4
  theme: release-discussion-transactions
5
- doc_type: implementation-contract
6
- source_level: user-consensus
7
- confidence: medium
5
+ doc_type: technical-reference
6
+ source_level: local-files
7
+ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-12
11
+ last_reviewed: 2026-09-20
12
12
  ai_provenance:
13
13
  model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-09-12
16
- visible_context: Release workflow implementation and agreed consumer Discussion transaction model.
17
- invisible_context_boundary: Hosted token qualification and alpha publication are not claimed by this document.
15
+ generated_at: 2026-09-20
16
+ visible_context: Schema-2 consumer contract, pipeline and recovery entries, and internal release implementations.
17
+ invisible_context_boundary: No unobserved hosted publication or external consumer migration is claimed.
18
18
  ---
19
19
 
20
20
  # Release Discussion transactions
@@ -26,29 +26,15 @@ operations receive the exact Discussion ID. Categories have repository-specific
26
26
  IDs. Enable Discussions and retain the Announcements category before executing a
27
27
  release. A preview performs no Discussion reads or writes.
28
28
 
29
- The caller grants `discussions: write` to the reusable workflow job alongside its
30
- existing release permissions. The called workflow uses the consumer's automatic
31
- `GITHUB_TOKEN`. Checking out Buildchain does not change that repository or token.
32
- A reusable workflow cannot elevate the permissions granted by its caller.
33
-
34
- ```yaml
35
- jobs:
36
- release:
37
- permissions:
38
- contents: write
39
- discussions: write
40
- actions: write
41
- id-token: write
42
- uses: kungfu-systems/buildchain/.github/workflows/public-release-promote.yml@v4
43
- with:
44
- request-json: ${{ inputs.request-json }}
45
- runtime-ref: ${{ inputs.runtime-ref || '' }}
46
- ```
29
+ The generated normal and recovery callers declare the required permissions,
30
+ including `discussions: write`. Consumers use the shared caller pair; they do not
31
+ write a separate Discussion workflow or pass transaction envelopes. The runtime
32
+ uses the consumer repository's scoped authority. Checking out Buildchain does not
33
+ change that repository identity, and a reusable workflow cannot elevate its
34
+ caller's permission grant.
47
35
 
48
- This fragment illustrates the additional Discussion permission; retain other
49
- permissions required by the consumer's publication provider. The platform
50
- contracts are documented in GitHub's [reusable workflow reference](https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations)
51
- and [Discussions API guide](https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions).
36
+ See [the minimal consumer contract](getting-started.md) for installation and
37
+ [attempt recovery](bootstrap-recovery.md) for the only manual recovery input.
52
38
 
53
39
  ## Records and concurrency
54
40
 
@@ -152,42 +138,25 @@ same Discussion. It neither rewrites X's records nor changes the release intent.
152
138
  presentation, declared evidence and recovery contracts. `threads.js` checks
153
139
  provider placement; `presentation.js` renders contextual Markdown; `evidence.js`
154
140
  builds bounded attachment descriptors and diagnostic reports. `packages/core/providers/github/discussions` owns GitHub
155
- transport and immutable material IO. The existing public promotion workflow
156
- owns job boundaries; the Rust publication state machine still owns publication
141
+ transport and immutable material IO. Internal pipeline and publication workflows
142
+ own job boundaries; the Rust publication state machine still owns publication
157
143
  decisions and provider-effect ordering.
158
144
 
159
- The public Bootstrap API also exposes the `release-discussion` capability for
160
- consumer transport qualification and read-only diagnosis. Buildchain's existing
161
- Bootstrap dogfood caller accepts this request through its manual
162
- `request-json` input, preserving the same public entry and central
163
- runtime preparation as other consumers.
164
-
165
- ## First publication with a selected runtime
166
-
167
- For Buildchain self-publication, dispatch `self-release-promote.yml` with the exact
168
- protected alpha `sha`, its `target-ref`, `dry-run: "false"`, and the desired
169
- `runtime-ref`. Leave recovery selectors empty for a first publication. The public
170
- publisher still verifies the protected source and obtains fresh hosted admission.
171
- `recover-durable-transaction` is reserved for an existing partial publication;
172
- it is not required merely because the selected runtime differs from the entry.
173
-
174
- ## Resume by Discussion
175
-
176
- Pass `resume-discussion-id` in the public promotion request and select the repaired
177
- train through `runtime-ref`. Keep the protected target ref and source coordinates.
178
- The qualifier restores content-addressed candidate material, verifies original
179
- qualification, then re-observes providers before any remaining publication effect.
180
- Do not combine this selector with candidate-run or transaction-id recovery.
181
-
182
- When standalone binary distribution is requested, the intent also requires the
183
- `binary-distribution` node. Its separate workflow resolves the immutable locator
184
- from the public release, captures the active attempt, and appends provider readback
185
- to that attempt. A result arriving after recovery stays on the older attempt.
186
- The terminal publication receipt remains independently verifiable even while
187
- next-development or binary distribution is incomplete.
188
-
189
- The manual Bootstrap caller inherits the declared repository workflow permissions;
190
- the typed capability request must declare its own subset. `verifyMaterials: true`
191
- on a qualification request additionally tests draft Release asset retention using
192
- `contents: write`. The initial injected failure is intentional and leaves durable
193
- records for a subsequent runtime recovery probe.
145
+ ## First publication and recovery
146
+
147
+ A legal channel PR expresses publication intent. The shared normal pipeline
148
+ qualifies the exact protected source, materializes the version, builds declared
149
+ products and performs publication through internal provider jobs. There is no
150
+ consumer publication request JSON or separate self-release dispatch.
151
+
152
+ For interruption recovery, select the exact attempt in `buildchain-recover.yml`.
153
+ An optional repaired runtime may continue from its immutable records and sealed
154
+ material. The runtime resolves the original Discussion and internal transaction;
155
+ the consumer does not choose replacement Discussion, candidate-run, source or
156
+ transaction coordinates.
157
+
158
+ Publication, binary distribution and next-development have separate evidence.
159
+ A terminal publication receipt does not imply the later required nodes have
160
+ completed. Late provider results remain attached to their original attempt and
161
+ cannot settle a successor. Historical receipts and their retained readers stay
162
+ immutable when the current public entry changes.
@@ -6,378 +6,119 @@ doc_type: technical-reference
6
6
  source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
- evidence_grade: A
9
+ evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-05
11
+ last_reviewed: 2026-09-20
12
12
  ai_provenance:
13
13
  model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-09-05
16
- invisible_context: not asserted
15
+ generated_at: 2026-09-20
16
+ visible_context: Schema-2 consumer contract, pipeline and recovery entries, and internal release implementations.
17
+ invisible_context_boundary: No unobserved hosted publication or external consumer migration is claimed.
17
18
  ---
18
19
 
19
20
  # Release Flow Diagrams
20
21
 
21
- This document describes v4 alpha publication and the legacy v3 release flow.
22
- See [Release governance](release-governance.md) for the design rationale.
22
+ Consumers express intent through a legal channel PR. The generated normal entry
23
+ owns delivery and publication; the generated recovery entry resumes an exact
24
+ attempt. See [Release governance](release-governance.md).
23
25
 
24
26
  ## Architecture
25
27
 
26
28
  ```mermaid
27
29
  flowchart TD
28
- Maintainer["Maintainer opens channel PR"]
29
- Verify["Release - Verify"]
30
- Review["Protected branch review"]
31
- Merge["Merge PR into alpha or release"]
32
- Promotion["Buildchain Ref Promotion"]
33
- StableDecision{"Release channel?"}
34
- StableGate["Stable only: exact-alpha canaries + soak + cooldown"]
35
- Action["promote-buildchain-ref action"]
36
- VersionState["Version-state commit"]
37
- ExactTag["Exact tag"]
38
- FloatingRefs["Floating tags and channel branches"]
39
- Consumers["Consumers pin stable or exact refs"]
40
-
41
- Maintainer --> Verify
42
- Verify --> Review
43
- Review --> Merge
44
- Merge --> Promotion
45
- Promotion --> StableDecision
46
- StableDecision -->|yes| StableGate
47
- StableDecision -->|no: alpha| Action
48
- StableGate --> Action
49
- Action --> VersionState
50
- Action --> ExactTag
51
- Action --> FloatingRefs
52
- ExactTag --> Consumers
53
- FloatingRefs --> Consumers
30
+ PR[Legal channel PR] --> Pipeline[Shared normal pipeline]
31
+ Pipeline --> Source[Exact source and product qualification]
32
+ Source --> Review[Independent review and protected merge queue]
33
+ Review --> Develop{Channel operation}
34
+ Develop -->|develop| Land[Protected development delivery]
35
+ Develop -->|alpha, stable or major| Version[Qualified version material]
36
+ Version --> Publish[Internal provider publication]
37
+ Publish --> Readback[Exact tags, package integrity and asset readback]
38
+ Readback --> Followup[Required distribution and next-development]
39
+ Followup --> Terminal[Verified terminal attempt]
40
+ Land --> Terminal
41
+ Recovery[Exact attempt recovery] --> Retained[Original source, records and sealed material]
42
+ Retained --> Remaining[Read providers and continue remaining work]
43
+ Remaining --> Terminal
54
44
  ```
55
45
 
56
- Buildchain treats the PR merge as release intent and the promotion action as the
57
- only component allowed to turn that intent into release refs.
58
-
59
- `StableGate` applies only to Buildchain's release channel. Alpha and train
60
- iteration bypass it. See [Stable Release Throttle And Canary Gate](release-governance.md#stable-release-throttle-and-canary-gate)
61
- for the versioned policy and evidence contract.
46
+ This is an ownership diagram; exact stage dependencies belong to the runtime.
47
+ The consumer does not dispatch each node or pass state between them. Product
48
+ commands and artifact declarations are in TOML; provider effects and receipts
49
+ are internal.
62
50
 
63
51
  ## Ref State
64
52
 
65
- | Ref kind | Example | Mutability | Purpose |
66
- | --- | --- | --- | --- |
67
- | Development branch | `dev/v4/v4.0` | moves | next source state for a minor line |
68
- | Alpha branch | `alpha/v4/v4.0` | moves | latest test state for a minor line |
69
- | Release branch | `release/v4/v4.0` | moves | latest production state for a minor line |
70
- | Major gate branch | `publish-gate/major` | moves | reviewed administrator gate for publishing the next major |
71
- | Exact alpha tag | `v4.0.3-alpha.0` | immutable | audit ref for one tested prerelease |
72
- | Exact release tag | `v4.0.2` | immutable | audit ref for one production release |
73
- | Floating alpha tag | `v4.0-alpha` | moves | latest test channel for a minor line |
74
- | Floating major alpha tag | `v4-alpha` | moves | latest test channel on the highest published alpha minor for a major line |
75
- | Floating minor tag | `v4.0` | moves | latest production patch on a minor line |
76
- | Floating major tag | `v4` | moves | selected stable major entrypoint |
77
-
78
- ## Ref Protection Contract
79
-
80
- Repository rulesets must distinguish immutable evidence refs from mutable
81
- channel refs.
82
-
83
- Protect exact release and alpha tags as immutable evidence:
84
-
85
- ```text
86
- refs/tags/v*.*.*
87
- ```
88
-
89
- Do not apply immutable-tag rulesets to every `refs/tags/v*` ref. Buildchain
90
- must be able to update floating channel tags such as `v4`, `v4.0`, `v4.0-alpha`,
91
- and `v4-alpha` after the exact tag and publish evidence are valid. A ruleset that
92
- matches all `v*` tags also matches floating tags, so release finalization can
93
- fail with GitHub protected-ref errors even though the exact release tag and
94
- published artifacts are already durable.
95
-
96
- The intended governance split is:
97
-
98
- - exact tags such as `v4.0.2` and `v4.0.3-alpha.0` are immutable audit refs;
99
- - for publish transactions, the exact tag points to the transaction
100
- `source_sha`, matching package-registry source metadata such as npm
101
- `gitHead`; generated version-state commits remain on protected branches and
102
- floating channel refs;
103
- - floating tags such as `v4`, `v4.0`, `v4.0-alpha`, and `v4-alpha` are mutable channel refs
104
- owned by the Buildchain promotion token;
105
- - protected branches still require reviewed channel PRs before Buildchain can
106
- move any exact or floating release refs.
107
-
108
- ## Opening a Minor Line
109
-
110
- New minor lines should be opened through Buildchain instead of hand-created
111
- branches. The reusable entrypoint is the `Release Line Bootstrap` workflow. It
112
- defaults to dry-run so maintainers can inspect the planned refs, protection
113
- contract, initial version, and first alpha PR before any mutation.
114
-
115
- The workflow is backed by the CLI command:
116
-
117
- ```bash
118
- buildchain release line open \
119
- --major 4 \
120
- --minor 1 \
121
- --source-ref release/v4/v4.0 \
122
- --json
123
- ```
124
-
125
- When the workflow is run with `apply=true`, Buildchain:
126
-
127
- - writes the initial version-state commit, such as `4.1.0-alpha.0`;
128
- - creates `dev/v4/v4.1` from that commit;
129
- - creates `alpha/v4/v4.1` and `release/v4/v4.1` from the selected source ref;
130
- - applies branch protection with one approving review and the configured
131
- required status check; dev starts strict, while alpha and release also require
132
- the pair-specific `verify` aggregate without a source-up-to-date ancestry loop;
133
- - reconciles the new dev branch's explicitly declared merge queue, or inherits
134
- the exact queue parameters and bypass actors from the current default dev
135
- branch when the policy is `inherit` or absent;
136
- - switches the repository default branch to the new dev line when requested;
137
- - opens the first `dev/v4/v4.1 -> alpha/v4/v4.1` channel PR when requested.
138
-
139
- This makes minor-line creation a single audited operation. The channel PR still
140
- goes through the normal verify/review/promotion path before an alpha is
141
- published. Queue reconciliation runs after branch protection and before the
142
- default-branch switch, so a failed governance apply leaves the old active line
143
- in place and the idempotently created new refs can be retried.
144
-
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
160
-
161
- ```mermaid
162
- sequenceDiagram
163
- participant Dev as dev/vX/vX.Y
164
- participant PR as PR dev -> alpha
165
- participant Verify as Release - Verify
166
- participant Alpha as alpha/vX/vX.Y
167
- participant Promote as Buildchain Ref Promotion
168
- participant Tags as Tags
169
-
170
- Dev->>PR: open channel PR
171
- PR->>Verify: run verification checks
172
- Verify-->>PR: check succeeds
173
- PR->>Alpha: reviewed merge
174
- Alpha->>Promote: Verify workflow_run completed
175
- Promote->>Promote: validate same-repo merged PR
176
- Promote->>Promote: compute next vX.Y.Z-alpha.N
177
- Promote->>Promote: write and verify version state
178
- Promote->>Tags: create or reuse vX.Y.Z-alpha.N
179
- Promote->>Tags: move vX.Y-alpha
180
- Promote->>Tags: move vX-alpha when X.Y is the highest published alpha minor
181
- Promote->>Alpha: move alpha/vX/vX.Y
182
- Promote->>Dev: move dev/vX/vX.Y
183
- ```
184
-
185
- Result:
186
-
187
- ```text
188
- vX.Y.Z-alpha.N
189
- vX.Y-alpha
190
- vX-alpha when X.Y is the highest published alpha minor
191
- alpha/vX/vX.Y
192
- dev/vX/vX.Y
193
- ```
194
-
195
- all point at the generated alpha version-state commit.
196
-
197
- ## Legacy V3 Release Promotion
198
-
199
- ```mermaid
200
- sequenceDiagram
201
- participant Alpha as alpha/vX/vX.Y
202
- participant PR as PR alpha -> release
203
- participant Verify as Release - Verify
204
- participant Release as release/vX/vX.Y
205
- participant Promote as Buildchain Ref Promotion
206
- participant Tags as Tags
207
- participant Dev as dev/vX/vX.Y
208
-
209
- Alpha->>PR: open channel PR
210
- PR->>Verify: run verification checks
211
- Verify-->>PR: check succeeds
212
- PR->>Release: reviewed merge
213
- Release->>Promote: Verify workflow_run completed
214
- Promote->>Promote: validate same-repo merged PR
215
- Promote->>Promote: find same-patch alpha tag
216
- Promote->>Promote: compare release tree with tested alpha tree
217
- Promote->>Promote: write final version state or verify anchored material
218
- Promote->>Tags: create or reuse vX.Y.Z
219
- Promote->>Tags: move vX.Y
220
- Promote->>Tags: move vX when eligible
221
- Promote->>Release: move release/vX/vX.Y
222
- Promote->>Promote: prepare vX.Y.(Z+1)-alpha.0
223
- Promote->>Tags: create or reuse vX.Y.(Z+1)-alpha.0
224
- Promote->>Tags: move vX.Y-alpha
225
- Promote->>Tags: move vX-alpha when X.Y is the highest published alpha minor
226
- Promote->>Alpha: move alpha/vX/vX.Y
227
- Promote->>Dev: move dev/vX/vX.Y
228
- ```
229
-
230
- Result:
231
-
232
- ```text
233
- vX.Y.Z
234
- vX.Y
235
- vX
236
- release/vX/vX.Y
237
- ```
238
-
239
- point at the production version-state commit, while:
240
-
241
- ```text
242
- vX.Y.(Z+1)-alpha.0
243
- vX.Y-alpha
244
- vX-alpha when X.Y is the highest published alpha minor
245
- alpha/vX/vX.Y
246
- dev/vX/vX.Y
247
- ```
248
-
249
- point at the next alpha version-state commit.
250
-
251
- ## Legacy V3 State Machine
252
-
253
- ```mermaid
254
- stateDiagram-v2
255
- [*] --> Development: work lands on dev/vX/vX.Y
256
- Development --> AlphaCandidate: PR dev -> alpha
257
- AlphaCandidate --> AlphaPublished: Verify + review + merge + promotion
258
- AlphaPublished --> ReleaseCandidate: PR alpha -> release
259
- ReleaseCandidate --> ProductionPublished: Verify + review + merge + promotion
260
- ProductionPublished --> NextAlphaPrepared: prepare vX.Y.(Z+1)-alpha.0
261
- NextAlphaPrepared --> Development: dev and alpha refs move to next alpha
262
- ```
53
+ | Ref kind | Example | Purpose |
54
+ | --- | --- | --- |
55
+ | Development branch | `dev/v4/v4.1` | reviewed source for the minor line |
56
+ | Alpha branch | `alpha/v4/v4.1` | prerelease channel |
57
+ | Release branch | `release/v4/v4.1` | stable channel |
58
+ | Major gate branch | `publish-gate/major` | reviewed next-major intent |
59
+ | Exact alpha tag | `v4.1.4-alpha.1` | immutable prerelease identity |
60
+ | Exact stable tag | `v4.1.3` | immutable stable identity |
61
+ | Floating alpha refs | `v4.1-alpha`, `v4-alpha` | published prerelease channel |
62
+ | Floating stable refs | `v4.1`, `v4` | published stable channel |
263
63
 
264
- The same minor line can loop through this state machine many times.
64
+ Examples illustrate ref shapes, not current provider observations. Tool-maintained
65
+ locks bind qualified runtime identities separately from the source being built.
265
66
 
266
- ## Legacy V3 Version Examples
267
-
268
- Assume `v3.0.2-alpha.1` has been tested and a maintainer merges
269
- `alpha/v3/v3.0 -> release/v3/v3.0`.
67
+ ## Ref Protection Contract
270
68
 
271
- Buildchain should produce:
69
+ Exact release and alpha tags are immutable evidence. Mutable channel refs must
70
+ remain distinguishable from exact tags in repository rules. A blanket immutable
71
+ rule matching every `v*` tag would also prevent intended floating-channel updates.
272
72
 
273
- ```text
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
278
- ```
73
+ Protected branch movement remains subject to declared reviews and checks.
74
+ Publication authority validates the recorded source/material identity before
75
+ creating or advancing refs. An already-published immutable ref or asset cannot
76
+ be overwritten to make a new attempt appear successful.
279
77
 
280
- It should also prepare:
78
+ ## Alpha and stable publication
281
79
 
282
- ```text
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
288
- ```
80
+ A development-to-alpha PR requests a fresh prerelease. An alpha-to-release PR
81
+ requests stable publication. The selected runtime qualifies the source,
82
+ materializes the version and publishes the declared products. Stable additionally
83
+ checks its version-bound policy and published-entry evidence before publication.
84
+ Buildchain's current minimum interval and soak are zero; see the
85
+ [Stable Release Evidence Gate](release-governance.md#stable-release-evidence-gate).
289
86
 
290
- This is expected behavior. A production release closes one patch and opens the
291
- next test patch on the same minor line.
87
+ Next-development is a follow-up with its own evidence. Stable completion prepares
88
+ the next patch at `alpha.0` from the current protected development source without
89
+ losing concurrent changes. Its [contract](next-development-transition.md) owns
90
+ retry, source preservation and protected landing.
292
91
 
293
92
  ## Major Gate Promotion
294
93
 
295
- ```mermaid
296
- sequenceDiagram
297
- participant Release as release/vX/vX.Y
298
- participant PR as PR release -> publish-gate/major
299
- participant Verify as Release - Verify
300
- participant Gate as publish-gate/major
301
- participant Promote as Buildchain Ref Promotion
302
- participant Tags as Tags
303
- participant Next as dev/alpha/release v(X+1).0
304
-
305
- Release->>PR: open administrator PR
306
- PR->>Verify: run verification checks
307
- Verify-->>PR: check succeeds
308
- PR->>Gate: reviewed merge
309
- Gate->>Promote: Verify workflow_run completed
310
- Promote->>Promote: validate same-repo release -> publish-gate/major PR
311
- Promote->>Promote: write v(X+1).0.0 version state
312
- Promote->>Tags: create v(X+1).0.0
313
- Promote->>Tags: move v(X+1).0 and v(X+1)
314
- Promote->>Gate: move publish-gate/major to v(X+1).0.0
315
- Promote->>Next: move release/v(X+1)/v(X+1).0 to v(X+1).0.0
316
- Promote->>Promote: prepare v(X+1).0.1-alpha.0
317
- Promote->>Next: move alpha/dev v(X+1).0 to next alpha
318
- ```
319
-
320
- `publish-gate/major` is intentionally not an active source branch. It is the PR
321
- target for the administrator's "publish the next major" decision. The older
322
- `major-gate` name is a compatibility alias only.
94
+ `release/vX/vX.Y -> publish-gate/major` expresses the next-major decision through
95
+ the same reviewable PR interface. It does not add a consumer workflow, manual
96
+ provider command or separate product-specific publish controller.
323
97
 
324
98
  ## Failure Boundaries
325
99
 
326
- Promotion should stop before moving refs when:
327
-
328
- - the run is a non-dry-run manual dispatch;
329
- - the expected same-repository PR cannot be found;
330
- - the PR was not merged;
331
- - the branch pair is not a valid channel path;
332
- - the required status check did not pass;
333
- - a release tree does not match the same-patch alpha tag tree, except for the
334
- declared anchored/manual version files and anchor manifest that
335
- `lifecycle.verify` or `verification-command` validates;
336
- - version-state verification fails;
337
- - a required exact tag already exists at a commit unrelated to the active
338
- transaction or finalized channel head.
339
-
340
- These failures are intentional. They protect consumers from refs that look
341
- released but do not have a complete evidence chain.
100
+ Missing or stale source authority, failed product verification, missing review,
101
+ invalid branch pairs, ambiguous provider state and immutable collisions block
102
+ the affected stage. Recovery uses the exact attempt and retained material.
103
+ An optional repaired runtime changes execution implementation, not historical
104
+ source, already-published bytes or receipt ownership.
342
105
 
343
- During transaction finalization recovery, the current channel head may be a
344
- generated version-state merge commit. Buildchain validates that the durable
345
- transaction version, exact tag, evidence, and release material match, and that
346
- the current target ref contains or corresponds to the recorded
347
- `release_material_sha`. It must then tolerate exact tags, dev refs, or alpha
348
- refs that have already moved and continue filling any missing floating tags
349
- before writing the transaction state as `complete`.
106
+ The two public entries do not expose Discussion/run/transaction selector
107
+ combinations. A new version is a new publication. Old failed versions can remain
108
+ historical without being repaired or republished.
350
109
 
351
110
  ## What each verification proves
352
111
 
353
- | Evidence | Meaning and reuse boundary |
112
+ | Evidence | Meaning |
354
113
  | --- | --- |
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: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.
114
+ | Local repository checks | source tests and generated consistency for the checked worktree |
115
+ | Hosted source/platform qualification | exact source/runtime and required platform results |
116
+ | Independent review and merge queue | protected landing of the admitted candidate |
117
+ | Version material verification | declared version material agrees with its qualified source |
118
+ | Provider readback | actual package, tags and Release assets agree with publication evidence |
119
+ | Follow-up receipts | required distribution and next-development outcomes |
120
+ | Terminal attempt | all required stages have verified terminal evidence |
121
+
122
+ No earlier row substitutes for a later one. Reused proof must retain its original
123
+ source and execution identity; a projection must not claim it reran a build.
124
+ See [release discussions](release-discussions.md) for immutable attempt records.