@kungfu-tech/buildchain 4.1.3 → 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 (199) 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 +31 -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/publication/authority/control-plane.js +2 -2
  142. package/packages/core/publication/authority/seal.js +1 -1
  143. package/packages/core/publication/cli/dispatch.mjs +1 -12
  144. package/packages/core/publication/pipeline/actions.js +16 -9
  145. package/packages/core/publication/pipeline/apply.js +17 -9
  146. package/packages/core/publication/pipeline/context.js +29 -0
  147. package/packages/core/publication/pipeline/prepare.js +15 -6
  148. package/packages/core/publication/pipeline/recovery-materials.js +63 -1
  149. package/packages/core/publication/pipeline/recovery-prepare.js +21 -9
  150. package/packages/core/publication/pipeline/stable-entry.js +12 -7
  151. package/packages/core/publication/pipeline/stable-products.js +21 -19
  152. package/packages/core/publication/pipeline/version-actions.js +15 -6
  153. package/packages/core/publication/publication-rehearsal-projection.js +0 -9
  154. package/packages/core/release/cli/dispatch.mjs +1 -4
  155. package/packages/core/release/cli/inspection-handlers.mjs +1 -33
  156. package/packages/core/release/cli/release-handlers.mjs +2 -19
  157. package/packages/core/release/cli/verification-handlers.mjs +4 -25
  158. package/packages/core/release/next-development-projection.js +13 -13
  159. package/packages/core/release/passport/locations.js +13 -8
  160. package/packages/core/release/release-passport.js +70 -5
  161. package/packages/core/web/cli/badges.mjs +0 -4
  162. package/packages/core/web/publication-admission.js +1 -1
  163. package/packages/core/web/publication-capability.js +1 -1
  164. package/packages/core/web/readme-badges.js +1 -1
  165. package/packages/core/workflow/cli/main.mjs +1 -4
  166. package/packages/core/workflow/cli/process.mjs +1 -1
  167. package/packages/core/workflow/commands/buildchain-cli-help.mjs +2 -8
  168. package/packages/core/workflow/engine/conformance.js +1 -1
  169. package/packages/core/workflow/pipeline/build.js +21 -1
  170. package/packages/core/workflow/pipeline/delivery-observation.js +6 -2
  171. package/packages/core/workflow/workflow-taxonomy.mjs +61 -17
  172. package/scripts/check-code-layout.mjs +2 -0
  173. package/scripts/check-core-mechanism-inventory.mjs +29 -13
  174. package/scripts/check-floating-consumer-policy-contract.mjs +3 -3
  175. package/scripts/check-inventory.mjs +27 -27
  176. package/scripts/check-maintainability.mjs +28 -5
  177. package/scripts/check-public-dogfood-contract.mjs +3 -3
  178. package/scripts/check-release-topology.mjs +1 -1
  179. package/scripts/check-self-consumer-contract.mjs +7 -7
  180. package/scripts/check-universal-workflow-bootstrap.mjs +1 -1
  181. package/scripts/generate-channel-promotion-workflow.mjs +1 -1
  182. package/scripts/generate-minimal-consumer-contract.mjs +21 -1
  183. package/scripts/generate-site-bundle.mjs +2 -1
  184. package/scripts/generate-tail-reseal-fixture.mjs +3 -3
  185. package/scripts/inventory/promotion.mjs +1 -1
  186. package/scripts/next-development-self-dogfood-harness.mjs +1 -1
  187. package/scripts/next-development-self-dogfood.mjs +4 -4
  188. package/scripts/site-capability-metadata.mjs +2 -6
  189. package/scripts/source-metric-lineage.mjs +62 -7
  190. package/scripts/verify-golden-path.mjs +31 -35
  191. package/templates/native-dev-delivery.yml +1 -1
  192. package/templates/universal-buildchain-bootstrap.yml +1 -1
  193. package/packages/core/paper/operations/bootstrap.js +0 -75
  194. package/packages/core/paper/operations/plans.js +0 -213
  195. package/packages/core/paper/operations/provisioning.js +0 -113
  196. package/packages/core/paper/operations/scaffold-config.js +0 -77
  197. package/packages/core/paper/operations/scaffold-workflows.js +0 -116
  198. package/packages/core/paper/operations/workspace.js +0 -60
  199. package/packages/core/paper/paper-npm-bootstrap.js +0 -492
