@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,5 +1,5 @@
1
1
  ---
2
- status: accepted
2
+ status: draft
3
3
  period: ongoing
4
4
  theme: dev-delivery-warrant
5
5
  doc_type: technical-reference
@@ -7,7 +7,7 @@ source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
- review_state: self-reviewed
10
+ review_state: unreviewed
11
11
  last_reviewed: 2026-08-11
12
12
  ai_provenance:
13
13
  model_family: GPT-5
@@ -38,17 +38,10 @@ and retained enqueue time.
38
38
 
39
39
  Selection is deterministic FIFO plus aging with bounded priority. Priority may
40
40
  reorder queued work, but it cannot preempt the active Warrant. Exactly one
41
- candidate receives a `provisional` leased Warrant containing a fencing token,
42
- lease generation, expected-old state root, expiry, and the complete exact
43
- source binding. It reserves the next protected-dev landing before expensive
44
- native shards start, but it is not GitHub Merge Queue admission authority.
45
- Heartbeat extends only that generation. Native proof success atomically
46
- upgrades the same token and generation to `qualified`; only then may enqueue
47
- begin. Expiry fences further mutations by the old token, but it does not prove
48
- that the old native process stopped. The active Warrant therefore remains in
49
- place until bounded termination is proven by rooted terminal evidence. Only
50
- that exact fenced settlement may clear the holder and permit successor
51
- selection.
41
+ candidate receives a leased Warrant containing a fencing token, lease
42
+ generation, expected-old state root, expiry, and the complete exact source
43
+ binding. Heartbeat extends only that generation. Expiry recovery rejects the
44
+ old token, retains queue age, and returns the candidate to selection.
52
45
 
53
46
  A terminal event may cancel a candidate before selection without minting a
54
47
  Warrant. This transition is limited to an exact non-active queued candidate and
@@ -58,12 +51,7 @@ An active candidate still requires its current fencing token and lease
58
51
  generation. Exact duplicate cancellation evidence is a visible no-op; identity,
59
52
  state, event, or evidence drift fails closed.
60
53
 
61
- The reusable terminal controller classifies authoritative completion,
62
- cancellation, supersession, native failure, and transient dequeue separately.
63
- `dequeued` alone never clears an active Warrant: a fresh holder continues with
64
- the same generation and token, while an expired holder waits for proof that its
65
- fenced worker stopped. Queued work may still settle as dequeued because it never
66
- started native execution. The controller uses one `settle` operation for active,
54
+ The reusable terminal controller uses one `settle` operation for active,
67
55
  queued, already-terminal, and never-admitted pull requests. An active Warrant
68
56
  still requires its exact fence and evidence. A matching queued cancellation is
69
57
  persisted normally. A duplicate terminal event or a pull request that never
@@ -85,37 +73,23 @@ That lane outranks not-yet-leased ordinary work, but never preempts or rewrites
85
73
  an active Warrant; unrelated, conflicted, mismatched, or fabricated claims fail
86
74
  closed before selection.
87
75
 
88
- ## Three proof authorities
76
+ ## Split proof authority
89
77
 
90
- Source Qualification Proof is created from the cheap source-acceptance gate. It
91
- binds the semantic source, exact source head and patch/tree intent, plan,
92
- affected closure, dependencies, toolchain, covered paths, and exact acceptance
93
- evidence. Ready state and approval are established before provisional
94
- selection.
78
+ Source Qualification Proof is independent of the moving dev base. It binds the
79
+ semantic source, exact source head and patch/tree intent, plan, affected
80
+ closure, dependencies, toolchain, covered paths, and shard evidence.
95
81
 
96
- Native Qualification Proof is separate. It binds semantic source and patch,
97
- plan, affected closure, dependency graph, toolchain, the exact execution
98
- environment contract, covered paths, native shard evidence, and the exact dev
99
- base used by the native composition. Before reuse, the consumer roots the
100
- complete attributed Dev delta, including both sides of every rename, then
101
- classifies it:
82
+ Before reuse, the consumer classifies the dev delta:
102
83
 
