@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
@@ -7,17 +7,21 @@ 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
  invisible_context: not asserted
17
17
  ---
18
18
 
19
19
  # Dev Delivery Warrant Queue
20
20
 
21
+ Warrant, lease, proof and provider fields on this page are internal authority
22
+ contracts. Consumers use the shared normal pipeline and recover by exact attempt;
23
+ none of these fields or helper workflows belongs in consumer YAML or TOML.
24
+
21
25
  Buildchain's Dev Delivery Warrant Queue gives a qualified slow pull request a
22
26
  durable, non-preemptive delivery turn without replacing GitHub Merge Queue as
23
27
  the final protected-ref authority.
@@ -321,7 +325,7 @@ The reader rejects an empty run conclusion, nonterminal run or job state,
321
325
  unsupported job conclusion, or pull-request state outside `open|closed` before
322
326
  it can seal product-owned cleanup evidence.
323
327
 
324
- The public two-phase workflow keeps heartbeat authority in a fourth,
328
+ The internal two-phase workflow keeps heartbeat authority in a fourth,
325
329
  GitHub-hosted job on a runner domain distinct from admission, native execution,
326
330
  evidence sealing, and finalization. Each successful heartbeat records the exact
327
331
  expected-old and next authority state roots plus its receipt root. The
@@ -340,13 +344,10 @@ write-normalize-observe-remutate cycle: `transferRoot`,
340
344
  `providerAttempt`, and, when expiry cleanup was required, the independent
341
345
  `providerTerminalReadbackRoot`.
342
346
 
343
- Buildchain's tracked self-delivery caller invokes
344
- `kungfu-systems/buildchain/.github/workflows/public-ops-dev-auto-merge.yml@v4-alpha`.
345
- The durable selector remains the floating alpha channel, the repository keeps
346
- matching `.buildchain/contract-lock.json` (`v4`) and
347
- `.buildchain/alpha-contract-lock.json` (`v4-alpha`), and a train runtime may be
348
- selected only through the trusted, non-persistent `workflow_dispatch` input.
349
- No candidate SHA or train ref is persisted in the caller.
347
+ Buildchain's self entry is the same generated `buildchain.yml` used by other
348
+ consumers. Internal `.ops-dev-auto-merge.yml` execution retains its authority
349
+ boundaries. The optional repaired runtime belongs only to exact-attempt recovery;
350
+ no candidate SHA or train ref is persisted in the consumer caller.
350
351
 
351
352
  Only complete `verified-native-qualification` evidence can mint a new Landing
352
353
  Warrant. Migrated `legacy-compatibility-only` evidence may preserve an exact
@@ -402,7 +403,7 @@ native proof or reuse authority. Phase-less native candidates remain invalid.
402
403
 
403
404
  ## Workflow rollout and rollback
404
405
 
405
- The reusable `public-ops-dev-auto-merge.yml` supports three explicit rollout modes:
406
+ The internal `.ops-dev-auto-merge.yml` component retains three rollout modes for implementation qualification:
406
407
 
407
408
  - `off` preserves the previous exact-head admission controller;
408
409
  - `shadow` qualifies the source and emits a read-only queue submission plan;
@@ -423,12 +424,12 @@ The reusable `public-ops-dev-auto-merge.yml` supports three explicit rollout mod
423
424
  timestamped proof bytes, but it retains the immutable active Warrant and its
424
425
  originally selected proof instead of rewriting or rejecting that attempt.
425
426
  Each candidate also retains the exact successful source workflow run. If a
426
- controller discovers that another candidate owns the active Warrant, a
427
- configured consumer workflow is dispatched immediately for that exact PR,
427
+ controller discovers that another candidate owns the active Warrant, an
428
+ admitted internal continuation is dispatched immediately for that exact PR,
428
429
  head, source run, Assignment and Initiative, source identity and patch,
429
430
  plan, closure, dependency, toolchain, environment, affected paths, delivery
430
431
  class, and priority; the candidate is not left waiting for a patrol cron.
431
- The shipped Buildchain caller and native template configure this handoff path
432
+ The internal workflow and native fixture configure this handoff path
432
433
  and accept the same complete input contract. A historical phase-less owner
433
434
  uses the distinct `legacy-phase-less-active-owner` command path. That path
434
435
  carries the exact queue state root observed before its duplicate submission,
@@ -1,26 +1,32 @@
1
1
  ---
2
- status: preview
2
+ status: active
3
3
  period: ongoing