@@ -1,57 +1,59 @@
1
1
  ---
2
2
  status: draft
3
3
  period: ongoing
4
- theme: release-promotion-api
5
- doc_type: manual
4
+ theme: internal-release-promotion-request
5
+ doc_type: technical-reference
6
6
  source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-11
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-09
16
- visible_context: Current promotion workflows, JSON schemas, request binding implementation and focused tests.
17
- invisible_context_boundary: No alpha publication or production promotion was performed.
15
+ generated_at: 2026-09-20
16
+ visible_context: Current workflow taxonomy, shared consumer entries, internal promotion components and request schemas.
17
+ invisible_context_boundary: This source documentation does not claim a new hosted publication or external consumer migration.
18
18
  ---
19
19
 
20
- # Release promotion request
21
-
22
- `public-release-promote.yml` is the public API. Its single `request-json` input
23
- uses [`promotion-request-v1.schema.json`](../contracts/promotion-request-v1.schema.json).
24
- The schema owns field types and defaults. Unknown fields, stringified booleans,
25
- historical command hooks and caller-supplied internal authority fields are rejected.
26
-
27
- ```yaml
28
- jobs:
29
- promote:
30
- uses: kungfu-systems/buildchain/.github/workflows/public-release-promote.yml@v4-alpha
31
- with:
32
- request-json: |
33
- {
34
- "schema": "buildchain.promotion-request/v1",
35
- "target-ref": "alpha/v4/v4.1",
36
- "target-sha": ${{ toJSON(github.sha) }},
37
- "dry-run": true
38
- }
39
- secrets: inherit
40
- ```
41
-
42
- Serialize dynamic values with `toJSON` so quotes, newlines, numbers and booleans
43
- retain their original meaning. Permissions remain an explicit caller responsibility;
44
- an input cannot grant a job credentials or provider authority.
45
-
46
- The public workflow selects one runtime through the central runtime entry, admits
47
- the consumer source and constructs the internal
20
+ # Internal release promotion request
21
+
22
+ Consumers declare products and legal channel routes in
23
+ `.buildchain/buildchain.toml`. The generated `buildchain.yml` caller invokes
24
+ `public-ops-pipeline.yml`; a channel PR expresses release intent. Consumers do
25
+ not construct a promotion request or add a promotion workflow. See the
26
+ [Golden Path](getting-started.md) for the shared normal and recovery entries.
27
+
28
+ ## Internal schemas and components
29
+
30
+ The advanced promotion implementation retains
31
+ [`.release-candidate-promote.yml`](../.github/workflows/.release-candidate-promote.yml)
32
+ and [`.release-promote.yml`](../.github/workflows/.release-promote.yml) as
33
+ internal components. Their `request-json` transport is an implementation
34
+ boundary, not a consumer configuration extension.
35
+
36
+ [`promotion-request-v1.schema.json`](../contracts/promotion-request-v1.schema.json)
37
+ owns the internal request field types and defaults. Unknown fields,
38
+ stringified booleans, historical command hooks and unadmitted authority fields
39
+ are rejected. The request binder constructs a normalized
48
40
  [`promotion-invocation-v1.schema.json`](../contracts/promotion-invocation-v1.schema.json)