103
- - unchanged semantic roots plus an unrelated fully attributed base delta reuse
104
- native qualification and run only a cheap Project Cut replay. GitHub's `behind`
84
+ - unchanged roots plus an unrelated attributed delta reuse source
85
+ qualification and run only a cheap Project Cut replay. GitHub's `behind`
105
86
  state is accepted only when a rooted replay proof binds the exact current
106
87
  protected base, unchanged PR head and source patch, replay tree, required
107
88
  context roots, and a qualified `project.cut.merge-queue-admission/v1`
108
89
  receipt;
109
- - an overlapping delta reruns affected native shards or the full native plan;
110
- - an unknown or truncated graph, ambiguous rename, missing attribution, or
111
- changed source, plan, closure, dependency, toolchain, or environment root
112
- fails closed to full native qualification.
113
-
114
- The reuse decision binds the exact old and current Dev heads, normalized changed
115
- paths and rename pairs in `baseDeltaRoot`. This makes local and hosted replay of
116
- the same inputs byte-deterministic. Generated outputs that participate in the
117
- affected closure must be listed in `affected-paths-json`; a delta touching one
118
- of those surfaces is overlap, not a documentation-only advance.
90
+ - an overlapping delta reruns the affected source shards;
91
+ - an unknown graph or changed source, plan, closure, dependency, or toolchain
92
+ root fails closed to full source qualification.
119
93
 
120
94
  Integration Delivery Proof is separate and cannot be cached across candidates.
121
95
  It binds the exact current dev base, replay tree, GitHub `merge_group` head and
@@ -139,19 +113,6 @@ buildchain dev warrant submit --repository owner/repository \
139
113
  buildchain dev warrant select --repository owner/repository \
140
114
  --branch dev/v4/v4.0 --execute
141
115
 
142
- buildchain dev proof native --branch dev/v4/v4.0 \
143
- --qualified-base <sha> --environment-root <root> \
144
- --affected-paths-json '["packages/native"]' ...
145
-
146
- buildchain dev proof classify-native --source-proof native-proof.json \
147
- --current-base <sha> --graph-known true --attribution-complete true \
148
- --changed-paths-json '[]' --renames-json '[]' ...
149
-
150
- buildchain dev warrant qualify --repository owner/repository \
151
- --branch dev/v4/v4.0 --fencing-token <root> --lease-generation 1 \
152
- --native-proof native-proof.json \
153
- --native-reuse-decision native-reuse-decision.json --execute
154
-
155
116
  buildchain dev warrant cancel-queued --repository owner/repository \
156
117
  --branch dev/v4/v4.0 --candidate-id <root> --pull-request 123 \
157
118
  --expected-source-head <queued-sha> --observed-source-head <event-sha> \
@@ -159,16 +120,16 @@ buildchain dev warrant cancel-queued --repository owner/repository \
159
120
  --evidence-root <terminal-event-root> --execute
160
121
  ```
161
122
 
162
- `heartbeat`, `qualify`, `recover`, `close`, `settle`, `cancel-queued`, and `observe` use the same durable authority.
123
+ `heartbeat`, `recover`, `close`, `settle`, `cancel-queued`, and `observe` use the same durable authority.
163
124
  Warrant-scoped mutations require the exact fencing token and lease generation.
164
125
  `close` also requires a rooted terminal evidence object.
165
126
 
166
- Expensive native commands must run through `dev-delivery-native-run.mjs` (or an
167
- equivalent exact consumer). It performs an exact fenced heartbeat before spawn,
168
- renews throughout the complete child lifetime, performs a final renewal before
169
- accepting success, and terminates the process group on heartbeat or fencing
170
- failure. Missing, stale, expired, or mismatched Warrant state therefore blocks
171
- native spawn instead of becoming qualification evidence.
127
+ On the v4 preview line, `observe` alone has an explicit `--read-mode v4`
128
+ candidate. It requires a retained exact semantic-diff qualification and source
129
+ binding, invokes an effect-disabled Rust state projection, retains parity
130
+ evidence, and returns the existing v3 observation shape. The default and
131
+ rollback mode is `v3`; mutation commands ignore the read switch. See
132
+ [`v4-delivery-warrant-read-candidate.md`](v4-delivery-warrant-read-candidate.md).
172
133
 
173
134
  Proof commands create, verify, classify, and compose the two proof layers:
174
135
 
@@ -181,134 +142,15 @@ buildchain dev proof replay-proof \
181
142
  buildchain dev proof integration --warrant-result warrant.json ...
182
143
  ```