4
4
  theme: dev-qualification-patrol
5
- doc_type: architecture-and-usage
5
+ doc_type: technical-reference
6
6
  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-08-03
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-03
16
- visible_context: Existing Buildchain Shifu Gate receipts, Kungfu Dev Patrol, Alpha preflight, candidate patrol, and GitHub failed-job rerun semantics.
17
- invisible_context_boundary: No credentials, private logs, or private configuration were used.
15
+ generated_at: 2026-09-20
16
+ visible_context: Current workflow taxonomy, shared consumer entry contract, and retained internal qualification controller.
17
+ invisible_context_boundary: No new hosted qualification or external consumer migration is claimed.
18
18
  ---
19
19
 
20
- # Dev Qualification Patrol
20
+ # Internal Dev Qualification Patrol
21
21
 
22
- Buildchain provides a reusable controller for repositories whose development
23
- branch advances faster than a heavy cross-platform qualification workflow can
22
+ This document describes the internal
23
+ [`.ops-dev-qualification-patrol.yml`](../.github/workflows/.ops-dev-qualification-patrol.yml)
24
+ component. Consumers use the generated normal and attempt recovery callers;
25
+ they do not add a patrol workflow, schedule, dispatch payload, or controller
26
+ script. See the [Golden Path](getting-started.md).
27
+
28
+ The retained controller handles internal qualification for a development
29
+ branch that advances faster than a heavy cross-platform qualification workflow can
24
30
  settle. The controller keeps no external queue. On every wakeup it derives the
25
31
  only pending item from the current source-branch head and maintains these
26
32
  states:
@@ -45,14 +51,13 @@ without consuming the shared native runners.
45
51
 
46
52
  ## Exact-source and priority contract
47
53
 
48
- Call `.github/workflows/public-ops-dev-qualification-patrol.yml` from a thin consumer
49
- workflow after the lightweight preflight, Dev Patrol, and declared priority
50
- workflows complete. Add an offset schedule as recovery for delayed or missed
51
- GitHub events. Repeated wakeups are idempotent.
54
+ Internal orchestration owns wakeups from preflight, qualification and priority
55
+ workflow completion. Repeated wakeups are idempotent. Event recovery belongs
56
+ to the runtime; this component does not require an extra consumer caller.
52
57
 
53
58
  The controller requires a successful preflight whose `head_sha` equals the
54
59
  current source head. It dispatches the heavy workflow on the source branch and
55
- adds a controller-owned `source-sha` input. The consumer must reject the run
60
+ adds a controller-owned `source-sha` input. The internal qualification adapter must reject the run
56
61
  before qualification if that input differs from the workflow event SHA. This
57
62
  closes the race where the branch advances between observation and workflow
58
63
  startup. The heavy reusable Gate workflow then receives the exact SHA as its
@@ -97,10 +102,10 @@ is false. Before writing, it re-resolves the branch and all workflow state and
97
102
  requires the action and source SHA to match the read-only observation. A race
98
103
  fails closed and the next event recomputes from current truth.
99
104
 
100
- Start a consumer in dry-run mode. Its observation and mutation decisions are
101
- retained as exact-source artifacts with a canonical decision root. Enabling
102
- mutation requires a repository token that can write Actions; no contents,
103
- pull-request, tag, release, package, or publication permission is used.
105
+ The internal dry-run mode retains observation and mutation decisions as
106
+ exact-source artifacts with a canonical decision root. Its separately scoped
107
+ mutation credential can write Actions; it does not receive contents,
108
+ pull-request, tag, release, package, or publication authority.
104
109
 
105
110
  The controller does not merge a PR, publish an Alpha, create a tag, create a
106
111
  release, or settle a Release Passport. Once Dev and Alpha preflight evidence
@@ -6,163 +6,104 @@ doc_type: technical-guide
6
6
  source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
- evidence_grade: A
9
+ evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-08
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-08
16
- invisible_context: not asserted
15
+ generated_at: 2026-09-20
16
+ visible_context: Schema-2 initializer, shared caller generator and local validation code.
17
+ invisible_context_boundary: Initialization does not prove hosted publication or provider authorization.
17
18
  ---
18
19
 
19
20
  # Buildchain Golden Path
20
21
 
