@kungfu-tech/buildchain 3.0.9-alpha.9 → 4.0.0-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 (262) hide show
  1. package/AGENTS.md +39 -0
  2. package/README.md +17 -13
  3. package/actions/promote-buildchain-ref/README.md +0 -10
  4. package/actions/release-tail/README.md +6 -10
  5. package/architecture/internal-capabilities.json +502 -0
  6. package/architecture/maintainability-baseline.json +59 -0
  7. package/architecture/maintainability-policy.json +1384 -0
  8. package/architecture/release-tail-contract-inventory.json +587 -0
  9. package/architecture/v3-core-mechanism-inventory.json +1043 -0
  10. package/architecture/v3-core-mechanism-inventory.md +67 -0
  11. package/architecture/v4-adopter-delivery-parity.json +47 -0
  12. package/architecture/v4-architecture-constitution.md +210 -0
  13. package/architecture/v4-bootstrap-authority.json +56 -0
  14. package/architecture/v4-canonical-contract-fixtures.json +105 -0
  15. package/architecture/v4-capability-state-machine-manifest.json +480 -0
  16. package/architecture/v4-capability-state-machine-manifest.schema.json +202 -0
  17. package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.json +830 -0
  18. package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.md +223 -0
  19. package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.schema.json +318 -0
  20. package/architecture/v4-delivery-warrant-shadow-fixtures.json +227 -0
  21. package/architecture/v4-delivery-warrant-shadow-fixtures.schema.json +67 -0
  22. package/architecture/v4-exception-ledger.json +5 -0
  23. package/architecture/v4-exception-ledger.schema.json +56 -0
  24. package/architecture/v4-partial-mutation-recovery-qualification.json +65 -0
  25. package/architecture/v4-platform-stage-checkpoints.json +97 -0
  26. package/architecture/v4-provider-operation-journal-contract.json +113 -0
  27. package/architecture/v4-release-activation-shadow-domain.json +61 -0
  28. package/architecture/v4-release-train-parity.json +68 -0
  29. package/architecture/v4-rust-libnode-bridge-evaluation.json +107 -0
  30. package/architecture/v4-rust-libnode-bridge-spike.md +85 -0
  31. package/architecture/v4-stable-publication-fence.json +66 -0
  32. package/architecture/v4-stage-capsule-contract.json +90 -0
  33. package/architecture/v4-stage-capsule-qualification.json +99 -0
  34. package/architecture/v4-stage-capsule-resume-planner.json +52 -0
  35. package/architecture/v4-stage-capsule-store-contract.json +72 -0
  36. package/bin/buildchain.mjs +15 -10
  37. package/contracts/auditable-demo-scenario-v1.schema.json +1 -1
  38. package/contracts/buildchain-v2-residuals-v1.json +2 -2
  39. package/contracts/fixtures/v4-delivery-warrant-trace-v1/golden.json +158 -0
  40. package/contracts/fixtures/v4-delivery-warrant-trace-v1/property.json +380 -0
  41. package/contracts/fixtures/v4-delivery-warrant-trace-v1/replay.json +163 -0
  42. package/contracts/fixtures/v4-partial-mutation-recovery-v1/shared.json +155 -0
  43. package/contracts/fixtures/v4-provider-operation-journal-v1/shared.json +457 -0
  44. package/contracts/fixtures/v4-provider-readback-idempotency-v1/shared.json +682 -0
  45. package/contracts/fixtures/v4-release-activation-shadow-v1/shared.json +53 -0
  46. package/contracts/fixtures/v4-stable-publication-fence-v1/shared.json +56 -0
  47. package/contracts/fixtures/v4-stage-capsule-resume-v1/late-platform-failure.json +176 -0
  48. package/contracts/fixtures/v4-stage-capsule-store-v1/shared.json +132 -0
  49. package/contracts/fixtures/v4-stage-capsule-v1/shared.json +111 -0
  50. package/contracts/v4-canonical-contracts-v1.schema.json +182 -0
  51. package/contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json +284 -0
  52. package/contracts/v4-delivery-warrant-trace-v1.schema.json +215 -0
  53. package/contracts/v4-host-contract-v1.schema.json +135 -0
  54. package/contracts/v4-partial-mutation-recovery-v1.schema.json +168 -0
  55. package/contracts/v4-provider-operation-journal-v1.schema.json +381 -0
  56. package/contracts/v4-release-activation-shadow-v1.schema.json +186 -0
  57. package/contracts/v4-stable-publication-fence-v1.schema.json +125 -0
  58. package/contracts/v4-stage-capsule-resume-v1.schema.json +225 -0
  59. package/contracts/v4-stage-capsule-store-v1.schema.json +154 -0
  60. package/contracts/v4-stage-capsule-v1.schema.json +178 -0
  61. package/crates/buildchain-v4-bridge/Cargo.lock +213 -0
  62. package/crates/buildchain-v4-bridge/Cargo.toml +12 -0
  63. package/crates/buildchain-v4-bridge/src/main.rs +495 -0
  64. package/dist/site/agent-index.json +0 -4
  65. package/dist/site/artifact-schemas.json +0 -8
  66. package/dist/site/buildchain-contract.json +103 -397
  67. package/dist/site/buildchain-site.json +302 -386
  68. package/dist/site/capability-registry.json +9 -11
  69. package/dist/site/cli-registry.json +8 -53
  70. package/dist/site/controller-registry.json +48 -8
  71. package/dist/site/kfd-claims.json +129 -167
  72. package/dist/site/kfd-upstream-aggregate.json +9 -9
  73. package/dist/site/manual-registry.json +18 -49
  74. package/dist/site/node-api-registry.json +4345 -7345
  75. package/dist/site/page-registry.json +278 -346
  76. package/dist/site/public-surface-audit.json +85 -404
  77. package/dist/site/publication-authority-registry.json +11 -1
  78. package/dist/site/publication-registry.json +4 -4
  79. package/dist/site/release-provenance.json +3 -9
  80. package/dist/site/schemas/kfd-support-projection-v1.schema.json +106 -0
  81. package/dist/site/site-manifest.json +22 -38
  82. package/dist/site/workflow-registry.json +78 -35
  83. package/docs/MAP.md +8 -5
  84. package/docs/auditable-demo.md +2 -2
  85. package/docs/aws-us-elastic-runner-burst-plane.md +7 -59
  86. package/docs/cli-reference.md +15 -213
  87. package/docs/cli.md +14 -14
  88. package/docs/dev-alpha-candidate-patrol.md +3 -11
  89. package/docs/dev-delivery-warrant.md +29 -194
  90. package/docs/engineering-housekeeper.md +12 -4
  91. package/docs/getting-started.md +1 -1
  92. package/docs/install.md +5 -5
  93. package/docs/kfd-support.md +2 -7
  94. package/docs/lifecycle-protocol.md +2 -4
  95. package/docs/node-api-reference.md +414 -554
  96. package/docs/release-flow.md +31 -31
  97. package/docs/release-governance.md +16 -28
  98. package/docs/release-passport.md +2 -15
  99. package/docs/release-tail-contract.md +13 -6
  100. package/docs/release-tail-provider-plane.md +13 -19
  101. package/docs/release-train.md +4 -4
  102. package/docs/reusable-build-surface.md +14 -27
  103. package/docs/site-bundle-contract.md +1 -5
  104. package/docs/stable-candidate-patrol.md +7 -7
  105. package/docs/v4-canonical-contracts.md +92 -0
  106. package/docs/v4-delivery-warrant-read-candidate.md +73 -0
  107. package/docs/v4-delivery-warrant-semantic-diff.md +75 -0
  108. package/docs/v4-production-release.md +63 -0
  109. package/docs/v4-stage-capsule.md +193 -0
  110. package/docs/versioning.md +3 -5
  111. package/package.json +19 -19
  112. package/packages/core/adopter-delivery-gate.js +576 -0
  113. package/packages/core/adopter-delivery-json.js +66 -0
  114. package/packages/core/artifact-signing.js +0 -61
  115. package/packages/core/artifact-verification-envelope.js +5 -5
  116. package/packages/core/build-facts.js +12 -4
  117. package/packages/core/buildchain-agent-manuals.js +0 -2
  118. package/packages/core/buildchain-channel-identity.js +3 -2
  119. package/packages/core/buildchain-config.js +4 -69
  120. package/packages/core/buildchain-contract.js +232 -46
  121. package/packages/core/buildchain-kfd-claims.js +1 -1
  122. package/packages/core/channel-candidate.js +0 -8
  123. package/packages/core/channel-promotion-baseline.js +0 -52
  124. package/packages/core/controller-evidence.js +3 -4
  125. package/packages/core/dev-alpha-candidate-selection.js +2 -10
  126. package/packages/core/dev-delivery-warrant-cancellation.js +0 -1
  127. package/packages/core/dev-delivery-warrant-settlement.js +20 -67
  128. package/packages/core/dev-delivery-warrant.js +50 -138
  129. package/packages/core/diagnostics.js +3 -8
  130. package/packages/core/github-governance-authority.js +3 -1
  131. package/packages/core/kfd-adopter-category-driver.js +167 -0
  132. package/packages/core/kfd-adopter-manifest.js +47 -46
  133. package/packages/core/kfd-gate.js +15 -45
  134. package/packages/core/paper-agent-entry.js +7 -16
  135. package/packages/core/paper-fleet.js +2 -2
  136. package/packages/core/paper-repository.js +2 -3
  137. package/packages/core/paper-scaffold-content.js +2 -23
  138. package/packages/core/paper.js +11 -43
  139. package/packages/core/publication-reproducibility.js +4 -4
  140. package/packages/core/release-line-bootstrap.js +21 -8
  141. package/packages/core/release-passport-contract.js +5 -5
  142. package/packages/core/release-passport.js +20 -131
  143. package/packages/core/self-dogfood-version.js +48 -35
  144. package/packages/core/spawn-command.js +232 -8
  145. package/packages/core/v4-adopter-delivery-parity.js +219 -0
  146. package/packages/core/v4-canonical-contracts.js +284 -0
  147. package/packages/core/v4-delivery-warrant-fixture-runner.js +371 -0
  148. package/packages/core/v4-delivery-warrant-read-candidate.js +279 -0
  149. package/packages/core/v4-delivery-warrant-semantic-diff-gate.js +352 -0
  150. package/packages/core/v4-delivery-warrant-shadow-adapter.js +447 -0
  151. package/packages/core/v4-partial-mutation-recovery-qualification.js +395 -0
  152. package/packages/core/v4-platform-stage-checkpoints.js +471 -0
  153. package/packages/core/v4-provider-operation-journal.js +531 -0
  154. package/packages/core/v4-provider-readback-idempotency.js +394 -0
  155. package/packages/core/v4-release-activation-shadow.js +519 -0
  156. package/packages/core/v4-stable-publication-fence.js +357 -0
  157. package/packages/core/v4-stage-capsule-local-store.js +426 -0
  158. package/packages/core/v4-stage-capsule-qualification-campaign.js +512 -0
  159. package/packages/core/v4-stage-capsule-qualification.js +456 -0
  160. package/packages/core/v4-stage-capsule-resume-planner.js +397 -0
  161. package/packages/core/v4-stage-capsule-store.js +401 -0
  162. package/packages/core/v4-stage-capsule.js +319 -0
  163. package/scripts/assemble-self-publication-admission.mjs +1 -1
  164. package/scripts/audit-publication-control-plane.mjs +5 -5
  165. package/scripts/auditable-demo-bundle-verification.mjs +3 -2
  166. package/scripts/auditable-demo-platform.mjs +2 -2
  167. package/scripts/auditable-demo-renditions.mjs +1 -1
  168. package/scripts/auditable-demo.mjs +2 -2
  169. package/scripts/aws-macos-jit-controller-core.mjs +13 -346
  170. package/scripts/aws-macos-jit-controller-runtime.mjs +2 -210
  171. package/scripts/aws-macos-jit-controller.mjs +37 -275
  172. package/scripts/aws-macos-jit-core.mjs +3 -41
  173. package/scripts/aws-macos-jit.mjs +0 -12
  174. package/scripts/aws-windows-jit-campaign.mjs +2 -2
  175. package/scripts/aws-windows-jit-controller-core.mjs +1 -1
  176. package/scripts/aws-windows-jit-controller.mjs +3 -3
  177. package/scripts/build-contract-core.mjs +3 -8
  178. package/scripts/build-standalone-binary.mjs +3 -14
  179. package/scripts/buildchain-channel-router.mjs +4 -0
  180. package/scripts/buildchain-cli-help.mjs +7 -16
  181. package/scripts/buildchain-contract-lock.mjs +0 -6
  182. package/scripts/check-action-bundles.mjs +3 -4
  183. package/scripts/check-internal-architecture.mjs +7 -6
  184. package/scripts/check-inventory.mjs +30 -25
  185. package/scripts/check-v4-public-dogfood-contract.mjs +270 -0
  186. package/scripts/create-release-bundle.mjs +8 -4
  187. package/scripts/dev-alpha-candidate-patrol.mjs +1 -22
  188. package/scripts/dev-delivery-proof.mjs +2 -64
  189. package/scripts/dev-delivery-warrant.mjs +61 -86
  190. package/scripts/dev-pr-auto-merge.mjs +4 -30
  191. package/scripts/dev-pr-delivery-warrant.mjs +0 -55
  192. package/scripts/dispatch-artifact-signing-authority.mjs +7 -4
  193. package/scripts/generate-buildchain-kfd-witnesses.mjs +94 -88
  194. package/scripts/generate-channel-build-workflow.mjs +54 -24
  195. package/scripts/generate-channel-promotion-workflow.mjs +15 -6
  196. package/scripts/generate-site-bundle.mjs +8 -27
  197. package/scripts/git-fetch-process-tree.mjs +34 -1
  198. package/scripts/init-repo.mjs +64 -159
  199. package/scripts/inspect-artifact-signing-requests.mjs +0 -6
  200. package/scripts/locked-source-checkout.mjs +3 -4
  201. package/scripts/maintainability-metrics.mjs +8 -2
  202. package/scripts/npm-publish-dry-run.mjs +2 -2
  203. package/scripts/npm-publish-transaction.mjs +2 -2
  204. package/scripts/publication-commit-evidence.mjs +23 -69
  205. package/scripts/release-candidate-resolver.mjs +11 -17
  206. package/scripts/release-tail.mjs +3 -49
  207. package/scripts/resume-from-candidate-run.mjs +9 -123
  208. package/scripts/run-lifecycle-core.mjs +12 -13
  209. package/scripts/seal-artifact-signing-requests.mjs +17 -21
  210. package/scripts/site-capability-metadata.mjs +3 -20
  211. package/scripts/stable-candidate-qualification.mjs +10 -10
  212. package/scripts/v4-architecture.mjs +12 -2
  213. package/scripts/v4-bridge-bootstrap.mjs +141 -0
  214. package/scripts/v4-bridge-evidence.mjs +141 -0
  215. package/scripts/v4-host-adapter.mjs +182 -0
  216. package/scripts/v4-platform-stage-checkpoint-rehearsal.mjs +207 -0
  217. package/scripts/v4-stage-capsule-qualification.mjs +528 -0
  218. package/scripts/v4-stage-capsule-resume-rehearsal.mjs +57 -0
  219. package/scripts/v4-warrant-shadow-plan.mjs +601 -0
  220. package/scripts/verify-golden-path.mjs +5 -5
  221. package/scripts/web-surface-cloudfront-rewrite.mjs +15 -15
  222. package/scripts/web-surface-core.mjs +2 -8
  223. package/scripts/workflow-call-contract.mjs +5 -184
  224. package/contracts/dev-delivery-authority-v2.schema.json +0 -253
  225. package/contracts/fixtures/kfd-adopter-release-v1/kfd-4-perspective.json +0 -16
  226. package/contracts/fixtures/kfd-adopter-release-v1/kfd-4-replay.json +0 -57
  227. package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +0 -47
  228. package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +0 -47
  229. package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +0 -40
  230. package/contracts/next-development-request-v1.schema.json +0 -66
  231. package/contracts/next-development-transition-v1.schema.json +0 -292
  232. package/contracts/publication-rehearsal-capsule-v1.schema.json +0 -173
  233. package/dist/site/schemas/dev-delivery-authority-v2.schema.json +0 -442
  234. package/dist/site/schemas/publication-rehearsal-capsule-v1.schema.json +0 -269
  235. package/dist/site/schemas/release-tail-capabilities-v1.schema.json +0 -353
  236. package/dist/site/schemas/release-tail-provider-bindings-v1.schema.json +0 -94
  237. package/docs/dev-delivery-qualification-landing-adr.md +0 -137
  238. package/docs/next-development-transition.md +0 -119
  239. package/docs/publication-rehearsal.md +0 -94
  240. package/packages/core/buildchain-compatibility-proof.js +0 -631
  241. package/packages/core/dev-delivery-authority.js +0 -996
  242. package/packages/core/dev-delivery-native-proof.js +0 -418
  243. package/packages/core/dev-delivery-warrant-shadow.js +0 -502
  244. package/packages/core/next-development-candidate-reservation.js +0 -186
  245. package/packages/core/next-development-controller.js +0 -726
  246. package/packages/core/next-development-projection.js +0 -288
  247. package/packages/core/next-development-transition.js +0 -738
  248. package/packages/core/publication-rehearsal-projection.js +0 -173
  249. package/packages/core/publication-rehearsal-runtime.js +0 -921
  250. package/scripts/aws-macos-jit-instance-rehydrate.mjs +0 -260
  251. package/scripts/aws-macos-jit-source-rebind.mjs +0 -724
  252. package/scripts/dev-delivery-authority.mjs +0 -368
  253. package/scripts/dev-delivery-native-run.mjs +0 -235
  254. package/scripts/dev-delivery-two-phase-resume.mjs +0 -90
  255. package/scripts/dev-delivery-two-phase.mjs +0 -577
  256. package/scripts/generate-next-development-guidance.mjs +0 -49
  257. package/scripts/materialize-self-release-candidate-version.mjs +0 -137
  258. package/scripts/next-development-self-dogfood-harness.mjs +0 -409
  259. package/scripts/next-development-self-dogfood.mjs +0 -532
  260. package/scripts/next-development-transition.mjs +0 -47
  261. package/scripts/release-candidate-tail-reseal.mjs +0 -426
  262. package/templates/native-dev-delivery.yml +0 -86
