@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
package/docs/cli.md CHANGED
@@ -8,12 +8,13 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-06
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-06
16
- invisible_context: not asserted
15
+ generated_at: 2026-09-20
16
+ visible_context: Schema-2 consumer initialization, CLI validation, and internal pipeline npm publication implementation.
17
+ invisible_context_boundary: Local validation does not prove provider authorization or hosted publication.
17
18
  ---
18
19
 
19
20
  # Buildchain CLI, npm Package, and Toolkit API
@@ -49,10 +50,10 @@ Consumers should pin the exact Buildchain version that was validated in their
49
50
  repository. When dogfooding a fresh Buildchain release immediately after it is
50
51
  published, pnpm may block the install through a minimum release-age policy. In
51
52
  that case, add a temporary package/version-specific `minimumReleaseAgeExclude`
52
- entry, such as `@kungfu-tech/buildchain@4.0.0`, and remove it once the package
53
+ entry, such as `@kungfu-tech/buildchain@4.1.3`, and remove it once the package
53
54
  has aged past the normal policy window. Do not replace that with a broad
54
- registry or scope-wide exclude. Paper scaffold and migration maintain the
55
- exact current entry in `pnpm-workspace.yaml` before refreshing the lockfile.
55
+ registry or scope-wide exclude. For an existing `pnpm-workspace.yaml`, Paper
56
+ migration maintains an exclusion for the selected exact Buildchain version.
56
57
 
57
58
  Use the package API directly inside JavaScript build scripts:
58
59
 
@@ -135,121 +136,45 @@ with the exact signer/source policy and then verifies the retained bundle,
135
136
  predicate, platform manifest, Passport, and Buildchain evidence locally. See
136
137
  [`github-artifact-attestation.md`](github-artifact-attestation.md).
137
138
 
138
- ### Governed paper lifecycle
139
+ ### Paper product source
139
140
 
140
- `buildchain paper` is the unified operator surface for one paper repository or
141
- a discovered fleet. Every subcommand returns a versioned JSON contract with
142
- `--json`:
141
+ Paper uses the same schema-2 policy and two caller files as npm and binary
142
+ products. For an existing source tree, use `buildchain init --type paper`.
143
+ To create a new LaTeX source tree:
143
144
 
144
145
  ```bash
145
- buildchain paper scaffold --package @kungfu-tech/paper-example \
146
- --repository kungfu-systems/paper-example
147
- buildchain paper migrate --json
148
- buildchain paper agent verify --json
149
- buildchain paper work start golden-path --json
150
- buildchain paper work submit --json
151
- buildchain paper fleet audit --root ../papers --json
152
- buildchain paper fleet update --root ../paper-worktrees --json
153
- buildchain paper preflight --offline --json
154
- buildchain paper bootstrap npm --json
155
- buildchain paper build --json
156
- buildchain paper alpha --json
146
+ buildchain paper scaffold --name paper-example --title "Example Paper" \
147
+ --repository example/paper-example --json
148
+ buildchain paper scaffold --name paper-example --title "Example Paper" \
149
+ --repository example/paper-example --write --json
150
+ make pdf
151
+ make check
152
+ buildchain validate --require-lifecycle-stages build,verify
153
+ buildchain paper preflight --json
157
154
  buildchain paper status --json
158
- buildchain paper resume --json
159
155
  ```
160
156
 