49
- document. QUALIFY, APPLY and SETTLE prepare that selected runtime and retain their
50
- separate job permissions. Later nodes validate source, artifact and publication
51
- evidence without comparing Buildchain SHAs.
52
-
53
- Buildchain dogfood and external consumers use the same `@v4` or `@v4-alpha`
54
- public entry. The entry commit owns the API shell; the selected runtime owns
55
- business actions, modules and resources. A transient `runtime-ref` can select a
56
- repaired train while preserving the original publication source and evidence.
57
- See [Runtime entry](runtime-entry.md) for selection precedence and recovery.
41
+ document. QUALIFY, APPLY and SETTLE retain separate jobs and permissions.
42
+ These internals must not be copied into consumer YAML, TOML, or helper scripts.
43
+
44
+ ## Runtime and recovery
45
+
46
+ The public entry resolves one runtime. Its business jobs use that selected
47
+ runtime while retaining exact source, artifact and publication evidence.
48
+ Buildchain self consumption uses the same generated caller pair and runtime
49
+ selection contract as other repositories.
50
+
51
+ Recovery goes through `buildchain-recover.yml`, which calls
52
+ `public-ops-recover.yml`. The caller supplies the exact attempt and, only when
53
+ needed, a transient repaired runtime. The retained attempt owns source,
54
+ artifacts, transaction and provider effects; recovery inputs cannot replace
55
+ those identities. See [Runtime entry](runtime-entry.md).
56
+
57
+ The retired `public-release-promote.yml` path is not an alias in the current
58
+ contract. Historical receipts and published bytes keep their original paths;
59
+ new consumers use the shared pipeline entry after its published qualification.
@@ -8,16 +8,21 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-11
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-09
15
+ generated_at: 2026-09-20
16
16
  invisible_context: not asserted
17
17
  ---
18
18
 
19
19
  # Release Propagation
20
20
 
21
+ This page documents internal propagation and native Work contracts. Propagation
22
+ is not an extra public reusable workflow in the minimal consumer contract. A
23
+ consumer does not pass graphs, release envelopes or downstream controller commands
24
+ through its normal/recovery YAML pair.
25
+
21
26
  Release propagation lets a finalized upstream release open a downstream update
22
27
  PR using the upstream release passport as the audit source. It is for product
23
28
  chains such as:
@@ -485,32 +490,13 @@ observed non-zero bytes, exact deployed Git revision, and matching release and
485
490
  artifact digests. The final receipt binds the accepted Work Control Decision
486
491
  root.
487
492
 
488
- ## Reusable Workflow
489
-
490
- Upstream repositories can call
491
- `.github/workflows/public-release-propagation.yml@v4-alpha` after release finalization:
493
+ ## Internal workflow
492
494
 
493
- ```yaml
494
- jobs:
495
- propagate-site:
496
- uses: kungfu-systems/buildchain/.github/workflows/public-release-propagation.yml@v4-alpha
497
- with:
498
- agent-work-mode: capture-only
499
- graph-json: ${{ needs.release.outputs.propagation-graph-json }}
500
- upstream-release-json: ${{ needs.release.outputs.upstream-release-json }}
501
- downstream-target: site-libkungfu-dev
502
- downstream-repository: kungfu-systems/site-libkungfu-dev
503
- downstream-base-ref: dev/v2/v2.7
504
- downstream-update-command: >-
505
- node scripts/paper-propagation.cjs consume
506
- --lock "$BUILDCHAIN_PROPAGATION_LOCK_PATH"
507
- && corepack pnpm install --lockfile-only --ignore-scripts
508
- downstream-prepare-command: pnpm install --frozen-lockfile --ignore-scripts
509
- downstream-verify-command: pnpm run check
510
- dry-run: true
511
- secrets:
512
- propagation-token: ${{ secrets.BUILDCHAIN_PROMOTION_TOKEN }}
513
- ```
495
+ `.release-propagation.yml` is an internal component. Its graph, upstream release
496
+ and downstream Work coordinates are derived and admitted inside the runtime.
497
+ The former standalone public caller and arbitrary consumer update-command
498
+ example are retired. The following source, push and evidence invariants still
499
+ apply to the internal controller.
514
500
 
515
501
  Execution uses the native Work's exact downstream repository, base revision and
516
502
  branch. Push planning verifies that the base has not advanced and is an ancestor
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  status: draft
3
- period: 2026-08-07
3
+ period: ongoing
4
4
  theme: buildchain-release-tail-provider-plane
5
5
  doc_type: architecture
6
6
  source_level: local-files
@@ -8,64 +8,43 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-11
11
+ last_reviewed: 2026-09-20
12
12
  ai_provenance:
13
- model_family: GPT-5
13
+ model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-08-07
15
+ generated_at: 2026-09-20
16
16
  visible_context: Buildchain release-tail declaration, provider adapters, durable transaction implementation, CLI, Action, reusable workflow, tests, and frozen consumer inventory.
17
17
  invisible_context_boundary: Did not read credentials, private provider state, signed URLs, unpublished release assets, or production receipts.