@@ -1,137 +0,0 @@
1
- ---
2
- status: accepted
3
- period: ongoing
4
- theme: dev-delivery-qualification-landing-authority
5
- doc_type: architecture-decision-record
6
- source_level: local-files
7
- confidence: high
8
- sensitivity: public
9
- evidence_grade: A
10
- review_state: self-reviewed
11
- last_reviewed: 2026-08-12
12
- ---
13
-
14
- # ADR: Qualification Leases and the exclusive Landing Warrant
15
-
16
- ## Decision
17
-
18
- Buildchain has two explicit protected-dev authority modes:
19
-
20
- 1. `single-flight-warrant` is the default and continues to use the
21
- `kungfu-buildchain-dev-delivery-warrant-queue` v1 state and
22
- `buildchain dev warrant` commands unchanged.
23
- 2. `bounded-qualification-landing` is opt-in and uses the
24
- `kungfu-buildchain-dev-delivery-authority` v2 state. It may issue up to the
25
- configured number of Qualification Leases, but it may issue exactly one
26
- Landing Warrant.
27
-
28
- The modes use different contracts, state refs, and CLI command families. There
29
- is no implicit reinterpretation of a v1 Warrant. A consumer turns the new mode
30
- on only by explicitly migrating the exact current v1 state and deploying the
31
- v2 controller against the dedicated
32
- `buildchain/dev-delivery-authority/<dev-line>` state ref.
33
-
34
- Migration preserves the immutable v1 `stateRoot`, candidate identity, source
35
- and proof roots, fencing token, generation, and lease times in a rooted
36
- migration receipt. An active provisional Warrant becomes a
37
- qualification-only lease and remains unable to admit `merge_group`; an active
38
- qualified Warrant becomes the one exclusive Landing Warrant. The migration is
39
- one-shot: a v2 state is never accepted as v1 input, and source/evidence bytes
40
- are not regenerated. The legacy ref remains immutable rollback evidence.
41
-
42
- ## Authority invariants
43
-
44
- A Qualification Lease carries:
45
-
46
- - `authority = qualification-only`;
47
- - `mergeGroupAdmission = false`;
48
- - one exact candidate id, token, generation, issue time, and expiry; and
49
- - a place in a list bounded by `policy.maxQualificationLeases`.
50
-
51
- It authorizes expensive qualification work only. It cannot authorize GitHub
52
- `merge_group`, cannot be upgraded in place to landing authority, and is removed
53
- when qualification evidence is recorded. Each new candidate declares a sorted
54
- set of rooted `qualificationDomains`. Candidates with disjoint sets may hold
55
- leases concurrently. An overlapping set is serialized; an empty set is treated
56
- as unknown and therefore conflicts with every active candidate. The scheduler
57
- returns a content-rooted reason for either refusal.
58
-
59
- The Landing Warrant carries:
60
-
61
- - `authority = merge-group-admission`;
62
- - `mergeGroupAdmission = true`;
63
- - one exact qualified candidate id, token, generation, issue time, and expiry;
64
- and
65
- - the only non-null `landingWarrant` slot in the durable state.
66
-
67
- Only `admitDevDeliveryMergeGroup` and `buildchain dev authority
68
- admit-merge-group` consume Landing authority. They bind the exact current state
69
- root, candidate, protected base, source head, merge-group head, token, and
70
- generation. A Qualification Lease fails closed at this boundary.
71
-
72
- The state normalizer rejects a lease beyond the configured bound, duplicate
73
- Qualification Leases for one candidate, a candidate holding qualification and
74
- Landing authority together, a Landing Warrant without its exact landing
75
- candidate, and any state-root drift. Git expected-old, non-force ref advancement
76
- continues to serialize durable mutations. These checks retain the existing
77
- two-phase safety rule: source/native qualification is evidence, while the
78
- exclusive final authority is candidate- and integration-specific.
79
-
80
- ## Bounded scheduler and recovery
81
-
82
- Landing selection is FIFO among candidates that have completed qualification.
83
- When a later candidate receives a Landing Warrant, each older nonterminal
84
- candidate consumes one durable overtake from its
85
- `policy.maxLandingOvertakes` budget. Once an older candidate reaches that
86
- bound, later candidates cannot receive a Warrant. The older candidate receives
87
- the next landing priority after qualification, or reaches a rooted terminal
88
- failure after `policy.maxQualificationAttempts` heartbeat expiries. This makes
89
- the bound independent of controller restart frequency or later arrival rate;
90
- setting it to zero enforces strict FIFO landing priority.
91
-
92
- Qualification Leases and Landing Warrants both support fenced heartbeats. A
93
- missed heartbeat is recovered at expiry; recovery releases capacity and emits
94
- a deterministic content-rooted wake instruction for the next domain-eligible
95
- qualification candidates and the next fair landing candidate. Completion,
96
- cancellation, terminal failure, dequeue, and already-merged settlement emit the
97
- same wake shape. Exact duplicate heartbeats, recovery, and terminal events are
98
- state-root-preserving no-ops. Competing controllers still commit through one
99
- expected-old, non-force ref update, so only one transition can become durable.
100
-
101
- ## Terminal settlement
102
-
103
- Terminal provider evidence is authoritative cleanup input. A matching merged,
104
- failed, dequeued, or cancelled candidate releases its Qualification Lease or
105
- Landing Warrant in the same expected-old state transition, even when the lease
106
- TTL has not expired. An active authority requires its exact token and
107
- generation for that transition. Repeating the same outcome and evidence is a
108
- root-preserving no-op; outcome or evidence drift fails closed. A terminal event
109
- for a candidate that never entered the state is also an explicit no-op.
110
-
111
- TTL recovery remains crash recovery, not the normal terminal cleanup path.
112
-
113
- ## Public contract
114
-
115
- - Machine schema:
116
- [`contracts/dev-delivery-authority-v2.schema.json`](../contracts/dev-delivery-authority-v2.schema.json),
117
- packaged as `dist/site/schemas/dev-delivery-authority-v2.schema.json`.
118
- - Node API: `@kungfu-tech/buildchain/dev-delivery-authority` exports the v2
119
- state, migration, lease, heartbeat, recovery, Landing, admission,
120
- observation, and settlement functions. `@kungfu-tech/buildchain/dev-delivery-warrant`
121
- remains byte- and behavior-compatible for v1 consumers.
122
- - CLI: `buildchain dev authority
123
- <migrate|submit|lease-qualification|heartbeat-qualification|complete-qualification|lease-landing|heartbeat-landing|recover|admit-merge-group|settle|observe>`.
124
- - Generated references: [`cli-reference.md`](cli-reference.md) and
125
- [`node-api-reference.md`](node-api-reference.md).
126
-
127
- All mutations are plan-only unless `--execute` is supplied. Merge-group
128
- admission is always a read-only authority check; it never mutates GitHub Merge
129
- Queue itself.
130
-
131
- ## Consequences
132
-
133
- Qualification throughput can increase without increasing the number of
134
- candidates permitted to land. Consumers retain the byte- and behavior-compatible
135
- single-flight default until they deliberately deploy the v2 mode. The tradeoff
136
- is a second state contract and controller family; Buildchain keeps that
137
- separation explicit so a rollout cannot silently weaken Warrant semantics.
@@ -1,119 +0,0 @@
1
- ---
2
- status: preview
3
- period: ongoing
4
- theme: next-development-transition
5
- doc_type: generated-contract-guidance
6
- source_level: generated-from-node-contract
7
- confidence: high
8
- sensitivity: public
9
- evidence_grade: A
10
- review_state: self-reviewed
11
- last_reviewed: 2026-08-11
12
- ---
13
-
14
- # Next-development Transition
15
-
16
- This document is generated from
17
- `packages/core/next-development-transition.js` and
18
- `packages/core/next-development-controller.js` and
19
- `packages/core/next-development-projection.js`. Edit those sources and run
20
- `node scripts/generate-next-development-guidance.mjs`; direct edits fail the
21
- projection drift check.
22
-
23
- ## Contract
24
-
25
- - Contract: `kungfu-buildchain-next-development-transition/v1`
26
- - Durable controller: `kungfu-buildchain-next-development-controller/v1`
27
- - ADR: [ADR 0002](../architecture/decisions/0002-next-development-transition.md)
28
- - States: `planned`, `waiting-anchor`, `materialized`, `pr-pending`, `merged`, `verified`
29
- - Legal version models: `semver/auto` and `anchored/manual`
30
- - Invariant: A completed Alpha remains successful and its refs remain immutable while the next-development transition is incomplete.
31
-
32
- An Alpha publication is terminal success independently of this transition.
33
- The idempotency key is a deterministic hash of the completed-Alpha root,
34
- repository, legal model, and sorted declared paths. Incomplete Dev preparation
35
- therefore cannot relabel Alpha N as failed, and replay cannot select a different
36
- Alpha or path set.
37
-
38
- ## Durable controller
39
-
40
- `scheduleNextDevelopmentController` atomically creates one child for the
41
- repository and completed-Alpha root. Identical wakes reuse it. The store
42
- boundary requires read, create-if-absent, and compare-and-swap operations; the
43
- controller root fences every checkpoint. Materialization uses an operation key
44
- derived from the child, exact current protected Dev SHA, and reviewed target,
45
- so a fresh runner can recover an already-created commit instead of rebuilding
46
- the Alpha candidate or depending on the original runner workspace.
47
-
48
- Before opening the protected version PR, the controller reads Dev again. A
49
- moved head makes the prepared attempt `superseded`; the following wake
50
- regenerates only declared version material from that latest SHA. After merge,
51
- `verified` remains unreachable until protected Dev readback contains the
52
- prepared commit and its target version, source roots, and derived roots exactly
53
- match the checkpoint. The executor surface contains no Alpha publication, tag,
54
- release, or package operation.
55
-
56
- Alpha finalization no longer treats a non-fast-forward Dev update as successful
57
- bookkeeping. It requires an exact checkout of the current Dev head, regenerates
58
- the declared version lifecycle there, and uses a non-force merge or reusable
59
- protected version PR. Candidate Patrol ignores both the generated preparation
60
- commit and its two-parent integration commit. Before a later product candidate
61
- can settle, Patrol reads every prepared version path at the candidate SHA and
62
- requires the exact reserved blob identities; missing or stale state blocks
63
- before a Release Cut or heavy candidate build.
64
-
65
- ## Version models
66
-
67
- `semver/auto` increments the Alpha sequence on the same semantic patch. For
68
- example, completed `1.4.2-alpha.7` plans `1.4.2-alpha.8`. It must not accept an anchor or an
69
- operator-selected target.
70
-
71
- `anchored/manual` enters `waiting-anchor` until the caller provides both a
72
- semantic target and the exact digest of the configured anchor manifest. The
73
- adapter verifies the manifest already present in the checkout; it never invents
74
- or edits upstream anchor facts. `semver/manual` and `anchored/auto` are
75
- invalid.
76
-
77
- ## Hosted self-dogfood and adoption
78
-
79
- `.github/workflows/buildchain-alpha-self-dogfood.yml` calls the same public
80
- `build.yml@v3-alpha` router as a consumer. After the hosted build succeeds, one
81
- runner uses the real version-state adapter and checkpoints an injected transient
82
- durable-state write failure. A separate runner restores the adapter operation
83
- without rebuilding Alpha, supersedes it when protected Dev moves, and preserves
84
- `pr-pending` while the protected PR is delayed. The final artifact roots the
85
- exact runtime SHA, controller transaction, both legal version-model outcomes,
86
- and an exact hosted protected Dev readback. Stable qualification recomputes and
87
- rejects evidence that omits or drifts any of those bindings.
88
-
89
- Production consumers, including Kungfu, adopt the proved contract through
90
- `kungfu-systems/buildchain/.github/workflows/build.yml@v3`. The evidence retains
91
- the exact resolved SHA for audit, but the committed production coordinate is the
92
- floating major contract rather than an exact-SHA pin.
93
-
94
- ## Local adapter
95
-
96
- From a normal Buildchain checkout:
97
-
98
- ```sh
99
- node scripts/next-development-transition.mjs materialize --cwd . --input <request.json>
100
- ```
101
-
102
- The command prints a rooted plan and performs no write by default. `--write`
103
- may change only regular, non-symlink source files listed by `version.files`
104
- in the loaded Buildchain config. The rooted adapter contract separately names
105
- `version.derived_files` as allowed changes, `version.manifest` as read-only,
106
- `BUILDCHAIN_VERSION` as the target input, `lifecycle.version-state` as the
107
- derived-material stage, and `lifecycle.verify` as the truth gate. The
108
- reference writer fails closed when derived files exist because transaction
109
- execution is outside this contract slice. It performs no Git operation, ref
110
- update, network request, provider call, lifecycle command, or anchor edit.
111
-
112
- Preparing development state creates no tag, Release, public package, or
113
- candidate. Those public effects remain outside the local adapter contract.
114
-
115
- The request schema is
116
- `contracts/next-development-request-v1.schema.json`; the durable record schema
117
- is `contracts/next-development-transition-v1.schema.json`. Positive and
118
- negative examples live under
119
- `contracts/fixtures/next-development-transition-v1/`.
@@ -1,94 +0,0 @@
1
- ---
2
- status: preview
3
- period: 2026-08-08
4
- theme: buildchain-publication-rehearsal
5
- doc_type: product-manual
6
- source_level: local-files
7
- confidence: high
8
- sensitivity: public
9
- evidence_grade: A
10
- review_state: self-reviewed
11
- last_reviewed: 2026-08-08
12
- ai_provenance:
13
- model_family: GPT-5
14
- product: Codex
15
- generated_at: 2026-08-08
16
- visible_context: Public rehearsal capsule runtime, release-tail provider plane, CLI, Action, workflow, and generated consumer surfaces.
17
- invisible_context_boundary: No credentials, private provider state, signed URLs, or external publication receipts were read.
18
- ---
19
-
20
- # Publication rehearsal
21
-
22
- Buildchain publication rehearsal runs the deterministic release tail locally
23
- from one `kungfu.buildchain.publication-rehearsal-capsule/v1` document. The
24
- normative rule is [ADR 0001](../architecture/decisions/0001-release-local-constructibility.md):
25
- every non-external release behavior must be locally constructible, and no
26
- semantic path may depend on GitHub runner state.
27
-
28
- The machine-readable shape is
29
- [`publication-rehearsal-capsule-v1.schema.json`](../contracts/publication-rehearsal-capsule-v1.schema.json).
30
-
31
- ## Exact local command
32
-
33
- Run from the repository root after restoring the content-addressed candidate:
34
-
35
- ```sh
36
- buildchain release-tail rehearse \
37
- --capsule "$PWD/.buildchain/publication/rehearsal-capsule.json" \
38
- --capsule-root "$PWD/.buildchain/publication/candidate" \
39
- --mode simulate \
40
- --state "$PWD/.buildchain/publication/rehearsal-state.json" \
41
- --evidence "$PWD/.buildchain/publication/rehearsal-evidence.json"
42
- ```
43
-
44
- Use `--mode replay` only when the capsule contains a complete recorded
45
- provider-response sequence. Both modes produce rooted evidence with
46
- `externalPublicationClaimed: false`.
47
-
48
- ## Daily fixture and sealed-candidate modes
49
-
50
- For daily development, build a synthetic capsule with
51
- `createPublicationRehearsalCapsule`, use synthetic files and provider
52
- observations, and run `--mode simulate` or `--mode replay`. This fixture mode is
53
- for deterministic regression evidence only.
54
-
55
- Before publication qualification, restore the exact sealed candidate bytes,
56
- Passport, policy roots, initial transaction and recorded observations named by
57
- the retained capsule, then run the exact command above. Preserve the resulting
58
- binding root, transaction root, state root, receipt roots and evidence root.
59
- These roots qualify deterministic construction only; external publication and
60
- public readback still require their own authorities.
61
-
62
- ## Capsule contents
63
-
64
- The capsule root commits to the release-tail declaration, ordered policy roots,
65
- Passport path/root, initial durable transaction, complete file inventory,
66
- data-only provider bindings, recorded observations, portable platform policy,
67
- declared environment keys, and the exact list of external effects. Every input
68
- file is a regular non-symlink file under the explicit absolute capsule root and
69
- must match its size and SHA-256 root.
70
-
71
- The CLI never reads `GITHUB_*`, infers a runner workspace, selects behavior from
72
- `process.platform`, or accepts executable hooks. An explicit environment JSON
73
- object must match the capsule declaration exactly.
74
-
75
- ## Hosted parity
76
-
77
- The reusable `release-tail.yml` workflow passes the explicit capsule to the
78
- `actions/release-tail` wrapper. The wrapper supplies only GitHub/HTTP transport
79
- and declared secret inputs, then invokes the same
80
- `executePublicationRehearsal` public core used locally. Provider requests,
81
- responses, failures, transaction roots, receipt roots, and the final evidence
82
- root are retained together.
83
-
84
- Simulation or replay is development evidence. Provider mode can record real
85
- external observations, but it still does not replace Release Passport,
86
- attestation, registry, activation, public-readback, or protected-delivery
87
- authority.
88
-
89
- ## Failure handling
90
-
91
- Diagnostics use
92
- `kungfu.buildchain.publication-rehearsal-diagnostic/v1`. Preserve the capsule,
93
- diagnostic root, binding root, and exact failed files. Repair the shared core or
94
- capsule locally and rerun before spending another hosted runner attempt.