21
- This path is for a repository maintainer adopting Buildchain for the first
22
- time. It takes about 15–30 minutes and ends with five inspectable outcomes: an
23
- exact package pin, a declared project type, a valid local configuration, a thin
24
- reusable workflow caller, and a Release Passport inspection.
22
+ A consumer owns its product source and one schema-2 TOML declaration.
23
+ Buildchain generates two product-independent YAML callers: normal execution
24
+ and exact-attempt recovery. The published runtime owns delivery and publication.
25
25
 
26
- Use this page for the first successful pass. Move to the advanced manuals only
27
- after the local checks below are green.
26
+ ## Install and initialize
28
27
 
29
- ## 1. Create a clean consumer and install an exact version
28
+ In an existing npm product repository with a version in `package.json`:
30
29
 
31
- ```bash
32
- consumer_dir="$(mktemp -d)"
33
- cd "$consumer_dir"
34
- npm init -y
35
- buildchain_version="$(npm view @kungfu-tech/buildchain version)"
36
- pnpm add -D "@kungfu-tech/buildchain@$buildchain_version"
37
- pnpm exec buildchain --version
30
+ ```sh
31
+ pnpm add -D --save-exact @kungfu-tech/buildchain
32
+ pnpm exec buildchain init --type npm --package-manager pnpm
38
33
  ```
39
34
 
40
- The package manager records the exact resolved version in `package.json` and
41
- the lockfile. Review that version before committing it; do not leave a floating
42
- range in a release repository.
35
+ Use `--type binary` for a CMake product or `--type paper` for a PDF product.
36
+ `package`, `native`, and `publication-artifact` select the corresponding product
37
+ kind. `anchored-package` selects an npm product whose version is changed by a
38
+ reviewed source update rather than automatic version rewriting.
43
39
 
44
- ## 2. Choose the project type and initialize
40
+ Initialization writes:
45
41
 
46
- Start with `package` for a Node package. Other supported types are `native`,
47
- `web-surface`, `infra-contract`, `publication-artifact`, and
48
- `anchored-package`.
42
+ - `.buildchain/buildchain.toml`: products, artifacts, publication targets,
43
+ version files, channel routes and protected review policy;
44
+ - `.github/workflows/buildchain.yml`: the normal `public-ops-pipeline.yml` caller;
45
+ - `.github/workflows/buildchain-recover.yml`: the `public-ops-recover.yml` caller;
46
+ - a managed consumer section in `AGENTS.md`;
47
+ - `release.json` as version source when a binary or Paper product has no package version.
49
48
 
50
- ```bash
51
- pnpm exec buildchain init --type package --package-manager pnpm
52
- ```
53
-
54
- Inspect the two generated files before continuing:
55
-
56
- ```bash
57
- sed -n '1,220p' .buildchain/buildchain.toml
58
- sed -n '1,220p' .github/workflows/build.yml
59
- ```
60
-
61
- `buildchain.toml` owns repository lifecycle declarations. The workflow is a
62
- thin caller of Buildchain's reusable workflow; it is not a second release
63
- implementation.
49
+ Both YAML files are byte-identical across npm, binary and Paper projects.
50
+ Edit product install, build, verification and artifact declarations in TOML to
51
+ match your existing source. Keep the generated caller bytes unchanged. There
52
+ are no consumer publication commands, hidden controller scripts or provider
53
+ request payloads to maintain.
64
54
 
65
- ## 3. Validate the local contract
55
+ ## Validate locally
66
56
 
67
- ```bash
68
- pnpm exec buildchain validate \
69
- --require-version-state \
70
- --require-lifecycle-stages install,build,verify
57
+ ```sh
58
+ pnpm exec buildchain validate --require-version-state
71
59
  pnpm exec buildchain doctor --json
72
60
  ```
73
61
 