18
18
  ---
19
19
 
20
20
  # Declarative release-tail provider plane
21
21
 
22
- Buildchain owns the final release tail as one versioned transaction. A consumer
23
- supplies a sealed capability declaration and data-only provider bindings; it
24
- does not supply shell, JavaScript, executable paths, callbacks, or plugins.
25
- The frozen boundary and migration inventory remain in
26
- [`release-tail-contract.md`](./release-tail-contract.md).
27
-
28
- ## Public entry points
29
-
30
- - Node: `@kungfu-tech/buildchain/release-tail-provider-plane`,
31
- `release-tail-provider-adapters`, and `release-tail-compatibility`.
32
- - CLI: `buildchain release-tail plan|init|status|verify|compat`.
33
- - Action: `kungfu-systems/buildchain/actions/release/tail/settle@<exact-ref>`.
34
- - reusable workflow: `kungfu-systems/buildchain/.github/workflows/public-release-tail.yml@<exact-ref>`.
35
-
36
- The Action is the provider-executing entry point. The CLI compiles, initializes,
37
- inspects, verifies, and diagnoses bounded v3 compatibility using the same core
38
- transaction format. The reusable workflow checks out an exact Buildchain ref
39
- and invokes the packaged Action; callers cannot inject an execution command.
40
-
41
- The reusable workflow is permission-neutral: it inherits the calling job's
42
- GitHub token permissions and never elevates them. A rehearsal caller can remain
43
- `contents: read` and must pass `execute: false`. An effectful production caller
44
- owns and declares its provider authority explicitly:
45
-
46
- <!-- release-tail-production-caller-contract -->
47
-
48
- ```yaml
49
- name: Production release tail
50
-
51
- on:
52
- workflow_dispatch:
53
-
54
- jobs:
55
- release-tail:
56
- permissions:
57
- contents: write
58
- uses: kungfu-systems/buildchain/.github/workflows/public-release-tail.yml@v4
59
- with:
60
- declaration-path: .buildchain/release-tail/declaration.json
61
- provider-bindings-path: .buildchain/release-tail/provider-bindings.json
62
- execute: true
63
- ```
22
+ Buildchain owns release effects and their readback. Consumers declare product
23
+ artifacts and publication targets in schema-2 TOML, then use the shared normal
24
+ and exact-attempt recovery callers. They do not maintain release-tail provider
25
+ bindings, transaction payloads, state artifacts or additional workflows.
26
+
27
+ ## Consumer entry points
28
+
29
+ - `buildchain.yml` invokes `public-ops-pipeline.yml@v4`.
30
+ - `buildchain-recover.yml` invokes `public-ops-recover.yml@v4`.
31
+
32
+ Generate both through [init](getting-started.md). Request publication through a
33
+ protected channel PR; recover an interrupted operation by its exact attempt.
34
+ The runtime owns source, artifact and provider-effect selection.
64
35
 
65
- Omitting caller write authority cannot be repaired by the reusable workflow;
66
- GitHub rejects or constrains the call before provider execution. `execute:
67
- false` remains a plan/rehearsal boundary and does not authorize production
68
- mutation even when a caller token has broader ambient permissions.
36
+ ## Internal provider implementation
37
+
38
+ The Node modules `release-tail-provider-plane` and `release-tail-provider-adapters`,
39
+ the `release-tail` diagnostic CLI, `actions/release/tail/settle`, and the internal
40
+ `.release-tail.yml` workflow implement and inspect bounded release transactions.
41
+ They are maintenance interfaces, not additional consumer wiring.
42
+
43
+ The internal reusable workflow is permission-neutral. Its owning runtime job
44
+ supplies explicit provider permissions, while rehearsal runs retain read-only
45
+ permissions and no production execution authority. A rehearsal or simulation
46
+ result cannot authorize publication. Provider credentials remain separate from
47
+ consumer commands and serialized transaction data.
69
48
 
70
49
  ## Inputs and secrets
71
50
 
@@ -117,18 +96,12 @@ resume boundary and evidence source, not a disposable log.
117
96
 
118
97
  ## Buildchain self-promotion route
119
98
 