183
144
 
184
- ## Bounded-concurrency shadow qualification
185
-
186
- The default production queue remains single-flight. A separate effect-disabled shadow
187
- planner can replay the same deterministic candidate order with a bound of one
188
- or two lanes. It does not issue, renew, supersede, close, or persist a Warrant;
189
- it cannot enqueue a pull request; and its output explicitly carries no
190
- production or rollout authority.
191
-
192
- Each lane binds the exact queue root and generation, protected-base head,
193
- source head, projected-base root, Project Cut, approval, required checks,
194
- status, and lease evidence. An active production candidate must additionally
195
- match its current fencing token and lease generation. A queued shadow lane must
196
- not carry either. Stale evidence, an occupied native queue, cross-lane evidence
197
- aliasing, shared conflict keys, or an incompatible projected base fails closed.
198
- A failure in one lane remains visible without converting or concealing the
199
- other lane's result.
200
-
201
- The planner and aggregate qualification command consume immutable JSON files:
202
-
203
- ```sh
204
- buildchain dev warrant shadow-plan --input observation.json \
205
- --max-concurrency 2 --output shadow-plan.json
206
-
207
- buildchain dev warrant shadow-qualify --input qualification-input.json \
208
- --output shadow-qualification.json
209
- ```
210
-
211
- Both commands reject `--execute`. Qualification reports compare explicit
212
- thresholds for sample count, eligible overlap, projected queue-wait benefit,
213
- additional runner cost, ambiguity, and false positives. A `proceed` result is
214
- only evidence for a separate reviewed rollout decision; it never changes the
215
- live Warrant schema, queue state, merge-queue policy, or protected branch.
216
-
217
- ## Opt-in bounded qualification and exclusive landing
218
-
219
- Buildchain also defines an explicit production opt-in that turns successful
220
- shadow evidence into a separate v2 authority state. It does not widen or
221
- reinterpret the v1 Warrant queue. The accepted
222
- [`Qualification Lease and Landing Warrant ADR`](dev-delivery-qualification-landing-adr.md)
223
- and `contracts/dev-delivery-authority-v2.schema.json` are authoritative.
224
-
225
- In `bounded-qualification-landing` mode, a configured number of exact
226
- Qualification Leases may coexist. Each lease carries
227
- `authority = qualification-only` and `mergeGroupAdmission = false`. Completing
228
- qualification records evidence and releases that lease. Qualified candidates
229
- then wait for the one `Landing Warrant`, which alone carries
230
- `authority = merge-group-admission` and may be checked for `merge_group`
231
- admission.
232
-
233
- Concurrency is granted only across disjoint rooted `qualificationDomains`.
234
- Overlap and unknown domains are held behind the active safety boundary with an
235
- explicit content-rooted reason. `maxLandingOvertakes` prevents a slow older
236
- candidate from being bypassed indefinitely, while `maxQualificationAttempts`
237
- turns repeated heartbeat loss into a rooted terminal failure. Every release
238
- returns a deterministic rooted wake instruction; an exact duplicate release or
239
- recovery is a state-root-preserving no-op.
240
-
241
- The public command family is explicit:
242
-
243
- ```sh
244
- buildchain dev authority migrate --repository owner/repository \
245
- --branch dev/v3/v3.0 --legacy-state v1-queue.json --execute --json
246
- buildchain dev authority lease-qualification --repository owner/repository \
247
- --branch dev/v4/v4.0 --execute
248
- buildchain dev authority heartbeat-qualification --repository owner/repository \
249
- --branch dev/v4/v4.0 --candidate-id <root> \
250
- --authority-token <root> --authority-generation 1 --execute
251
- buildchain dev authority complete-qualification --repository owner/repository \
252
- --branch dev/v4/v4.0 --candidate-id <root> \
253
- --authority-token <root> --authority-generation 1 \
254
- --evidence-root <qualification-root> --execute
255
- buildchain dev authority lease-landing --repository owner/repository \
256
- --branch dev/v4/v4.0 --execute
257
- buildchain dev authority heartbeat-landing --repository owner/repository \
258
- --branch dev/v4/v4.0 --candidate-id <root> \
259
- --authority-token <root> --authority-generation 1 --execute
260
- buildchain dev authority recover --repository owner/repository \
261
- --branch dev/v4/v4.0 --execute
262
- buildchain dev authority admit-merge-group --repository owner/repository \
263
- --branch dev/v4/v4.0 --candidate-id <root> \
264
- --authority-token <root> --authority-generation 1 \
265
- --merge-group-head <sha>
266
- ```
267
-
268
- Terminal settlement releases either authority immediately from exact evidence;
269
- it does not wait for TTL. Exact duplicate settlement is a state-root-preserving
270
- no-op. The default `buildchain dev warrant` commands, v1 state bytes, and
271
- single-flight behavior do not change while this mode is off.
272
-
273
145
  ## Workflow rollout and rollback