161
- The safety and authority boundary is explicit:
162
-
163
- - `scaffold` plans a 17-file, no-overwrite repository shape by default; add
164
- `--write` to create only missing files.
165
- - `migrate` plans the Buildchain-owned authority, workflow, contract lock,
166
- version pin, package, agent-entry policy, managed `AGENTS.md` section, and
167
- required-check changes needed by an existing paper repository. It pins an
168
- exact runtime dependency and adds pnpm-backed paper scripts. With v4, build
169
- and verify callers use `@v4-alpha`; release callers select `@v4-alpha` for
170
- Alpha and `@v4` for stable releases. Both channel contract locks and their
171
- distinct resolved source coordinates are bound into provisioning authority.
172
- Verify callers grant the reusable Check workflow its required read permissions.
173
- Paper agent guidance resolves next-development scripts from the installed
174
- Buildchain package and links to the upstream transition ADR.
175
- Migration reads the other channel from its fetched Git tag. Installed-package
176
- operators can supply `--stable-buildchain-root` or `--alpha-buildchain-root`
177
- pointing to the corresponding exact source checkout instead.
178
- Add `--write` only after reviewing exact old and new digests; paper content
179
- and publication configuration are never rewritten. Refresh
180
- `pnpm-lock.yaml` with `pnpm install --lockfile-only` after a write.
181
- - `agent verify` is the mandatory resume check on an existing work branch. It
182
- verifies the digest-bound `.buildchain/paper/agent-entry.json`, the single
183
- managed `AGENTS.md` section, exact package scripts and runtime dependency, runtime
184
- source SHA, development target, and current branch lineage. `--ci` derives
185
- the pull-request source and target from GitHub context and fails closed on a
186
- non-work source branch or a target other than the configured development
187
- line.
188
- - Installed npm runtimes resolve their source from registry `gitHead`, or from
189
- the official exact version tag when that field is absent. Missing, malformed,
190
- duplicate, or unexpected tag results fail closed; floating tags are never
191
- used as the installed package's source identity.
192
- - `work start` derives the protected development branch from the configured
193
- publication semver line and creates a safe local work branch only when the
194
- worktree is clean, the sole `origin` is the canonical `kungfu-systems`
195
- repository, and local HEAD equals the exact remotely observed development
196
- SHA. It never fetches or merges silently.
197
- - `work submit` accepts only an allowed non-protected work branch that contains
198
- the exact remote development commit. It rejects divergent remote work,
199
- wrong-base pull requests, dirty trees, forks, and ambiguous remotes; execution
200
- uses a normal non-force push and opens or reuses a PR to the derived
201
- development branch.
202
- - `fleet audit` discovers `paper-*` repositories from a root and emits one
203
- deterministic audit root over exact runtime, dependency, lockfile, workflow,
204
- authority, and repository observations. `fleet update` reuses the migration
205
- contract for every discovered repository, remains dry-run by default, and
206
- refuses protected or non-work branches.
207
- - The scaffolded `.buildchain/paper/provisioning-authority.json` binds both
208
- build/release caller workflow byte digests, the required verify caller, the
209
- agent-entry policy and instructions, their exact reusable-workflow SHA, the
210
- runtime SHA, contract-lock bytes, npm registry and trusted-publisher
211
- coordinates, and the repository Actions/generated-write policy under one
212
- digest. A floating Buildchain ref cannot change release policy after that
213
- authority is accepted.
214
- - The reusable `public-build-check.yml` detects publication-artifact repositories and runs
215
- `paper preflight --offline --ci` inside the existing required check context.
216
- Skipping the local CLI therefore cannot admit a missing entry contract,
217
- drifted Buildchain-owned surface, unsafe source branch, or wrong PR target.
218
- - `preflight` separates local readiness from readiness for external mutation.
219
- `--offline` skips live GitHub and npm observations without treating them as
220
- local failures. Live readiness requires default workflow permissions `read`,
221
- Actions pull-request approval disabled, and GitHub App or equivalent narrow
222
- generated-write credential metadata.
223
- - `bootstrap npm` always performs npm pack and publish dry-runs first. A real
224
- public bootstrap requires both `--execute` and
225
- `--confirm-public-package <exact-name>`, uses only the official npm registry,
226
- fixes the bootstrap version at `0.0.0-bootstrap.0`, and returns only npm URLs
227
- observed from command output. Success requires public package readback and
228
- the exact repository/workflow/environment trusted-publisher binding. For
229
- GitHub, the npm coordinate is the workflow filename (`public-release-paper.yml`),
230
- not its `.github/workflows/` repository path.
231
- - `build` plans the two-clean-build reproducibility proof. Add `--execute` to
232
- create and verify the sealed publication bundle.
233
- - `alpha` plans or opens the protected Alpha pull request; it never merges,
234
- publishes, or advances a floating ref.
235
- - `status` reports only evidence found in the repository or external
236
- observations. It never infers a later lifecycle state from an earlier one.
237
- - `resume` plans or dispatches the repository's thin release workflow; the
238
- protected workflow remains the release authority.
239
-
240
- The ordered evidence states are `scaffolded`, `governed`, `admitted`,
241
- `bootstrapped`, `trust-bound`, `content-ready`, `artifact-sealed`,
242
- `package-published`, `alpha-complete`, `staging-visible`, and
243
- `production-visible`. A state can be `satisfied`, `not-reached`, `blocked`, or
244
- `unknown`; consumers must not collapse those distinctions.
245
-
246
- The corresponding Node surface is
247
- `@kungfu-tech/buildchain/paper`. Planning and status functions are read-only;
248
- `writePaperScaffold()`, `writePaperMigration()`, and
249
- `writePaperFleetUpdate()` are the bounded local writers. Work plans expose
250
- separate rechecking executors for local branch creation and normal push, and
251
- `executePaperNpmBootstrap()` preserves the same confirmation boundary used by
252
- the CLI.
157
+ Scaffold plans all files before writing. `--write` creates missing files only;
158
+ conflicting content, extra workflows and symlinked write parents stop the whole
159
+ write. Repeating an unchanged scaffold is idempotent. `--package` optionally
160
+ names the private source package; its version is the product version authority.
161
+ Title and homepage stay in that product manifest.
162
+
163
+ The generated TOML declares the PDF and a GitHub Release target. The generated
164
+ `buildchain.yml` and `buildchain-recover.yml` are byte-identical to the other
165
+ product templates. Open the appropriate protected channel PR to request
166
+ publication. Recovery uses the common exact-attempt entry.
167
+
168
+ For schema-2 Paper repositories, preflight and status inspect local configuration
169
+ and caller bytes. Their `localOnly` result and `publication.status=not-observed`
170
+ do not claim a successful hosted build, admission or release. They perform no
171
+ npm login, bootstrap, trust setup or GitHub account operation. Provider permissions
172
+ and any tool-maintained runtime locks belong to the common setup/runtime contract.
173
+
174
+ The previous schema-1 npm-paper contract, three-workflow scaffold and repository
175
+ provisioning authority are retired from new scaffolds. Existing paper repositories
176
+ need a reviewed migration; historical publication receipts remain historical
177
+ facts and do not become new runtime configuration.
253
178
 