120
- Buildchain invokes `./.github/workflows/public-release-promote.yml` at the same
121
- commit as its caller. Admission independently verifies the defining repository,
122
- exact committed workflow bytes and both consumer lock roots. External consumers
123
- use the public floating-channel API after publication. See
124
- [Promotion request](release-promotion-request.md).
125
-
126
- The promotion action executes one declaration-driven GitHub Release transaction.
127
- Its plan, provider observations and receipts bind the exact subject and asset
128
- roots. A completed-transaction recovery explicitly verifies the existing public
129
- Passport and immutable assets before reusing or repairing evidence. A provider
130
- failure cannot select a different publication implementation.
131
-
132
- Release metadata follows the declared tag and channel. The old mode selector and
133
- custom title/notes ports are removed. Retired shell-hook compatibility commands
134
- are absent; the current typed request rejects undeclared fields.
99
+ Buildchain uses the same generated normal and recovery callers as other consumers.
100
+ The published runtime selects its internal publication jobs, binds their source
101
+ and artifacts, and performs provider readback. Its product publisher is
102
+ `.release-pipeline-products.yml`; consumer YAML does not call that component.
103
+
104
+ Completed-publication recovery verifies the existing publication and immutable
105
+ assets before continuing. A provider failure cannot select replacement product
106
+ bytes or a different source. Internal transaction fixtures and retained historical
107
+ receipts remain evidence of their original execution, not extra current callers.
@@ -1,5 +1,5 @@
1
1
  ---
2
- status: draft
2
+ status: active
3
3
  period: ongoing
4
4
  theme: buildchain-reusable-build
5
5
  doc_type: technical-reference
@@ -8,210 +8,92 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-09
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-09
16
- invisible_context_boundary: No private credentials or unrelated repositories inspected.
15
+ generated_at: 2026-09-20
16
+ visible_context: Shared caller generator, schema-2 product plan, pipeline build node and internal signing workflow.
17
+ invisible_context_boundary: Local source inspection does not establish hosted release qualification or provider authorization.
17
18
  ---
18
19
 
19
- # Reusable Build Surface
20
-
21
- A project declares its build in `buildchain.toml`. The reusable workflow owns
22
- job sequencing, admission, runner boundaries and evidence aggregation. Ordinary
23
- single-project calls have no inputs:
24
-
25
- ```yaml
26
- permissions:
27
- issues: write
28
- actions: read
29
- contents: read
30
- id-token: write
31
- attestations: write
32
- jobs:
33
- build:
34
- uses: kungfu-systems/buildchain/.github/workflows/build.yml@v4
35
- ```
20
+ # Consumer build and verification
36
21
 
37
- Use `@v4-alpha` for the alpha entry. The entry selects the execution runtime
38
- from a transient `runtime-ref`, the selected `contract-lock`, or its own commit
39
- by default. The build API also accepts `config-path` and `resume-run-id`;
40
- `runtime-selection` transports the entry decision through nested workflows.
41
- All project commands and build options remain in TOML.
42
-
43
- A new recovery dispatch can pass a repaired train and the original failed run
44
- ID through the same entry. It restores matching retained build outputs, executes
45
- remaining verification and reads back provider effects. An entry defect requires
46
- an upgraded published entry and a full run. See [Runtime entry](runtime-entry.md).
47
-
48
- ## Project discovery
49
-
50
- At the repository root, exactly one of `.buildchain/buildchain.toml` and
51
- `buildchain.toml` must exist. Missing or ambiguous configurations fail before
52
- matrix scheduling. A nested project is selected with its configuration location:
53
-
54
- ```yaml
55
- jobs:
56
- native:
57
- uses: kungfu-systems/buildchain/.github/workflows/build.yml@v4-alpha
58
- with:
59
- config-path: packages/native/.buildchain/buildchain.toml
60
- ```
22
+ A repository declares products in `.buildchain/buildchain.toml`. The shared
23
+ `buildchain.yml` caller invokes `public-ops-pipeline.yml@v4`; the shared
24
+ `buildchain-recover.yml` caller invokes `public-ops-recover.yml@v4`.
25
+ Use [init](getting-started.md) to generate both callers. Their bytes are the same
26
+ for npm packages, binary archives and Paper PDFs.
61
27
 
