@kungfu-tech/buildchain 4.0.2-alpha.8 → 4.0.2

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 (157) hide show
  1. package/AGENTS.md +10 -1
  2. package/CONTRIBUTING.md +24 -0
  3. package/README.md +2 -2
  4. package/actions/promote-buildchain-ref/README.md +1 -1
  5. package/actions/v4-release-candidate-promote/README.md +28 -0
  6. package/architecture/agent-change-map.md +64 -7
  7. package/architecture/ci-lane-change-budget.json +366 -0
  8. package/architecture/internal-capabilities.json +53 -8
  9. package/architecture/maintainability-debt.json +147 -93
  10. package/architecture/maintainability-policy.json +32 -28
  11. package/architecture/release-tail-contract-inventory.json +6 -6
  12. package/architecture/v4-architecture-constitution.md +23 -20
  13. package/architecture/v4-cross-platform-adopter-qualification.json +1 -1
  14. package/architecture/v4-delivery-authority-parity.json +2 -2
  15. package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.json +1 -1
  16. package/architecture/v4-floating-consumer-policy.json +2 -2
  17. package/architecture/v4-next-development-parity.json +5 -5
  18. package/architecture/v4-partial-mutation-recovery-qualification.json +4 -1
  19. package/architecture/v4-platform-stage-checkpoints.json +1 -1
  20. package/architecture/v4-provider-operation-journal-contract.json +5 -2
  21. package/architecture/v4-publication-facade-patches.json +64 -0
  22. package/architecture/v4-release-activation-shadow-domain.json +5 -2
  23. package/architecture/v4-release-topology.json +74 -39
  24. package/architecture/v4-rust-wasm-production-authority.json +58 -0
  25. package/architecture/v4-stable-publication-fence.json +5 -2
  26. package/architecture/v4-stage-capsule-qualification.json +2 -2
  27. package/architecture/v4-tail-reseal-parity.json +8 -6
  28. package/architecture/v4-universal-workflow-bootstrap.json +171 -0
  29. package/architecture/v4-universal-workflow-fault-campaign.json +72 -0
  30. package/architecture/v4-universal-workflow-train-admission.json +40 -0
  31. package/architecture/workflow-taxonomy.json +1451 -0
  32. package/bin/buildchain.mjs +7 -7
  33. package/contracts/buildchain-v2-residuals-v1.json +57 -48
  34. package/contracts/dev-delivery-authority-v2.schema.json +16 -2
  35. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  36. package/contracts/v4-canonical-contracts-v1.schema.json +1 -0
  37. package/dist/site/buildchain-contract.json +93 -48
  38. package/dist/site/buildchain-site.json +222 -69
  39. package/dist/site/capability-registry.json +4 -4
  40. package/dist/site/controller-registry.json +50 -13
  41. package/dist/site/kfd-claims.json +2585 -1000
  42. package/dist/site/kfd-upstream-aggregate.json +1 -1
  43. package/dist/site/manual-registry.json +13 -13
  44. package/dist/site/node-api-registry.json +120 -115
  45. package/dist/site/page-registry.json +204 -51
  46. package/dist/site/public-surface-audit.json +3205 -1219
  47. package/dist/site/publication-authority-registry.json +1124 -362
  48. package/dist/site/publication-registry.json +4 -4
  49. package/dist/site/schemas/dev-delivery-authority-v2.schema.json +16 -2
  50. package/dist/site/site-manifest.json +17 -17
  51. package/dist/site/workflow-registry.json +5061 -1659
  52. package/docs/MAP.md +1 -0
  53. package/docs/auditable-demo.md +1 -1
  54. package/docs/cli.md +21 -8
  55. package/docs/dev-delivery-warrant.md +1 -1
  56. package/docs/engineering-housekeeper.md +3 -3
  57. package/docs/kfd-support.md +26 -2
  58. package/docs/next-development-transition.md +2 -2
  59. package/docs/node-api-reference.md +190 -190
  60. package/docs/publication-authority.md +2 -2
  61. package/docs/release-candidate.md +3 -3
  62. package/docs/release-flow.md +67 -19
  63. package/docs/release-governance.md +8 -8
  64. package/docs/release-passport.md +27 -2
  65. package/docs/reusable-build-surface.md +16 -0
  66. package/docs/v4-adopter-delivery.md +2 -2
  67. package/docs/v4-production-release.md +71 -8
  68. package/docs/v4-rust-wasm-production-authority.md +58 -0
  69. package/docs/v4-stage-capsule.md +2 -2
  70. package/docs/v4-tail-reseal.md +1 -1
  71. package/docs/workflow-catalog.md +154 -0
  72. package/docs/workflow-path-migration.md +109 -0
  73. package/package.json +10 -6
  74. package/packages/core/artifact-verification-envelope.js +5 -5
  75. package/packages/core/buildchain-contract.js +1 -1
  76. package/packages/core/buildchain-kfd-claims.js +2 -2
  77. package/packages/core/buildchain-publication-authority.js +42 -26
  78. package/packages/core/buildchain-v4-domain.wasm +0 -0
  79. package/packages/core/ci-lane-change-budget.js +14 -1
  80. package/packages/core/controller-evidence.js +4 -1
  81. package/packages/core/dev-delivery-candidate-identity.js +40 -6
  82. package/packages/core/dev-delivery-warrant-state.js +3 -4
  83. package/packages/core/dev-delivery-warrant.js +12 -2
  84. package/packages/core/github-governance-authority.js +4 -4
  85. package/packages/core/kfd-adopter-manifest.js +46 -47
  86. package/packages/core/next-development-projection.js +2 -2
  87. package/packages/core/paper-agent-entry.js +30 -4
  88. package/packages/core/paper-fleet.js +1 -1
  89. package/packages/core/paper-runtime-channels.js +348 -0
  90. package/packages/core/paper-scaffold-content.js +10 -0
  91. package/packages/core/paper.js +37 -71
  92. package/packages/core/release-line-dry-run.js +1 -1
  93. package/packages/core/release-passport-contract.js +5 -5
  94. package/packages/core/release-passport.js +5 -4
  95. package/packages/core/release-tail-provider-plane.js +68 -1048
  96. package/packages/core/v4-canonical-contracts.js +10 -75
  97. package/packages/core/v4-domain-wasm-artifact.js +7 -0
  98. package/packages/core/v4-domain-wasm.js +216 -0
  99. package/packages/core/v4-floating-consumer-evidence.js +1 -1
  100. package/packages/core/v4-floating-consumer-policy.js +1 -1
  101. package/packages/core/v4-partial-mutation-recovery-qualification.js +9 -386
  102. package/packages/core/v4-product-publication.js +19 -349
  103. package/packages/core/v4-protected-publication-source.js +19 -21
  104. package/packages/core/v4-provider-operation-journal.js +18 -487
  105. package/packages/core/v4-provider-readback-idempotency.js +12 -97
  106. package/packages/core/v4-release-activation-shadow.js +13 -500
  107. package/packages/core/v4-release-invocation.js +28 -389
  108. package/packages/core/v4-stable-publication-fence.js +13 -342
  109. package/packages/core/v4-universal-workflow-bootstrap.js +586 -0
  110. package/scripts/binary-publication-evidence.mjs +135 -0
  111. package/scripts/build-contract-core.mjs +1 -14
  112. package/scripts/build-v4-domain-wasm.mjs +189 -0
  113. package/scripts/check-action-bundles.mjs +12 -2
  114. package/scripts/check-ci-lane-change-budget.mjs +4 -1
  115. package/scripts/check-core-mechanism-inventory.mjs +4 -3
  116. package/scripts/check-inventory.mjs +35 -44
  117. package/scripts/check-maintainability.mjs +16 -113
  118. package/scripts/check-v4-floating-consumer-policy-contract.mjs +2 -2
  119. package/scripts/check-v4-public-dogfood-contract.mjs +22 -9
  120. package/scripts/check-v4-release-topology.mjs +90 -33
  121. package/scripts/check-v4-runtime-semantic-closure.mjs +4 -1
  122. package/scripts/check-v4-universal-workflow-bootstrap.mjs +266 -0
  123. package/scripts/check-workflow-taxonomy.mjs +6 -0
  124. package/scripts/copy-v4-domain-wasm.mjs +14 -0
  125. package/scripts/dev-delivery-authority-command-adapters.mjs +1 -1
  126. package/scripts/dev-delivery-authority.mjs +8 -8
  127. package/scripts/dev-delivery-source-proof-reuse.mjs +2 -1
  128. package/scripts/dev-delivery-warrant-options.mjs +14 -9
  129. package/scripts/dev-delivery-warrant-store.mjs +73 -7
  130. package/scripts/dev-delivery-warrant-transition.mjs +109 -0
  131. package/scripts/dev-delivery-warrant.mjs +76 -99
  132. package/scripts/dev-pr-auto-merge.mjs +15 -15
  133. package/scripts/generate-channel-build-workflow.mjs +7 -2
  134. package/scripts/generate-channel-promotion-workflow.mjs +7 -5
  135. package/scripts/generate-site-bundle.mjs +11 -11
  136. package/scripts/generate-v4-universal-workflow-facades.mjs +458 -0
  137. package/scripts/generate-workflow-taxonomy.mjs +25 -0
  138. package/scripts/github-output.mjs +31 -0
  139. package/scripts/maintainability-metrics.mjs +16 -5
  140. package/scripts/maintainability-public-surface.mjs +115 -0
  141. package/scripts/next-development-review.mjs +307 -0
  142. package/scripts/paper-work-fleet-cli.mjs +2 -0
  143. package/scripts/release-asset-client.mjs +91 -0
  144. package/scripts/release-candidate-resolver.mjs +9 -9
  145. package/scripts/source-verification-evidence.mjs +344 -0
  146. package/scripts/stable-candidate-qualification.mjs +1 -1
  147. package/scripts/universal-facade-maintainability.mjs +82 -0
  148. package/scripts/v4-product-publication-intent.mjs +13 -6
  149. package/scripts/v4-publication-settlement.mjs +211 -0
  150. package/scripts/v4-universal-workflow-backflow.mjs +212 -0
  151. package/scripts/v4-universal-workflow-engine.mjs +618 -0
  152. package/scripts/v4-universal-workflow-self-dogfood.mjs +205 -0
  153. package/scripts/verify-version-state-delta.mjs +173 -0
  154. package/scripts/workflow-taxonomy.mjs +507 -0
  155. package/templates/native-dev-delivery.yml +4 -7
  156. package/templates/universal-buildchain-bootstrap-recovery.yml +282 -0
  157. package/templates/universal-buildchain-bootstrap.yml +28 -0