74
- If the generated lifecycle commands do not match the repository, edit only
75
- `.buildchain/buildchain.toml`, then rerun both checks. See
76
- [Lifecycle Protocol](lifecycle-protocol.md) for the normative fields.
77
-
78
- ## 4. Inspect the reusable workflow and release dry-run
79
-
80
- The generated caller contains one reusable `uses:` edge and no inputs.
81
- Project choices belong in `.buildchain/buildchain.toml`; `@v4` or `@v4-alpha`
82
- selects the runtime channel:
83
-
84
- ```bash
85
- rg -n 'uses:' .github/workflows/build.yml
86
- pnpm exec buildchain release --dry-run \
87
- --target-ref alpha/v4/v4.0 \
88
- --json
89
- ```
90
-
91
- The dry-run explains legal source refs, tags, version state, and publication
92
- effects. It does not move refs, edit files, or publish packages.
93
-
94
- ## 5. Create and inspect a local Release Passport example
95
-
96
- This example creates a source-bound local Passport through the public Node API,
97
- then reads it through the CLI. It is learning evidence, not publication
98
- authority.
99
-
100
- ```bash
101
- mkdir -p .buildchain/golden-path
102
- node --input-type=module <<'EOF'
103
- import fs from "node:fs";
104
- import { createReleasePassport } from "@kungfu-tech/buildchain";
105
-
106
- const passport = createReleasePassport({
107
- repository: "example/consumer",
108
- tag: "v0.1.0-alpha.0",
109
- sourceSha: "a".repeat(40),
110
- assets: [{ name: "consumer.tgz", sha256: "b".repeat(64) }],
111
- });
112
- fs.writeFileSync(
113
- ".buildchain/golden-path/buildchain.release.json",
114
- `${JSON.stringify(passport, null, 2)}\n`,
115
- );
116
- EOF
117
-
118
- pnpm exec buildchain inspect release \
119
- --passport .buildchain/golden-path/buildchain.release.json \
120
- --json
121
- ```
122
-
123
- For a real release, the protected Buildchain workflow creates the Passport from
124
- the exact source, artifact, controller, and publication evidence. See
125
- [Release Passport](release-passport.md); do not promote this local example.
126
-
127
- ## You are done when
128
-
129
- - the dependency and lockfile contain one exact Buildchain version;
130
- - `.buildchain/buildchain.toml` declares the intended project type and lifecycle;
131
- - `validate` and `doctor` succeed;
132
- - `.github/workflows/build.yml` remains a thin reusable-workflow caller;
133
- - the release dry-run and local Passport inspection both return structured output.
134
-
135
- The repository test `pnpm run check:golden-path` reproduces this path in a new
136
- temporary consumer using the locally packed Buildchain package.
137
-
138
- ## Choose the next manual
139
-
140
- | Intent | Next page |
141
- | --- | --- |
142
- | Change lifecycle commands or version files | [Lifecycle Protocol](lifecycle-protocol.md) |
143
- | Configure native matrices, runners, caches, or artifacts | [Reusable Build Surface](reusable-build-surface.md) |
144
- | Look up a command | [Generated CLI Reference](cli-reference.md) |
145
- | Import the Node toolkit | [Generated Node API Reference](node-api-reference.md) |
146
- | Understand protected branches and tags | [Release Flow](release-flow.md) |
147
- | Verify published evidence | [Release Passport](release-passport.md) |
148
-
149
- ## Troubleshooting
150
-
151
- - `already exists`: initialization is no-overwrite by default. Inspect the
152
- existing files; use `--force` only for an intentional replacement.
153
- - missing lifecycle stage: add the named stage to
154
- `.buildchain/buildchain.toml`; do not weaken the validation command.
155
- - package release-age policy: add a temporary, package-and-version-specific
156
- `minimumReleaseAgeExclude`, then remove it after the normal window.
157
- - unsure about syntax: run `buildchain <path> --help`. Help is intercepted
158
- before command dispatch and is side-effect free at every governed path.
159
-
160
- ## Small glossary
161
-
162
- - **project type**: the repository shape selected by `buildchain init`.
163
- - **lifecycle**: repository-owned install, build, verify, and publish commands.
164
- - **reusable workflow**: Buildchain-owned GitHub Actions control plane called by
165
- a thin consumer workflow.
166
- - **Release Passport**: source- and artifact-bound release evidence, not a
167
- release trigger.
168
- - **train ref**: a temporary validation runtime; never a production dependency.
62
+ For npm products, `--require-lifecycle-stages install,build,verify` also checks
63
+ that every product declares those commands. Binary and Paper products can omit
64
+ an install stage. Run your product's declared build and verification commands
65
+ before opening the first PR.
66
+
67
+ `validate` checks the schema, declared version sources and both caller files.
68
+ `doctor` also checks the Git repository and, for npm products, package-manager
69
+ discovery. Local success establishes configuration validity; hosted qualification
70
+ and publication have their own source-bound results.
71
+
72
+ ## Use the normal release path
73
+
74
+ Commit the generated files and product source. Complete repository permissions,
75
+ branch protection, independent reviewer configuration and provider authorization
76
+ once. When present, tool-maintained stable and Alpha contract locks select the
77
+ published runtime. Without a lock, the published entry uses its own exact runtime
78
+ commit; initialization does not invent a lock or require one to select that default.
79
+ Existing npm Trusted Publishing remains in use; normal releases do not require
80
+ an interactive npm login or a manually supplied publishing token.
81
+
82
+ Open a PR along a route declared in TOML: a feature branch into development,
83
+ development into Alpha, or Alpha into release. The same normal caller handles
84
+ build, protected delivery, publication, provider readback and next-development.
85
+ Follow the workflow's actual result and published Release Passport.
86
+
87
+ For an interrupted attempt, run `buildchain-recover.yml` with its exact attempt.
88
+ Supply a repaired runtime only when a runtime repair is needed. Do not supply
89
+ replacement source, artifacts or provider-effect parameters.
90
+
91
+ ## Migrating old callers
92
+
93
+ Schema-1 product-specific workflow callers are not generated by this initializer.
94
+ The old `web-surface` and `infra-contract` initialization modes are outside the
95
+ current schema-2 npm/binary/Paper pipeline; initialization rejects them before
96
+ writing files. Their internal product modules remain available to maintainers.
97
+
98
+ Existing unrelated workflows or conflicting files stop initialization before
99
+ any write. `--force` replaces the declared generated files only; it does not
100
+ delete other workflows or follow symlinks. Move product commands into TOML and
101
+ remove obsolete consumer orchestration as part of an explicit migration.
102
+
103
+ See the [standard examples](../templates/minimal-consumer/),
104
+ [workflow catalog](workflow-catalog.md), [CLI reference](cli-reference.md), and
105
+ [Release Passport](release-passport.md).
106
+
107
+ `pnpm run check:golden-path` packs the local package, installs it in a temporary
108
+ consumer, initializes and validates the shared caller pair, and executes the
109
+ fixture product build and check. It performs no hosted publication.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  status: draft
3
- period: 2026-07
3
+ period: ongoing
4
4
  theme: buildchain-linux-artifact-provenance