62
- The config location determines the project working directory. Planning and
63
- lifecycle execution discover the same file. Absolute paths, parent traversal,
64
- symlink escape, malformed TOML and unknown `[build]` keys fail closed. A
65
- configuration locator cannot carry a profile override or execution authority.
28
+ ## Product commands
66
29
 
67
- ## Project configuration
30
+ Each schema-2 `[[products]]` entry declares its product type, supported platforms,
31
+ install/build/verify commands, artifacts and publication targets. For example:
68
32
 
69
33
  ```toml
70
- schema = 1
71
-
72
- [lifecycle.install]
73
- command = "corepack pnpm install --frozen-lockfile"
74
-
75
- [lifecycle.build]
76
- command = "corepack pnpm build"
77
-
78
- [lifecycle.verify]
79
- command = "corepack pnpm test"
80
-
81
- [build]
82
- environment = "github-hosted"
83
- timeout_minutes = 120
84
- fail_fast = false
85
-
86
- [build.tools]
87
- node = "24"
88
- rust = "stable"
89
- go = "1.25.x" # optional; omitted toolchains are not installed
90
-
91
- [build.artifacts]
92
- name = "my-library"
93
- paths = ["dist"]
94
- required_paths = ["dist/library.js"]
95
- min_files = 1
96
- release_candidate = true
97
- retention_days = 14
98
- compression_level = 0
34
+ schema = 2
35
+
36
+ [[products]]
37
+ id = "library"
38
+ type = "npm"
39
+ platforms = ["linux-x64"]
40
+ install = ["corepack pnpm install --frozen-lockfile"]
41
+ build = ["corepack pnpm run build"]
42
+ verify = ["corepack pnpm run check"]
43
+
44
+ [[products.artifacts]]
45
+ id = "package"
46
+ path = "."
47
+ kind = "npm-package"
48
+
49
+ [[products.targets]]
50
+ provider = "npm"
51
+ access = "public"
52
+ artifacts = ["package"]
99
53
  ```
100
54
 