package/docs/MAP.md CHANGED
@@ -37,6 +37,7 @@ running artifact), *use* (consume / extend) - and a **status**:
37
37
  | First-time repository adopter | [Golden Path](getting-started.md) | [Lifecycle Protocol](lifecycle-protocol.md) only when the generated defaults need changes |
38
38
  | CLI operator or agent | [Generated CLI Reference](cli-reference.md) | [CLI guide](cli.md) for concepts and worked examples |
39
39
  | Node toolkit developer | [Generated Node API Reference](node-api-reference.md) | [Core package guide](../packages/core/README.md) for recipes |
40
+ | Workflow contributor | [Workflow Catalog](workflow-catalog.md) | [Contribution rules](../CONTRIBUTING.md#workflow-organization) and the [exact registry](../architecture/workflow-taxonomy.json) |
40
41
  | Build/release operator | [Reusable Build Surface](reusable-build-surface.md) | [Release Flow](release-flow.md) and [Release Passport](release-passport.md) |
41
42
  | Product/trust reviewer | [Product Mechanism](product-mechanism.md) | [Release Passport](release-passport.md) and [KFD Support](kfd-support.md) |
42
43
 
@@ -139,7 +139,7 @@ jobs:
139
139
  ```
140
140
 
141
141
  Buildchain recursively consumes this surface in
142
- `.github/workflows/auditable-demo.yml` using its own exact standalone binary
142
+ `.github/workflows/self-build-demo-dogfood.yml` using its own exact standalone binary
143
143
  and the beginner bootstrap scenario in `.buildchain/auditable-demo.json`.
144
144
 
145
145
  ## Authority Boundary
package/docs/cli.md CHANGED
@@ -8,11 +8,11 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-07-31
11
+ last_reviewed: 2026-09-06
12
12
  ai_provenance:
13
- model_family: GPT-5
13
+ model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-07-31
15
+ generated_at: 2026-09-06
16
16
  invisible_context: not asserted
17
17
  ---
18
18
 
@@ -165,17 +165,30 @@ The safety and authority boundary is explicit:
165
165
  - `migrate` plans the Buildchain-owned authority, workflow, contract lock,
166
166
  version pin, package, agent-entry policy, managed `AGENTS.md` section, and
167
167
  required-check changes needed by an existing paper repository. It pins an
168
- exact v3 dependency and adds pnpm-backed paper scripts.
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.
169
178
  Add `--write` only after reviewing exact old and new digests; paper content
170
179
  and publication configuration are never rewritten. Refresh
171
180
  `pnpm-lock.yaml` with `pnpm install --lockfile-only` after a write.
172
181
  - `agent verify` is the mandatory resume check on an existing work branch. It
173
182
  verifies the digest-bound `.buildchain/paper/agent-entry.json`, the single
174
- managed `AGENTS.md` section, exact package scripts and v3 dependency, runtime
183
+ managed `AGENTS.md` section, exact package scripts and runtime dependency, runtime
175
184
  source SHA, development target, and current branch lineage. `--ci` derives
176
185
  the pull-request source and target from GitHub context and fails closed on a
177
186
  non-work source branch or a target other than the configured development
178
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.
179
192
  - `work start` derives the protected development branch from the configured
180
193
  publication semver line and creates a safe local work branch only when the
181
194
  worktree is clean, the sole `origin` is the canonical `kungfu-systems`
@@ -1044,7 +1057,7 @@ and package identity. See [`v4-adopter-delivery.md`](v4-adopter-delivery.md).
1044
1057
  ## npm Publish Gate
1045
1058
 
1046
1059
  Buildchain's own npm package is published from
1047
- `.github/workflows/buildchain-ref-promotion.yml`, inside the same publish
1060
+ `.github/workflows/self-release-promote.yml`, inside the same publish
1048
1061
  transaction that promotes release refs:
1049
1062
 
1050
1063
  - `v4.0.3-alpha.0` publishes to npm with dist-tag `alpha`.
@@ -1070,9 +1083,9 @@ Before the first real release, configure npm Trusted Publishing for:
1070
1083
 
1071
1084
  - package: `@kungfu-tech/buildchain`
1072
1085
  - repository: `kungfu-systems/buildchain`
1073
- - workflow: `.github/workflows/buildchain-ref-promotion.yml`
1086
+ - workflow: `.github/workflows/self-release-promote.yml`
1074
1087
 
1075
1088
  No npm package is published by manual dispatch or ordinary branch builds.
1076
- Manual dispatch on `.github/workflows/npm-publish.yml` remains dry-run only, so
1089
+ Manual dispatch on `.github/workflows/self-release-npm-dry-run.yml` remains dry-run only, so
1077
1090
  maintainers can verify package contents and npm publish shape before opening or
1078
1091
  merging the release PR.
@@ -506,7 +506,7 @@ shows the same exact PR head is already queued again, so an earlier queue event
506
506
  cannot close a newer active Warrant generation.
507
507
 
508
508
  Buildchain uses the same contract for its own protected dev line through
509
- `buildchain-dev-delivery.yml`. The manual caller requires the exact PR head and
509
+ `self-ops-dev-delivery.yml`. The manual caller requires the exact PR head and
510
510
  semantic source roots, accepts an optional reusable native proof, keeps both
511
511
  the durable public selector and explicit runtime input on `v4-alpha`, selects
512
512
  `delivery-warrant-mode: required`, and targets GitHub Merge Queue. It does not
@@ -158,9 +158,9 @@ to plans, reports, receipts, summaries, or artifacts.
158
158
 
159
159
  Buildchain dogfoods the reusable contract through three thin callers:
160
160
 
161
- - `engineering-housekeeper-daily.yml` uses a 30-day window and a 10-action cap;
162
- - `engineering-housekeeper-weekly.yml` uses a 45-day window and a 20-action cap;
163
- - `engineering-housekeeper-monthly.yml` uses a 60-day window and a 50-action cap.
161
+ - `self-ops-housekeeping-daily.yml` uses a 30-day window and a 10-action cap;
162
+ - `self-ops-housekeeping-weekly.yml` uses a 45-day window and a 20-action cap;
163
+ - `self-ops-housekeeping-monthly.yml` uses a 60-day window and a 50-action cap.
164
164
 
165
165
  All three schedules run unattended apply with repository-wide mainline
166
166
  discovery. They delete only exact merged heads from the positive temporary
@@ -1,3 +1,22 @@
1
+ ---
2
+ status: active
3
+ period: ongoing
4
+ theme: generic-kfd-adopter-binding
5
+ doc_type: reference
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: B
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-09-06
12
+ ai_provenance:
13
+ model_family: GPT-6
14
+ product: Codex
15
+ generated_at: 2026-09-06
16
+ visible_context: Buildchain v3 implementation and v4 source and regression tests.
17
+ invisible_context_boundary: No credentials or private runtime evidence inspected.
18
+ ---
19
+
1
20
  # KFD Support
2
21
 
3
22
  Buildchain implements KFD support as release evidence and product capability
@@ -77,8 +96,13 @@ KFD records and evidence by SHA-256. The result uses
77
96
  `buildchain kfd support project` derives a compatibility projection from the
78
97
  standard adopter manifest and its exact passing gate. The adopter manifest is
79
98
  the sole KFD-1..13 declaration authority; the command rejects stale package,
80
- source, witness, registry, verifier-set, and KFD-4/5/7 gate roots. The emitted
81
- matrix is not an independent declaration and cannot widen adopter claims.
99
+ source, witness, registry, verifier-set, and KFD-4/5/7 gate roots. Gate creation
100
+ accepts an explicit `expectedAdopterId`, `expectedSourceRepository`, and
101
+ `expectedSourceSha`; omitting the first two preserves the Buildchain
102
+ self-release default. The gate, every product-gate projection, the legacy
103
+ matrix, Release Passport, and artifact evidence all retain that exact
104
+ adopter/repository/source closure. The emitted matrix is not an independent
105
+ declaration and cannot widen adopter claims.
82
106
 
83
107
  ## KFD-1
84
108
 
@@ -76,8 +76,8 @@ invalid.
76
76
 
77
77
  ## Public self-dogfood and adoption
78
78
 
79
- `.github/workflows/v4-public-consumer-dogfood.yml` remains the exact thin
80
- consumer of the public `v4-stage-capsule-canary.yml@v4-alpha` contract. Its
79
+ `.github/workflows/self-build-public-consumer-dogfood.yml` remains the exact thin
80
+ consumer of the public `public-build-stage-capsule-canary.yml@v4-alpha` contract. Its
81
81
  declared `lifecycle.verify` runs `pnpm run check`, so the same public path
82
82
  executes pure recovery tests that inject a transient durable-state write
83
83
  failure, restore the adapter operation on a fresh runner, supersede stale work