274
146
 
275
147
  The reusable `dev-pr-auto-merge.yml` supports three explicit rollout modes:
276
148
 
277
149
  - `off` preserves the previous exact-head admission controller;
278
150
  - `shadow` qualifies the source and emits a read-only queue submission plan;
279
- - `required` persists the submission, selects a provisional Warrant, runs or
280
- reuses semantic native proof under heartbeat, atomically qualifies the same
281
- fence, and refuses GitHub enqueue unless the immutable queue commit, state root, active Warrant, and
282
- selected candidate all pass exact readback validation. Immediately before
283
- enqueue, the controller also rereads the current protected state ref and
284
- verifies the active candidate, fencing token, generation, pull request, and
285
- exact head. A previously valid result is not authority after terminal
286
- closeout. Re-running qualification for the same selected head may regenerate
287
- timestamped proof bytes, but it retains the immutable active Warrant and its
288
- originally selected proof instead of rewriting or rejecting that attempt.
289
- Each candidate also retains the exact successful source workflow run. If a
290
- controller discovers that another candidate owns the active Warrant, a
291
- configured consumer workflow is dispatched immediately for that exact PR,
292
- head, and source run; the candidate is not left waiting for a patrol cron.
293
-
294
- The controller persists a completed native proof before its final base
295
- reclassification. A later exact retry can supply that proof and avoid the
296
- expensive native command when the rooted delta still proves reuse safe. A
297
- duplicate dispatch against the same already-qualified Warrant returns the same
298
- proof and reuse roots without another queue mutation. Both result forms carry
299
- `landingAuthority: false`: only the live qualified Warrant plus exact-head
300
- GitHub merge-queue admission can authorize landing.
301
-
302
- The required controller checks the protected base again after native work. A
303
- disjoint attributed delta reuses the proof. Overlap or unknown attribution
304
- triggers one automatic revalidation on the latest base; continued overlap,
305
- native failure, cancellation, semantic head movement, or an unrecoverable merge
306
- conflict closes the exact fence. The next queued candidate is notified through
307
- the `buildchain-dev-delivery-wake` repository event. Its complete semantic
308
- candidate is carried under the single `client_payload.candidate` envelope so
309
- GitHub's ten-property top-level limit cannot discard proof bindings. If
310
- cancellation prevents cleanup, lease expiry recovers retained queue age and
311
- mints a new fence.
151
+ - `required` persists the submission, selects the Warrant, and refuses GitHub
152
+ enqueue unless the immutable queue commit, state root, active Warrant, and
153
+ selected candidate all pass exact readback validation.
312
154
 
313
155
  Consumers should deploy `shadow` first, inspect receipts, then change their