5
5
  doc_type: protocol
6
6
  source_level: code-and-official-docs
@@ -8,17 +8,23 @@ 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-07-24
16
- visible_context: Buildchain source, tests, GitHub Actions documentation, and actions/attest documentation
17
- invisible_context: Model internals and provider-side implementation details are not visible
15
+ generated_at: 2026-09-20
16
+ visible_context: Current Buildchain taxonomy and consumer contract, retained attestation implementation and protocol documentation.
17
+ invisible_context_boundary: No fresh provider attestation or hosted qualification is asserted by this documentation update.
18
18
  ---
19
19
 
20
20
  # GitHub-native Linux Artifact Attestation
21
21
 
22
+ This is an internal protocol reference. Consumers use the generated normal and
23
+ recovery callers described in the [Golden Path](getting-started.md); they do
24
+ not add a promotion or attester workflow, prepare policy JSON, or select source
25
+ and artifact roots. The retained internal component is
26
+ [`.release-artifact-attestation.yml`](../.github/workflows/.release-artifact-attestation.yml).
27
+
22
28
  Buildchain can bind a Linux release artifact to its original compiler run, exact
23
29
  source revision, platform manifest, Release Passport, and an immutable
24
30
  Buildchain attester workflow. GitHub's OIDC identity and artifact attestation
@@ -68,7 +74,7 @@ still binding both directions.
68
74
 
69
75
  ## GitHub Permissions and Runtime Pins
70
76
 
71
- Both caller and reusable workflow grant only:
77
+ The internal attester invocation and its reusable component grant only:
72
78
 
73
79
  ```yaml
74
80
  permissions:
@@ -85,9 +91,11 @@ itself must also be called at its exact signer-bootstrap commit. The signer
85
91
  commit and the later Buildchain runtime commit are separately bound so the
86
92
  first v3 integration never relies on a mutable or self-referential workflow ref.
87
93
 
88
- ## Prepare the Release Passport
94
+ ## Internal Release Passport preparation
89
95
 
90
- Create one input document for each Linux artifact and seal it as a policy:
96
+ The runtime owns policy preparation. Maintainers can inspect the retained
97
+ policy contract with the following low-level tooling; these commands are not
98
+ consumer lifecycle steps. One input document describes each Linux artifact:
91
99
 
92
100
  ```bash
93
101
  buildchain create github-artifact-attestation-policy \
@@ -110,74 +118,17 @@ buildchain collect github-release \
110
118
  # ...the existing release inputs