254
179
  `buildchain layout` is the stable machine question for repository layout. Tools
255
180
  such as Shifu should call it instead of copying `.buildchain/` path constants:
@@ -267,8 +192,11 @@ not sufficient. The same contract is available through
267
192
  `createBuildchainLayoutDiscovery()` from
268
193
  `@kungfu-tech/buildchain/buildchain-layout`.
269
194
 
270
- `buildchain init` writes a starter `.buildchain/buildchain.toml` and a reusable workflow
271
- caller at `.github/workflows/build.yml`.
195
+ `buildchain init` writes a schema-2 `.buildchain/buildchain.toml` and the shared
196
+ `.github/workflows/buildchain.yml` / `buildchain-recover.yml` caller pair.
197
+ Product build and verification belong in TOML. Publication and recovery stay in
198
+ the published runtime; consumers do not call the internal commands below as
199
+ release lifecycle hooks. See the [Golden Path](getting-started.md).
272
200
 
273
201
  `buildchain portable-cache plan` turns a consumer-owned, secret-free manifest
274
202
  into GitHub Actions cache inputs without letting each consumer invent key or
@@ -306,32 +234,21 @@ consumer's current build or tests. Roots must be workspace-relative or under
306
234
  segments. `cold-fallback-status=passed` qualifies a miss only after the current
307
235
  source has completed its normal build and test path.
308
236
 