314
156
  protected caller to `required`. Rollback is a reviewed caller change back to
@@ -318,22 +160,15 @@ merged candidate (or accepts explicit evidence for another terminal outcome),
318
160
  then closes only the current fencing generation. The separate queued
319
161
  cancellation reusable workflow cannot close an active generation; it advances
320
162
  the state ref only when the caller's complete terminal binding and expected-old
321
- root still match. A delayed `dequeued` event is ignored when GitHub readback
322
- shows the same exact PR head is already queued again, so an earlier queue event
323
- cannot close a newer active Warrant generation.
163
+ root still match.
324
164
 
325
165
  Buildchain uses the same contract for its own protected dev line through
326
166
  `buildchain-dev-delivery.yml`. The manual caller requires the exact PR head and
327
- semantic source roots, accepts an optional reusable native proof, pins the runtime to the caller commit, selects
167
+ all native/source proof roots, pins the runtime to the caller commit, selects
328
168
  `delivery-warrant-mode: required`, and targets GitHub Merge Queue. It does not
329
169
  offer an `off` switch: rollback is a reviewed change to this caller, not an
330
170
  operator-time weakening of a specific delivery attempt.
331
171
 
332
- `buildchain init --type native` generates the corresponding protected-dev
333
- consumer workflow. It supports both explicit dispatch and the bounded wake
334
- event, uses the same reusable controller, and keeps the native command in the
335
- consumer repository rather than inventing provider-specific shards.
336
-
337
172
  This mechanism schedules protected delivery only. It does not serialize local
338
173
  development, source-only checks, unrelated channels, release publication, or
339
174
  runner provisioning. It never grants authority to enable cloud runner
@@ -29,9 +29,17 @@ their heads are already ancestors of a mainline.
29
29
  The reusable entrypoint is:
30
30
 
31
31
  ```yaml
32
- uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v3
32
+ uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v4
33
33
  ```
34
34
 
35
+ The v4 surface is a traceable forward-port of protected v3 merge
36
+ `c9d53c69e90393b2178ad7cdbf00f17e403e17f9` and exact source
37
+ `518990c4118a12562eb9847cb2e1b704983909a0`. It preserves the same `v1`
38
+ contract, temporary-family allowlist, provider adapter, mutation fences, and
39
+ evidence roots. The v4 manifest records that TypeScript remains the sole
40
+ legacy-authoritative writer; the forward-port does not create another contract
41
+ or provider authority. Existing v3 callers retain their original interface.
42
+
35
43
  ## Report mode
36
44
 
37
45
  `report` is the default. The caller grants only read permissions and receives
@@ -40,7 +48,7 @@ separate plan, Markdown report, and dry-run receipt artifacts:
40
48
  ```yaml
41
49
  jobs:
42
50
  housekeeper:
43
- uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v3
51
+ uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v4
44
52
  permissions:
45
53
  contents: read
46
54
  pull-requests: read
@@ -81,7 +89,7 @@ An unattended scheduled caller can set both values in committed policy.
81
89
  ```yaml
82
90
  jobs:
83
91
  housekeeper:
84
- uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v3
92
+ uses: kungfu-systems/buildchain/.github/workflows/engineering-housekeeper.yml@v4
85
93
  permissions:
86
94
  contents: write
87
95
  pull-requests: write
@@ -120,7 +128,7 @@ continue.
120
128
  | `max-actions` | number | `20` | Positive global apply limit. |
121
129
  | `artifact-retention-days` | number | `30` | Retention for plan, report, and receipts. |
122
130
  | `buildchain-repository` | string | `kungfu-systems/buildchain` | Runtime source repository. |
123
- | `buildchain-ref` | string | `v3` | Runtime ref; trusted manual qualification may pass a train or exact SHA. |
131
+ | `buildchain-ref` | string | `v4` | Runtime ref; trusted qualification may pass a train or exact SHA. |
124
132
 
125
133
  Stable outputs are `plan-root`, `report-receipt-root`, optional