111
119
  ```
112
120
 
113
- The build, Passport, and attestation jobs must stay in the same workflow run.
114
- The release-candidate build declares both the subject and the already-merged
115
- signer bootstrap commit. The Buildchain runtime remains the exact runtime ref
116
- used by the build workflow and may be a later commit:
117
-
118
- ```yaml
119
- with:
120
- github-artifact-attestation-subject-path: dist/kungfu-linux-x64.tar.gz
121
- github-artifact-attestation-signer-sha: <exact-signer-bootstrap-sha>
122
- github-artifact-attestation-platform-id: linux-x64
123
- ```
124
-
125
- For release promotion, prefer the integrated v3 route. The policy must already
126
- be present in the downloaded release-candidate payload:
127
-
128
- ```yaml
129
- permissions:
130
- actions: write
131
- artifact-metadata: write
132
- attestations: write
133
- checks: write
134
- contents: write
135
- id-token: write
136
- issues: write
137
-
138
- jobs:
139
- promote:
140
- uses: kungfu-systems/buildchain/.github/workflows/public-release-promote.yml@v4
141
- with:
142
- github-release: true
143
- release-passport: true
144
- github-artifact-attestation-policy-json: .buildchain/release-candidate/payload/<artifact>/policy.json
145
- github-artifact-attestation-environment: buildchain-artifact-attestation
146
- ```
147
-
148
- Promotion binds the policy into the Passport, stages only digest-matching data,
149
- calls the public signer entry, verifies the provider identity a second time, and
150
- publishes immutable bundle, predicate, verification, evidence, and receipt
151
- assets beside the release artifact. A same-name Release asset with different
152
- bytes is rejected instead of overwritten.
153
-
154
- Low-level callers may call the reusable attester directly after their Passport
155
- job. The public entry selects the execution runtime through the same contract as
156
- build and release. Provider signer identity and subject digests remain mandatory:
121
+ The retained attestation mechanism binds the original compiler execution,
122
+ sealed candidate payload, platform manifest and Passport. Internal promotion
123
+ stages only digest-matching data, invokes the internal signer, verifies provider
124
+ identity, and retains the bundle, predicate, verification evidence and receipt.
125
+ A same-name published asset with different bytes is rejected.
157
126
 
158
- ```yaml
159
- jobs:
160
- attest-linux:
161
- needs: [build-linux, release-passport]
162
- permissions:
163
- actions: read
164
- artifact-metadata: write
165
- attestations: write
166
- contents: read
167
- id-token: write
168
- uses: kungfu-systems/buildchain/.github/workflows/public-release-artifact-attestation.yml@v4
169
- with:
170
- evidence-run-id: ${{ github.run_id }}
171
- source-sha: ${{ github.sha }}
172
- subject-artifact-name: linux-release
173
- subject-relative-path: libnode-linux-x64.tar.gz
174
- platform-manifest-artifact-name: linux-platform-manifest
175
- platform-manifest-relative-path: manifest.json
176
- release-passport-artifact-name: release-passport
177
- release-passport-relative-path: buildchain.release.json
178
- policy-json: ${{ needs.release-passport.outputs.github-attestation-policy-json }}
179
- evidence-artifact-name: linux-attestation-evidence
180
- ```
127
+ Signer bootstrap identity and the runtime used to build the product remain
128
+ separate immutable facts. These fields are derived and checked inside the
129
+ runtime. Neither `public-release-promote.yml` nor
130
+ `public-release-artifact-attestation.yml` is a current consumer API; new wiring
131
+ must not copy the former v3 input sets into an extra workflow.
181
132
 
182
133
  ## Verify Online and Offline
183
134
 
@@ -209,8 +160,7 @@ expected statement, or GitHub reports a self-hosted signer.
209
160
 
210
161
  ## Qualification Policy
211
162
 
212
- New protocol work qualifies on the Buildchain v3 alpha line first. The v2
213
- development branch is not a supported landing target. Production
214
- adoption waits for the exact v3 implementation commit to pass the repository
215
- suite and a real GitHub OIDC/Sigstore qualification run, including the negative
216
- cases above. A successful local fixture is necessary but not sufficient.
163
+ Protocol changes land through the protected `dev/v4/v4.1` workflow and require
164
+ qualification of the exact published runtime before consumer adoption. Local
165
+ fixtures validate the protocol's negative cases; they do not substitute for a
166
+ real GitHub OIDC/Sigstore qualification run or prove provider publication.