309
- Supported presets:
310
-
311
- - `--type package` for Node package repositories with pnpm, npm, or yarn.
312
- - `--type native` for CMake-style native projects.
313
- - `--type web-surface` for preview/staging/production site or app deployments.
314
- - `--type infra-contract` for provider-agnostic infrastructure contract
315
- validation, observation, contract publication, and downstream propagation
316
- planning without default mutation. Provider adapters expose built-in command
317
- plans by default, and only configured `[infra.commands]` hooks can execute.
318
- - `--type publication-artifact` for papers, reports, specifications, and other
319
- publication repositories that produce PDFs, metadata, source bundles, and
320
- site-consumable manifests without becoming web-surface repositories. The
321
- scaffold uses Buildchain's pinned
322
- `ghcr.io/kungfu-systems/build-images/latex-pdf-builder:v1.2.0` toolchain for
323
- LaTeX PDF builds.
324
- - `--type distribution-index` for Homebrew taps and other index repositories
325
- whose files are projections of upstream release passport evidence.
326
- - `--type anchored-package` for packages whose version is anchored to an
327
- explicit upstream release manifest.
328
-
329
- The native preset includes an opt-in `[diagnostics.native]` profile with common
330
- tool/cache/artifact probes. Consumers can keep it enabled, adjust the tool and
331
- directory lists, or disable it if a repository does not need native diagnostics.
332
-
333
- `buildchain validate` parses `.buildchain/buildchain.toml`, checks configured version-state
334
- files, and can require named lifecycle stages:
237
+ Supported initialization types:
238
+
239
+ - `npm` or `package`: an npm product with an existing versioned `package.json`.
240
+ - `binary` or `native`: a CMake product producing an archive.
241
+ - `paper` or `publication-artifact`: a product producing a PDF.
242
+ - `anchored-package`: an npm product with reviewed, manually maintained version authority.
243
+
244
+ These choices change TOML product declarations, never the two YAML templates.
245
+ The old `web-surface`, `infra-contract` and distribution initialization modes
246
+ are outside the current schema-2 product set and are rejected before writing.
247
+ Internal libraries for those capabilities are separate from consumer initialization.
248
+
249
+ `buildchain validate` parses `.buildchain/buildchain.toml`, checks configured
250
+ version files and the exact shared caller bytes, and can require named commands
251
+ on every declared product:
335
252
 
336
253
  ```bash
337
254
  buildchain validate \
@@ -646,14 +563,15 @@ spend long stretches in low-concurrency compile, archive, link, or cache steps.
646
563
  buildchain doctor --json
647
564
  ```
648
565
 
649
- It validates `.buildchain/buildchain.toml`, package-manager detection, Git repository state,
650
- and the reusable workflow caller. For `version.strategy = "anchored"` with
651
- `version.next = "manual"`, it also embeds the anchored package release contract
652
- check: anchor manifest readability, configured version files, trusted
653
- publishing, package publish order, and required lifecycle stages. Add
654
- `--require-publish-source-lock` inside a publish job when the doctor report
655
- should also fail unless the job is running from a resolved `publish-gate/*`
656
- source lock.
566
+ For schema-2 consumers it validates TOML, Git repository state, the exact normal
567
+ and recovery caller pair, and package-manager discovery when an npm product is
568
+ present. A mixed channel pair or a consumer-edited YAML fails validation.
569
+ Binary and Paper products do not need an npm package manager merely to use
570
+ Buildchain. The report grants no publication authority.
571
+
572
+ The remaining source-lock and schema-1 checks below describe internal runtime
573
+ and historical product tooling. They are not extra steps in the current
574
+ consumer release path.
657
575
 
658
576
  Anchored/manual package publish jobs can run the narrower source-lock gate
659
577
  directly:
@@ -712,8 +630,10 @@ buildchain publication-artifact npm-package --json
712
630
  This command reads `project.type = "publication-artifact"`,
713
631
  `publication.version`, and `[publish] kind = "npm-paper-package"` plus
714
632
  `publish.package`; it writes `.buildchain/publication/npm-package` by default.
715
- The `public-release-paper.yml@v3` reusable workflow uses the same command before
716
- running the standard npm publish transaction.
633
+ These are retained schema-1 package-generation fields. Current schema-2 Paper
634
+ consumers declare PDF artifacts and a GitHub Release target in TOML; they do
635
+ not add an npm publication workflow. Use the Paper migration command before
636
+ using a legacy repository with the shared caller pair.
717
637
 
718
638
  The command writes `.buildchain/publication/publication-artifact.json`,
719
639
  `.buildchain/publication/publication-artifact-passport.json`, a source bundle,
@@ -1056,36 +976,27 @@ and package identity. See [`v4-adopter-delivery.md`](v4-adopter-delivery.md).
1056
976
 