126
134
  `branch-receipt-root` and `pull-request-receipt-root`, `action-count`,
@@ -83,7 +83,7 @@ The generated caller should contain one reusable `uses:` edge and a manual
83
83
  ```bash
84
84
  rg -n 'uses:|buildchain-ref:' .github/workflows/build.yml
85
85
  pnpm exec buildchain release --dry-run \
86
- --target-ref alpha/v3/v3.0 \
86
+ --target-ref alpha/v4/v4.0 \
87
87
  --json
88
88
  ```
89
89
 
package/docs/install.md CHANGED
@@ -6,8 +6,8 @@ adopting a new version.
6
6
 
7
7
  ## Standalone Binary
8
8
 
9
- Buildchain v3.0.0 does not publish standalone platform archives. This section
10
- documents the verified legacy binary release contract; v3 consumers should use
9
+ Buildchain v4.0.0 does not publish standalone platform archives. This section
10
+ documents the verified legacy binary release contract; v4 consumers should use
11
11
  the npm package or repository workflow surface below.
12
12
 
13
13
  Use the archive that matches the platform:
@@ -64,7 +64,7 @@ Stable consumers should pin the exact Buildchain version they have validated,
64
64
  for example:
65
65
 
66
66
  ```bash
67
- pnpm add -D @kungfu-tech/buildchain@3.0.0
67
+ pnpm add -D @kungfu-tech/buildchain@4.0.0
68
68
  ```
69
69
 
70
70
  If a repository dogfoods a just-published Buildchain version and pnpm's release
@@ -74,7 +74,7 @@ all packages:
74
74
 
75
75
  ```yaml
76
76
  minimumReleaseAgeExclude:
77
- - '@kungfu-tech/buildchain@3.0.0'
77
+ - '@kungfu-tech/buildchain@4.0.0'
78
78
  ```
79
79
 
80
80
  Remove that entry after the package is old enough for the repository's normal
@@ -89,7 +89,7 @@ packages.
89
89
  ```bash
90
90
  npx @kungfu-tech/buildchain init --type package --package-manager pnpm
91
91
  npx @kungfu-tech/buildchain validate --require-version-state
92
- npx @kungfu-tech/buildchain release --dry-run --target-ref alpha/v3/v3.0
92
+ npx @kungfu-tech/buildchain release --dry-run --target-ref alpha/v4/v4.0
93
93
  ```
94
94
 
95
95
  Use `.buildchain/buildchain.toml` to declare lifecycle commands. The commands may use Node
@@ -77,13 +77,8 @@ KFD records and evidence by SHA-256. The result uses
77
77
  `buildchain kfd support project` derives a compatibility projection from the
78
78
  standard adopter manifest and its exact passing gate. The adopter manifest is
79
79
  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. Gate creation
81
- accepts an explicit `expectedAdopterId`, `expectedSourceRepository`, and
82
- `expectedSourceSha`; omitting the first two preserves the Buildchain
83
- self-release default. The gate, every product-gate projection, the legacy
84
- matrix, Release Passport, and artifact evidence all retain that exact
85
- adopter/repository/source closure. The emitted matrix is not an independent
86
- declaration and cannot widen adopter claims.
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.
87
82
 
88
83
  ## KFD-1
89
84
 
@@ -301,10 +301,8 @@ and optionally `lifecycle.publish`.
301
301
  The verify stage runs after Buildchain has applied the generated version-state
302
302
  changes to the local checkout, and before it creates release commits or moves
303
303
  refs. After the command finishes, Buildchain checks that only declared
304
- `version.files` and `version.derived_files` changed. The latter declares tracked
305
- outputs regenerated by `lifecycle.version-state` that do not directly contain a
306
- version field. This prevents verification from quietly adding extra source
307
- changes to the release commit while keeping generated evidence explicit.
304
+ version-state files changed. This prevents verification from quietly adding
305
+ extra source changes to the release commit.
308
306
 
309
307
  Buildchain-owned untracked runtime evidence is excluded only through an exact
310
308
  internal allowlist. This includes contract-drift issue material under