101
- Commands remain exclusively in `[lifecycle]`. The backbone explicitly invokes
102
- install, build and verify in that order on each platform. Build is required;
103
- install and verify are required when declared. Unneeded stages require no
104
- additional boolean setting. Per-stage lifecycle timeout declarations retain
105
- precedence over the build timeout fallback.
106
-
107
- Artifact paths and required file paths are relative to the selected project.
108
- Platform artifact names derive from the configured base name,
109
- platform and source SHA; callers do not supply naming templates. The final
110
- manifest checks `min_files`, `max_files`, `min_total_bytes` and `required_paths`.
111
-
112
- Other optional project sections are:
113
-
114
- | TOML section | Responsibility |
115
- | --- | --- |
116
- | `build.diagnostics` | Process sampling and expected parallelism |
117
- | `build.verification` | Consumer-produced verify substage evidence location |
118
- | `build.finalization` | Verification of final signed bytes and platform placement |
119
- | `build.transport_smoke` | Transport simulation scenario and artifact root |
120
- | `build.attestation` | Subject path and attested platform |
121
- | `build.macos_signing` | App path and sealed-input platform |
122
- | `build.contract` | Compatibility and drift reporting policies |
123
- | `build.evidence` | Repository files containing gate and candidate-family evidence |
124
-
125
- Declarative signing targets continue to belong to `[signing.artifacts]`.
126
- Signing uses `public-release-signing-authority.yml@v4`, passes the selected runtime
127
- through its runtime parameter and retains the protected
128
- `buildchain-artifact-signing` environment.
129
- Credentials, authority profiles and signer identities cannot be supplied through
130
- that declaration. See [Release Candidate](release-candidate.md)
131
- and [GitHub Artifact Attestation](github-artifact-attestation.md).
132
-
133
- ## Governed environments
134
-
135
- `build.environment` selects a profile in
136
- [`architecture/build-environments.json`](../architecture/build-environments.json)
137
- from the exact Buildchain runtime. Infrastructure owners maintain runner
138
- presets/platforms, Linux container images, mirrors, cache transport, artifact
139
- relay settings and credential-island environments there. Adding a runner label
140
- or provider role requires reviewing that profile; project TOML cannot redefine
141
- it. Secrets still cross explicit workflow secret/environment boundaries.
142
-
143
- The profiles are `github-hosted`, `github-hosted-container`, `kungfu-hosted`,
144
- `kungfu-v4-native` and `kungfu-v4-self-hosted`. `kungfu-hosted` preserves the
145
- Kungfu release matrix on GitHub-hosted Ubuntu 24.04 x64 and ARM64, macOS 15
146
- ARM64 and Windows 2022 x64. It selects GCC 14 for Linux x64, full Git history
147
- and the required Windows sccache profile at
148
- `docs/shifu/windows-alpha-sccache.cache-profile.json`, bound to its reviewed
149
- digest in the environment registry. All four lanes transfer artifacts directly
150
- through GitHub; the profile adds no provider roles or signing authority.
151
- Existing profiles retain their runner and cache policies. The container profile
152
- uses the existing digest-pinned `kungfu-verify` image. Native and container jobs remain
153
- separate because GitHub selects `runs-on` and `container` before executing
154
- steps. Their shared behavior is owned by these composite actions:
155
-
156
- | Action | Owner responsibility |
157
- | --- | --- |
158
- | `resolve-build-plan` | Admission and complete plan |
159
- | `prepare-build-environment` | Source and toolchains |
160
- | `run-build-stage` | Ordered lifecycle and diagnostics |
161
- | `transfer-build-artifact` | Exact artifact coordinates and transport |
162
- | `sign-build-artifact` | Isolated signing and final bytes |
163
- | `attest-build-artifact` | Provider identity and final-byte attestation |
164
- | `finalize-build-result` | Complete coverage and final result |
165
-
166
- The backbone has six jobs: `plan`, `build-native`, `build-container`, `sign`,
167
- `attest` and `deliver`. It owns install → build → verify order, job dependencies,
168
- permissions, signing control, credential-island placement and final aggregation.
169
- A composite's internal receipt inputs transport already resolved facts; they
170
- are not additional reusable-workflow configuration inputs.
171
-
172
- ## Identity and admission
173
-
174
- The configuration resolver reads the exact consumer source without executing
175
- consumer commands. It emits a deterministic plan/root binding configuration
176
- bytes, source SHA, called-workflow SHA, selected environment, toolchain and
177
- cache roots. Trust checks run before project execution or privileged runners.
178
-
179
- Tracked consumer workflows use `@v4` or `@v4-alpha` and commit both
180
- `.buildchain/contract-lock.json` and `.buildchain/alpha-contract-lock.json`.
181
- The called channel selects its matching lock. Source-persisted train/SHA
182
- selectors and mismatched locks remain forbidden. Ordinary builds have no
183
- runtime-override path; specialized release/recovery entry points keep their
184
- separate, bounded admission contracts.
185
-
186
- Bootstrap owns its admitted release and recovery capabilities. It is not an
187
- alternate parameter envelope for ordinary builds and is not injected into the
188
- build backbone. Release promotion consumes an already sealed candidate and
189
- must verify the source, artifacts and receipts independently.
190
-
191
- ## Evidence and failure behavior
192
-
193
- The backbone returns one rooted `result` containing source/runtime identity and
194
- exact provider references for payloads, diagnostics, summary, signing, attestation
195
- and candidate evidence. The public facade exposes that result plus the candidate
196
- and controller artifact names for direct `download-artifact` calls.
197
- Platform manifests include deterministic payload hashes; transport preserves
198
- hidden artifacts and provenance. Substage failure evidence is collected even
199
- when verify fails. Untrusted events cannot reach build runners.
200
-
201
- The `sign` matrix uses separate ordinary artifact and protected macOS credential
202
- instances. The credential instance never checks out or executes consumer source.
203
- A hosted artifact instance may use its platform when final-byte verification
204
- requires that operating system; it receives no certificate or notary inputs. Imported signed bytes undergo consumer verification before
205
- manifests are recomputed. Release builds produce candidates; registry publishing
206
- belongs to the protected release path.
207
-
208
- ## Maintaining the contract
209
-
210
- Update the TOML parser and plan resolver, owner contracts, affected consumers
211
- and tests together. Run
212
- `pnpm run generate:workflows`, generated reference/site checks and the full
213
- `pnpm run check`. Breaking input removal is intentional: migrate old `with`
214
- settings to TOML and remove them from calls; no compatibility forwarding exists.
215
-
216
- The Buildchain fixture at `fixtures/libnode-shaped/buildchain.toml` exercises
217
- native macOS/Windows and Linux-container builds through this public contract.
55
+ This excerpt describes a product. The complete configuration also declares version
56
+ sources, protected channel routes and review policy; use the
57
+ [complete standard examples](../templates/minimal-consumer/) for those sections.
58
+
59
+ The runtime executes install, build and verify in order for each selected product.
60
+ Commands run in the product directory inside the admitted checkout. They receive
61
+ an environment without provider credentials, and their output cannot become a
62
+ privileged action's authority output. Runner environment/path file commands can
63
+ carry product toolchain settings between phases.
64
+
65
+ Build source verification binds the exact Git commit, tree and TOML blob, and
66
+ checks tracked file bytes and modes before and after execution. A failed product
67
+ command or source change fails that observation. Successful product execution is
68
+ an input to the runtime's independent qualification and publication stages.
69
+
70
+ ## Runtime selection and recovery
71
+
72
+ Caller source selects `v4` or `v4-alpha`. A tool-maintained contract lock, when
73
+ present, selects its qualified runtime. Without a lock, the entry selects its own
74
+ exact runtime commit. Source-persisted train or SHA overrides are not consumer
75
+ configuration.
76
+
77
+ For an interrupted operation, select its exact attempt in `buildchain-recover.yml`.
78
+ An optional repaired runtime belongs to that recovery request. Source, artifacts,
79
+ provider effects and prior receipts remain bound to the original attempt. See
80
+ [the Golden Path](getting-started.md) for the normal protected PR flow.
81
+
82
+ ## Internal implementation boundaries
83
+
84
+ The [workflow catalog](workflow-catalog.md) identifies internal components.
85
+ Consumers do not call their workflows/actions or supply material roots, provider
86
+ payloads, Warrant state or direct artifact-download handoffs.
87
+
88
+ The internal `.release-signing-authority.yml` owns native signing credentials and
89
+ provider verification. Its protected `buildchain-artifact-signing` environment
90
+ retains certificate/notary inputs; the credential job never checks out or executes
91
+ consumer source. Ordinary artifact jobs receive no certificate or notary secrets.
92
+ The signing adapters verify returned bytes and provider results before delivery.
93
+ These implementation contracts do not add another consumer entry or imply that
94
+ all internal product capabilities are schema-2 configuration options.
95
+
96
+ Maintainers changing product execution or credential boundaries must update the
97
+ plan, implementation, source-bound tests, generated references and site bundle,
98
+ and run the full repository check. Retained schema-1 build fixtures exercise
99
+ internal implementation history; they are not current consumer templates.
@@ -8,11 +8,11 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-14
11
+ last_reviewed: 2026-09-19
12
12
  ai_provenance:
13
13
  model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-09-14
15
+ generated_at: 2026-09-19
16
16
  visible_context: Source-bound caller installation, pipeline wake implementation and GitHub event documentation.
17
17
  invisible_context_boundary: No unobserved provider execution or publication authority is claimed.
18
18
  ---
@@ -72,7 +72,9 @@ the normal pipeline before recovering a current admitted attempt. An installatio
72
72
  merge advances the protected base, so an older unmerged source attempt must be
73
73
  re-admitted on the current base before recovery.
74
74
 
75
- Both callers are byte-identical to the generated consumer entries and call the
76
- published `@v4-alpha` public workflows. Recovery accepts only `attempt` and
77
- optional `runtime-ref`; the normal caller retains its protected config path.
78
- This installation order does not qualify the full self cutover or Stable release.
75
+ The tracked callers are byte-identical to the default generated consumer entries:
76
+ published `@v4` public workflows and `.buildchain/buildchain.toml`. Recovery accepts
77
+ only `attempt` and optional `runtime-ref`. The stable entry must be published and
78
+ qualified before adopting these defaults. Historical installation and recovery
79
+ receipts retain their original transition path and runtime identities; installation
80
+ order alone does not qualify a Stable release.