1057
977
  ## npm Publish Gate
1058
978
 
1059
- Buildchain's own npm package is published from
1060
- `.github/workflows/self-release-promote.yml`, inside the same publish
1061
- transaction that promotes release refs:
1062
-
1063
- - `v4.0.3-alpha.0` publishes to npm with dist-tag `alpha`.
1064
- - `v4.0.2` publishes to npm with dist-tag `latest`.
1065
- - moving refs such as `v4`, `v4.0`, and `v4.0-alpha` do not match the publish
1066
- workflow and do not publish.
1067
-
1068
- The promotion workflow uses npm Trusted Publishing through GitHub Actions OIDC.
1069
- It runs on a GitHub-hosted runner with `id-token: write`, but it does not
1070
- manually run the release-candidate resolver or promote action. Buildchain's own
1071
- dogfood path calls the declarative `public-release-promote.yml` wrapper with
1072
- channel, target ref/SHA, PR-stage workflow, artifact, status-check, and passport
1073
- inputs. The wrapper generates the version-state commit, runs
1074
- `lifecycle.verify`, runs `lifecycle.publish`, writes Buildchain publish
1075
- evidence, validates that evidence, and only then moves exact tags and floating
1076
- refs.
1077
-
1078
- ```bash
1079
- node packages/core/publication/commands/npm-publish-transaction.mjs
1080
- ```
1081
-
1082
- Before the first real release, configure npm Trusted Publishing for:
1083
-
1084
- - package: `@kungfu-tech/buildchain`
1085
- - repository: `kungfu-systems/buildchain`
1086
- - workflow: `.github/workflows/self-release-promote.yml`
1087
-
1088
- No npm package is published by manual dispatch or ordinary branch builds.
1089
- Manual dispatch on `.github/workflows/self-release-npm-dry-run.yml` remains dry-run only, so
1090
- maintainers can verify package contents and npm publish shape before opening or
1091
- merging the release PR.
979
+ Buildchain consumes its own generated `buildchain.yml` entry, which invokes
980
+ `public-ops-pipeline.yml@v4`. Its schema-2 TOML declares the npm package product,
981
+ build/verification commands and npm target. A legal channel PR expresses the
982
+ release intent; the runtime manages qualification, version materialization,
983
+ publication, provider readback and follow-up development work.
984
+
985
+ The internal
986
+ [`.release-pipeline-products.yml`](../.github/workflows/.release-pipeline-products.yml)
987
+ workflow owns the separate product build, qualification, publication and
988
+ settlement jobs. Its publication job runs on a GitHub-hosted runner with
989
+ `id-token: write`. For the configured npm Trusted Publisher, the publish client
990
+ uses GitHub Actions OIDC. Routine releases require no interactive npm login,
991
+ bootstrap publication or manually supplied npm token.
992
+
993
+ The runtime publishes the admitted sealed package version and retains exact
994
+ registry integrity and GitHub Release evidence. Prereleases use the `alpha`
995
+ dist-tag; stable releases use `latest`. An ordinary source build or floating
996
+ ref update alone is not publication authority.
997
+
998
+ Consumers do not call the npm transaction CLI, select candidate run IDs, pass
999
+ request JSON, or add a separate npm release workflow. If an existing attempt
1000
+ needs recovery, use `buildchain-recover.yml` with its exact attempt and an
1001
+ optional repaired runtime. If a failed alpha is abandoned, keep its historical
1002
+ state intact and publish a new admitted candidate/version.
@@ -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-13
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-13
15
+ generated_at: 2026-09-20
16
16
  visible_context: Buildchain 4.1 source, architecture registries and local validation.
17
17
  invisible_context_boundary: No unpublished release or external consumer qualification is claimed.
18
18
  ---
@@ -20,12 +20,14 @@ ai_provenance:
20
20
  # Code organization
21
21
 
22
22
  Buildchain 4.1 uses responsibility layers, then capability directories. The
23
- reusable workflow is the primary consumer API. This development line is
24
- `4.1.0-alpha.1`; these changes do not themselves publish an alpha release.
23
+ normal pipeline and exact-attempt recovery workflows are the consumer API.
24
+ Product choices belong in schema-2 TOML; other workflows and every action are
25
+ internal implementation. Source changes require separate published qualification.
25
26
 
26
27
  ```text
27
28
  .github/workflows/ Consumer APIs and hosted job topology
28
- public-*.yml, build.yml Public reusable contracts
29
+ public-ops-pipeline.yml, public-ops-recover.yml
30
+ The two public reusable contracts
29
31
  .*.yml Internal reusable job components
30
32
  buildchain.yml, buildchain-recover.yml
31
33
  Generated self normal and recovery callers
@@ -7,18 +7,23 @@ source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
- review_state: self-reviewed
11
- last_reviewed: 2026-09-11
10
+ review_state: unreviewed
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-11
15
+ generated_at: 2026-09-20
16
16
  visible_context: Buildchain v4 parity of the proven v3 Release Train and Release Cut contracts, existing source locks, exact-source Alpha preflight, Dev Patrol, cancelled duplicate runs, protected auto-merge policy, repository release governance, and the consumer-owned settlement renderer threat model.
17
17
  invisible_context_boundary: No credentials, private logs, or private configuration were used.
18
18
  ---
19
19
 
20
20
  # Dev to Alpha Candidate Patrol
21
21
 
22
+ This is the internal `.ops-alpha-candidate-patrol.yml` mechanism. Current
23
+ consumers use a legal channel PR and the shared normal pipeline; they do not add
24
+ a patrol caller, renderer or controller-state inputs. The retained controller
25
+ contract below describes implementation and historical qualification.
26
+
22
27
  Buildchain provides a reusable observation and single-flight PR controller for
23
28
  repositories that promote a development branch into a protected Alpha branch.
24
29
  It does not publish Alpha. The read-only observer reads the exact heads of both
@@ -95,38 +100,13 @@ not an allowed supersession cause. Legacy markers remain readable by the core
95
100
  contract, but the active-train workflow refuses to manufacture missing Release
96
101
  Cut authority for an already-open legacy PR.
97
102
 
98
- ## Reusable workflow
99
-
100
- Call `.github/workflows/public-ops-alpha-candidate-patrol.yml` from a thin repository
101
- workflow. Start with `dry-run: true`. The reusable workflow always runs an
102
- `observe` job with only Actions/content/pull-request read permissions. Once the
103
- repository has proven that its two workflow names and branch topology produce
104
- exact same-SHA evidence, it may set `settlement-authorized: true` and
105
- `dry-run: false`. The older `create-pull-request` input remains a compatibility
106
- alias for settlement authorization.
107
-
108
- Repositories whose promotion policy requires a machine-readable PR declaration
109
- can pass static text through `pull-request-body-prefix`. When the declaration
110
- depends on the exact qualified delta, use `pull-request-body-prefix-renderer`
111
- instead. It names a repository-relative Node.js file in the consumer checkout.
112
- The read-only `observe` job checks out the selected SHA with credentials disabled,
113
- runs the renderer with a reduced environment, and requires it to write UTF-8 text
114
- to `BUILDCHAIN_CHANNEL_PATROL_PR_BODY_PREFIX_OUTPUT`. The renderer also receives
115
- the selected SHA plus source and target branch names. It may derive a declaration
116
- from the exact checkout and `origin/<target-branch>` without receiving the
117
- promotion token.
118
-
119
- Static and rendered prefixes are mutually exclusive. A renderer failure, path
120
- escape, source-SHA mismatch, empty or oversized result, invalid UTF-8, or managed
121
- controller-marker injection fails before the write-permission job can run. The
122
- rendered bytes are retained with the read-only observation artifact and passed
123
- to `settle` as a job output, so the candidate PR is created with the correct
124
- declaration on its first write. Buildchain preserves that repository-owned text
125
- when later observations update only the managed state marker. Before any write,
126
- `settle` also requires its fresh observation to select the same SHA that produced
127
- the rendered bytes. Concurrent qualification progress therefore fails closed
128
- and is recomputed by the next patrol instead of attaching a declaration to the
129
- wrong candidate.
103
+ ## Internal workflow
104
+
105
+ The internal component separates read-only observation from write-permission
106
+ settlement. Its source, target, rooted observations and optional internal renderer
107
+ remain implementation ports. A renderer receives reduced authority, must bind
108
+ the exact observed source, and cannot inject managed controller markers. Rendered
109
+ bytes must be revalidated before any write; they are not new consumer wiring.
130
110
 
131
111
  The separately permissioned `settle` job prepares the entry-selected runtime,
132
112
  re-runs the exact observation, and compare-and-swap
@@ -155,7 +135,7 @@ The workflow exposes `train-root`, `cut-root`, `candidate-generation`,
155
135
  selected SHA. Alpha build orchestration should bind to those outputs and treat
156
136
  a non-empty hold root as a fail-closed result.
157
137
 
158
- The caller may additionally set `auto-merge: true` and choose `merge-method`
138
+ An authorized internal invocation may set `auto-merge: true` and choose `merge-method`
159
139
  from `merge`, `squash`, or `rebase`. Buildchain only arms GitHub auto-merge for
160
140
  the single managed, open, exact-source candidate after the write-permission
161
141
  settlement has revalidated the observation. GitHub still owns every required
@@ -163,11 +143,8 @@ review, required check, branch-protection, and merge-queue gate; Buildchain does
163
143
  not approve or directly merge the PR. Invalid merge methods and GraphQL
164
144
  refusals fail the patrol run.
165
145
 
166
- Consumers should invoke this workflow after relevant qualification workflow
167
- completion and from an offset periodic fallback. GitHub may delay scheduled
168
- runs, so the event path supplies low latency while the fallback supplies
169
- recovery. Workflow concurrency plus the server-side open-PR reconciliation
170
- makes duplicate or delayed events idempotent.
146
+ Runtime-owned routing and server-side reconciliation handle duplicate and delayed
147
+ events. Consumers do not configure completion listeners or fallback cron jobs.
171
148
 
172
149
  The workflow never moves the Alpha ref directly, directly merges the pull
173
150
  request, approves it, publishes npm, creates a Git tag or GitHub Release, or
@@ -8,31 +8,32 @@ 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
- visible_context: Delivery workflows, composite nodes, authority scripts, and structural conservation tests.
17
- invisible_context_boundary: No private credentials or unobserved provider execution state.
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
  # Dev delivery orchestration
21
21
 
22
- `public-ops-dev-auto-merge.yml` orchestrates six owned delivery nodes. The
23
- published `public-ops-dev-auto-merge.yml` entry remains its generated compatibility
24
- projection, with the same inputs, outputs, job identities, concurrency and
25
- permissions. Node ownership and the orchestration size budget are declared in
22
+ The internal `.ops-dev-auto-merge.yml` component orchestrates six owned delivery
23
+ nodes. It is an implementation behind the shared pipeline, with no public
24
+ compatibility alias. Consumers use `public-ops-pipeline.yml` and do not select
25
+ Warrant modes, proof inputs or a separate merge workflow. Node ownership and the
26
+ orchestration size budget are declared in
26
27
  [`architecture/dev-delivery-orchestration.json`](../architecture/dev-delivery-orchestration.json).
27
28
 
28
29
  | Node | Owning composite | Result and continuation |
29
30
  | ------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
31
  | Source admission | [source](../actions/dev-delivery/candidate/admit/action.yml) | Resolve one runtime SHA; check exact source eligibility; produce the Source Qualification Proof or an explicit failed qualification outcome. |
31
32
  | Reservation | [reserve](../actions/dev-delivery/candidate/reserve/action.yml) | Submit the candidate and select or recover its exact Warrant. A different active owner receives a handoff; an already-qualified owner skips native execution. |
32
- | Native verification | [native](../actions/dev-delivery/native/dispatch/action.yml) | Execute or reuse native proof, independently seal its transfer, and maintain the durable lease in three distinct hosted jobs. |
33
+ | Native verification | [execute](../actions/dev-delivery/native/execute/action.yml), [seal](../actions/dev-delivery/native/seal/action.yml), [heartbeat](../actions/dev-delivery/native/heartbeat/action.yml) | Execute or reuse native proof, independently seal its transfer, and maintain the durable lease in three distinct hosted jobs. |
33
34
  | Qualification | [qualify](../actions/dev-delivery/candidate/qualify/action.yml) | Read back provider job boundaries and heartbeat continuity; validate proof and current source/base; atomically qualify the same Warrant. |
34
35
  | Landing | [land](../actions/dev-delivery/queue/land/action.yml) | Recheck admission and enqueue or directly merge according to the existing policy. Publish artifacts and enforce the final result even after a predecessor fails. |
35
- | Settlement | [settle](../actions/dev-delivery/warrant/settle/action.yml) | Settle independently verified native failure, or process a later provider terminal event through `public-ops-warrant-close.yml`. Clear only the exact authority and wake its successor. |
36
+ | Settlement | [settle](../actions/dev-delivery/warrant/settle/action.yml) | Settle independently verified native failure, or process a later provider terminal event through `.ops-warrant-close.yml`. Clear only the exact authority and wake its successor. |
36
37
 
37
38
  The six nodes describe ownership, not six new runner allocations. Source and
38
39
  reservation share the existing admission job. Qualification, native-failure
@@ -79,9 +80,12 @@ close workflow. A queue admission cannot select terminal settlement by itself.
79
80
 
80
81
  ## Failure and recovery
81
82
 
83
+ Consumers request recovery by exact attempt through `buildchain-recover.yml`; the
84
+ runtime owns all internal selectors described below.
85
+
82
86
  The original `off`, `shadow`, `required`, dry-run, universal-bootstrap,
83
87
  proof-reuse, legacy handoff and deferred-landing paths remain in their owning
84
- nodes. A node boundary does not grant new retry or cleanup authority. Resume
88
+ nodes. A node boundary does not grant new retry or cleanup authority. Internal resumption
85
89
  continues to require the exact candidate, live fence and verified reusable proof
86
90
  under the [Warrant contract](dev-delivery-warrant.md).
87
91
 
@@ -8,7 +8,7 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: self-reviewed
11
- last_reviewed: 2026-08-15
11
+ last_reviewed: 2026-09-20
12
12
  ---
13
13
 
14
14
  # ADR: Qualification Leases and the exclusive Landing Warrant
@@ -231,12 +231,13 @@ skipped, nonterminal, or cross-PR predecessors.
231
231
  - Generated references: [`cli-reference.md`](cli-reference.md) and
232
232
  [`node-api-reference.md`](node-api-reference.md).
233
233
 
234
- The existing public `public-ops-dev-auto-merge.yml` reusable workflow remains the
235
- single-flight v1 controller and does not advertise v2 Landing guarantees.
236
- Bounded v2 is a separate opt-in controller contract built from the public CLI,
237
- Node API, and schema; merely calling the v1 reusable workflow never enables or
238
- claims it. Buildchain's tracked floating `@v4-alpha` self-delivery caller
239
- continues to exercise that public v1 path without overstating v2 execution.
234
+ At the original ADR's rollout boundary, the standalone dev-auto-merge entry
235
+ exercised the single-flight v1 controller and did not claim v2 Landing
236
+ guarantees. That observation remains historical. Current consumers use the
237
+ shared normal pipeline; `.ops-dev-auto-merge.yml` is an internal component.
238
+ Consumers do not deploy a second controller or supply its proof/lease ports.
239
+ The v1/v2 authority and migration invariants in this ADR remain implementation
240
+ constraints, not extra consumer wiring.
240
241
 
241
242
  All mutations are plan-only unless `--execute` is supplied. Merge-group
242
243
  admission is always a read-only authority check; it never mutates GitHub Merge
@@ -245,7 +246,7 @@ Queue itself.
245
246
  ## Consequences
246
247
 
247
248
  Qualification throughput can increase without increasing the number of
248
- candidates permitted to land. Consumers retain the byte- and behavior-compatible
249
- single-flight default until they deliberately deploy the v2 mode. The tradeoff
249
+ candidates permitted to land. The original rollout retained the single-flight default until explicit v2
250
+ admission. Current selection belongs to the runtime. The tradeoff
250
251
  is a second state contract and controller family; Buildchain keeps that
251
252
  separation explicit so a rollout cannot silently weaken Warrant semantics.