@kungfu-tech/buildchain 4.0.2 → 4.0.3-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 (233) hide show
  1. package/AGENTS.md +4 -4
  2. package/CONTRIBUTING.md +34 -0
  3. package/README.md +1 -1
  4. package/architecture/agent-change-map.md +154 -147
  5. package/architecture/{v4-architecture-constitution.md → architecture-constitution.md} +11 -11
  6. package/architecture/{v3-core-mechanism-inventory.md → baseline-core-mechanism-inventory.md} +1 -1
  7. package/architecture/{v4-bootstrap-authority.json → bootstrap-authority.json} +3 -3
  8. package/architecture/{v3-v4-capability-closure.md → capability-parity-closure.md} +3 -3
  9. package/architecture/{v3-v4-live-capability-inventory.json → capability-parity-live-capability-inventory.json} +4 -4
  10. package/architecture/{v4-capability-state-machine-manifest.json → capability-state-machine-manifest.json} +2 -2
  11. package/architecture/{v4-capability-state-machine-manifest.schema.json → capability-state-machine-manifest.schema.json} +2 -2
  12. package/architecture/ci-lane-change-budget.json +18 -0
  13. package/architecture/{v4-cross-platform-adopter-qualification.json → cross-platform-adopter-qualification.json} +3 -3
  14. package/architecture/{v4-delivery-authority-parity.json → delivery-authority-parity.json} +16 -16
  15. package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.json → delivery-warrant-shadow-bootstrap-plan.json} +3 -3
  16. package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.md → delivery-warrant-shadow-bootstrap-plan.md} +7 -7
  17. package/architecture/{v4-floating-consumer-policy.md → floating-consumer-policy.md} +1 -1
  18. package/architecture/implementation-naming.json +1273 -0
  19. package/architecture/internal-capabilities.json +171 -169
  20. package/architecture/maintainability-debt.json +87 -82
  21. package/architecture/maintainability-policy.json +15 -15
  22. package/architecture/{v4-next-development-parity.json → next-development-parity.json} +8 -8
  23. package/architecture/{v4-partial-mutation-recovery-qualification.json → partial-mutation-recovery-qualification.json} +8 -8
  24. package/architecture/{v4-platform-stage-checkpoints.json → platform-stage-checkpoints.json} +2 -2
  25. package/architecture/{v4-provider-operation-journal-contract.json → provider-operation-journal-contract.json} +9 -9
  26. package/architecture/{v4-publication-rehearsal-parity.json → publication-rehearsal-parity.json} +4 -4
  27. package/architecture/{v4-release-activation-shadow-domain.json → release-activation-shadow-domain.json} +8 -8
  28. package/architecture/{v4-release-topology.json → release-topology.json} +112 -56
  29. package/architecture/{v4-release-train-parity.json → release-train-parity.json} +2 -2
  30. package/architecture/{v4-runtime-ref-resume-authority.json → runtime-ref-resume-authority.json} +1 -1
  31. package/architecture/{v4-runtime-semantic-closure.json → runtime-semantic-closure.json} +2 -2
  32. package/architecture/{v4-rust-libnode-bridge-evaluation.json → rust-libnode-bridge-evaluation.json} +3 -3
  33. package/architecture/{v4-rust-libnode-bridge-spike.md → rust-libnode-bridge-spike.md} +6 -6
  34. package/architecture/{v4-rust-wasm-production-authority.json → rust-wasm-production-authority.json} +11 -11
  35. package/architecture/{v4-stable-publication-fence.json → stable-publication-fence.json} +6 -6
  36. package/architecture/{v4-stage-capsule-contract.json → stage-capsule-contract.json} +1 -1
  37. package/architecture/{v4-stage-capsule-qualification.json → stage-capsule-qualification.json} +6 -6
  38. package/architecture/{v4-stage-capsule-resume-planner.json → stage-capsule-resume-planner.json} +2 -2
  39. package/architecture/{v4-stage-capsule-store-contract.json → stage-capsule-store-contract.json} +4 -4
  40. package/architecture/{v4-tail-reseal-parity.json → tail-reseal-parity.json} +28 -28
  41. package/architecture/{v4-universal-workflow-bootstrap.json → universal-workflow-bootstrap.json} +9 -4
  42. package/architecture/{v4-universal-workflow-fault-campaign.json → universal-workflow-fault-campaign.json} +8 -8
  43. package/architecture/{v4-universal-workflow-train-admission.json → universal-workflow-train-admission.json} +8 -8
  44. package/architecture/workflow-taxonomy.json +11 -0
  45. package/bin/buildchain.mjs +3 -3
  46. package/bin/internal/adopter-delivery-cli.mjs +9 -9
  47. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  48. package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/Cargo.lock +1 -1
  49. package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/Cargo.toml +1 -1
  50. package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/src/main.rs +3 -3
  51. package/dist/site/buildchain-contract.json +18 -18
  52. package/dist/site/buildchain-site.json +167 -71
  53. package/dist/site/capability-registry.json +5 -5
  54. package/dist/site/kfd-claims.json +226 -90
  55. package/dist/site/kfd-upstream-aggregate.json +1 -1
  56. package/dist/site/manual-registry.json +7 -7
  57. package/dist/site/node-api-registry.json +12929 -10491
  58. package/dist/site/page-registry.json +155 -59
  59. package/dist/site/public-surface-audit.json +65 -46
  60. package/dist/site/publication-authority-registry.json +27 -17
  61. package/dist/site/publication-registry.json +4 -4
  62. package/dist/site/release-provenance.json +18 -9
  63. package/dist/site/site-manifest.json +11 -11
  64. package/dist/site/workflow-registry.json +86 -52
  65. package/docs/MAP.md +4 -3
  66. package/docs/next-development-transition.md +24 -1
  67. package/docs/node-api-reference.md +435 -175
  68. package/docs/oci-publication.md +173 -0
  69. package/docs/publish-transaction.md +36 -3
  70. package/docs/release-flow.md +1 -1
  71. package/docs/reusable-build-surface.md +1 -1
  72. package/docs/v4-adopter-delivery.md +2 -2
  73. package/docs/v4-canonical-contracts.md +7 -7
  74. package/docs/v4-delivery-warrant-read-candidate.md +3 -3
  75. package/docs/v4-delivery-warrant-semantic-diff.md +3 -3
  76. package/docs/v4-production-release.md +8 -2
  77. package/docs/v4-publication-rehearsal.md +3 -3
  78. package/docs/v4-runtime-ref-resume-authority.md +2 -2
  79. package/docs/v4-rust-wasm-production-authority.md +6 -6
  80. package/docs/v4-stage-capsule.md +7 -7
  81. package/docs/v4-tail-reseal.md +1 -1
  82. package/docs/workflow-catalog.md +1 -0
  83. package/package.json +37 -26
  84. package/packages/compatibility/adopter-delivery.js +16 -0
  85. package/packages/compatibility/cross-platform-adopter-qualification.js +12 -0
  86. package/packages/compatibility/floating-consumer-policy.js +14 -0
  87. package/packages/compatibility/publication-qualification.js +11 -0
  88. package/packages/compatibility/publication-rehearsal.js +18 -0
  89. package/packages/compatibility/runtime-ref-resume-authority.js +13 -0
  90. package/packages/compatibility/tail-reseal-receipt.js +7 -0
  91. package/packages/compatibility/tail-reseal.js +11 -0
  92. package/packages/core/{v4-adopter-delivery-parity.js → adopter-delivery-parity.js} +12 -12
  93. package/packages/core/{v4-adopter-delivery.js → adopter-delivery.js} +24 -24
  94. package/packages/core/buildchain-contract.js +5 -5
  95. package/packages/core/buildchain-domain.wasm +0 -0
  96. package/packages/core/buildchain-publication-authority.js +1 -0
  97. package/packages/core/{v4-canonical-contracts.js → canonical-contracts.js} +32 -31
  98. package/packages/core/{v4-cross-platform-adopter-qualification.js → cross-platform-adopter-qualification.js} +19 -19
  99. package/packages/core/{v4-delivery-warrant-fixture-runner.js → delivery-warrant-fixture-runner.js} +36 -32
  100. package/packages/core/{v4-delivery-warrant-read-candidate.js → delivery-warrant-read-candidate.js} +40 -40
  101. package/packages/core/{v4-delivery-warrant-semantic-diff-gate.js → delivery-warrant-semantic-diff-gate.js} +58 -59
  102. package/packages/core/{v4-delivery-warrant-shadow-adapter.js → delivery-warrant-shadow-adapter.js} +15 -15
  103. package/packages/core/dev-delivery-execution-transfer.js +6 -6
  104. package/packages/core/dev-delivery-native-proof.js +12 -8
  105. package/packages/core/dev-delivery-warrant-legacy-recovery.js +1 -1
  106. package/packages/core/dev-delivery-warrant-native-compatibility.js +4 -4
  107. package/packages/core/dev-delivery-warrant-state.js +11 -11
  108. package/packages/core/dev-delivery-warrant.js +3 -3
  109. package/packages/core/domain-wasm-artifact.js +7 -0
  110. package/packages/core/{v4-domain-wasm.js → domain-wasm.js} +31 -31
  111. package/packages/core/{v4-floating-consumer-evidence.js → floating-consumer-evidence.js} +13 -13
  112. package/packages/core/{v4-floating-consumer-policy.js → floating-consumer-policy.js} +27 -29
  113. package/packages/core/{v4-floating-consumer-release-passport.js → floating-consumer-release-passport.js} +25 -25
  114. package/packages/core/index.js +4 -8
  115. package/packages/core/next-development-projection.js +24 -1
  116. package/packages/core/next-development-transition.js +5 -6
  117. package/packages/core/oci-compose-qualification.js +143 -0
  118. package/packages/core/oci-publication-bundle.js +281 -0
  119. package/packages/core/oci-publication-graph.js +206 -0
  120. package/packages/core/paper-runtime-channels.js +2 -2
  121. package/packages/core/paper.js +3 -3
  122. package/packages/core/partial-mutation-recovery-qualification.js +18 -0
  123. package/packages/core/{v4-platform-stage-checkpoints.js → platform-stage-checkpoints.js} +37 -37
  124. package/packages/core/{v4-product-publication.js → product-publication.js} +11 -9
  125. package/packages/core/{v4-protected-publication-source.js → protected-publication-source.js} +3 -3
  126. package/packages/core/provider-operation-journal.js +62 -0
  127. package/packages/core/{v4-provider-readback-idempotency.js → provider-readback-idempotency.js} +33 -33
  128. package/packages/core/public-export-compatibility.js +33 -0
  129. package/packages/core/publication-development.js +72 -0
  130. package/packages/core/{v4-publication-qualification.js → publication-qualification.js} +17 -17
  131. package/packages/core/{v4-publication-rehearsal-capsule.js → publication-rehearsal-capsule.js} +23 -23
  132. package/packages/core/publication-rehearsal-projection.js +2 -2
  133. package/packages/core/{v4-publication-rehearsal-provider-bindings.js → publication-rehearsal-provider-bindings.js} +4 -4
  134. package/packages/core/publication-rehearsal-runtime.js +21 -21
  135. package/packages/core/{v4-publication-rehearsal.js → publication-rehearsal.js} +33 -33
  136. package/packages/core/publication-sealed-bundle.js +78 -13
  137. package/packages/core/release-activation-shadow.js +32 -0
  138. package/packages/core/release-candidate.js +6 -6
  139. package/packages/core/{v4-release-invocation.js → release-invocation.js} +15 -15
  140. package/packages/core/release-passport.js +36 -36
  141. package/packages/core/release-tail-product-capabilities.js +9 -0
  142. package/packages/core/release-tail-provider-plane.js +10 -10
  143. package/packages/core/{v4-runtime-ref-resume-authority.js → runtime-ref-resume-authority.js} +36 -40
  144. package/packages/core/{v4-runtime-selector-persistence.js → runtime-selector-persistence.js} +7 -7
  145. package/packages/core/stable-publication-fence.js +28 -0
  146. package/packages/core/{v4-stage-capsule-local-store.js → stage-capsule-local-store.js} +56 -54
  147. package/packages/core/{v4-stage-capsule-qualification-campaign.js → stage-capsule-qualification-campaign.js} +37 -38
  148. package/packages/core/{v4-stage-capsule-qualification.js → stage-capsule-qualification.js} +28 -29
  149. package/packages/core/{v4-stage-capsule-resume-planner.js → stage-capsule-resume-planner.js} +29 -29
  150. package/packages/core/{v4-stage-capsule-store.js → stage-capsule-store.js} +59 -56
  151. package/packages/core/{v4-stage-capsule.js → stage-capsule.js} +45 -45
  152. package/packages/core/{v4-tail-reseal-contract.js → tail-reseal-contract.js} +6 -6
  153. package/packages/core/{v4-tail-reseal-github.js → tail-reseal-github.js} +12 -12
  154. package/packages/core/{v4-tail-reseal-receipt.js → tail-reseal-receipt.js} +22 -22
  155. package/packages/core/{v4-tail-reseal.js → tail-reseal.js} +29 -29
  156. package/packages/core/{v4-universal-workflow-bootstrap.js → universal-workflow-bootstrap.js} +23 -23
  157. package/scripts/{v4-architecture.mjs → architecture.mjs} +6 -6
  158. package/scripts/binary-publication-evidence.mjs +1 -1
  159. package/scripts/{v4-bridge-bootstrap.mjs → bridge-bootstrap.mjs} +14 -18
  160. package/scripts/{v4-bridge-evidence.mjs → bridge-evidence.mjs} +8 -8
  161. package/scripts/{build-v4-domain-wasm.mjs → build-domain-wasm.mjs} +6 -18
  162. package/scripts/{v3-v4-capability-catalog.mjs → capability-parity-catalog.mjs} +19 -19
  163. package/scripts/check-action-bundles.mjs +2 -2
  164. package/scripts/{check-v3-v4-capability-inventory.mjs → check-capability-parity-inventory.mjs} +42 -42
  165. package/scripts/check-core-mechanism-inventory.mjs +4 -1
  166. package/scripts/{check-v4-floating-consumer-policy-contract.mjs → check-floating-consumer-policy-contract.mjs} +8 -8
  167. package/scripts/check-implementation-naming.mjs +135 -0
  168. package/scripts/check-inventory.mjs +6 -5
  169. package/scripts/check-maintainability.mjs +9 -2
  170. package/scripts/{check-v4-public-dogfood-contract.mjs → check-public-dogfood-contract.mjs} +15 -15
  171. package/scripts/{check-v4-release-topology.mjs → check-release-topology.mjs} +53 -31
  172. package/scripts/{check-v4-runtime-semantic-closure.mjs → check-runtime-semantic-closure.mjs} +19 -16
  173. package/scripts/{check-v4-universal-workflow-bootstrap.mjs → check-universal-workflow-bootstrap.mjs} +14 -14
  174. package/scripts/{v4-consumer-policy.mjs → consumer-policy.mjs} +15 -15
  175. package/scripts/{copy-v4-domain-wasm.mjs → copy-domain-wasm.mjs} +3 -3
  176. package/scripts/{v4-cross-platform-adopter-qualification.mjs → cross-platform-adopter-qualification.mjs} +9 -9
  177. package/scripts/{v4-declarative-promotion-admission.mjs → declarative-promotion-admission.mjs} +4 -4
  178. package/scripts/dev-delivery-warrant-options.mjs +1 -1
  179. package/scripts/dev-delivery-warrant-store.mjs +29 -10
  180. package/scripts/dev-delivery-warrant.mjs +4 -4
  181. package/scripts/dev-pr-delivery-warrant.mjs +1 -1
  182. package/scripts/generate-channel-build-workflow.mjs +2 -2
  183. package/scripts/generate-channel-promotion-workflow.mjs +14 -31
  184. package/scripts/generate-release-candidate-passport.mjs +23 -23
  185. package/scripts/generate-site-bundle.mjs +17 -17
  186. package/scripts/{generate-v4-universal-workflow-facades.mjs → generate-universal-workflow-facades.mjs} +61 -21
  187. package/scripts/{v4-host-adapter.mjs → host-adapter.mjs} +1 -1
  188. package/scripts/implementation-references.mjs +25 -0
  189. package/scripts/init-repo.mjs +1 -1
  190. package/scripts/next-development-review.mjs +17 -11
  191. package/scripts/oci-compose-preview.mjs +261 -0
  192. package/scripts/{v4-platform-stage-checkpoint-rehearsal.mjs → platform-stage-checkpoint-rehearsal.mjs} +17 -17
  193. package/scripts/{v4-product-publication-intent.mjs → product-publication-intent.mjs} +16 -8
  194. package/scripts/publication-candidate-kind.mjs +93 -0
  195. package/scripts/publication-candidate-sealer.mjs +16 -1
  196. package/scripts/{v4-publication-rehearsal-fixture.mjs → publication-rehearsal-fixture.mjs} +5 -5
  197. package/scripts/{v4-publication-settlement.mjs → publication-settlement.mjs} +8 -8
  198. package/scripts/{v4-release-candidate-adapter.mjs → release-candidate-adapter.mjs} +4 -4
  199. package/scripts/release-candidate-resolver.mjs +15 -26
  200. package/scripts/release-tail.mjs +5 -5
  201. package/scripts/resume-from-candidate-run.mjs +35 -42
  202. package/scripts/site-capability-metadata.mjs +9 -0
  203. package/scripts/source-verification-evidence.mjs +7 -7
  204. package/scripts/{v4-stage-capsule-qualification.mjs → stage-capsule-qualification.mjs} +62 -62
  205. package/scripts/{v4-stage-capsule-resume-rehearsal.mjs → stage-capsule-resume-rehearsal.mjs} +6 -6
  206. package/scripts/{v4-tail-reseal-macos-rehearsal.mjs → tail-reseal-macos-rehearsal.mjs} +9 -9
  207. package/scripts/{v4-tail-reseal.mjs → tail-reseal.mjs} +19 -19
  208. package/scripts/universal-facade-maintainability.mjs +12 -3
  209. package/scripts/{v4-universal-workflow-backflow.mjs → universal-workflow-backflow.mjs} +10 -10
  210. package/scripts/{v4-universal-workflow-engine.mjs → universal-workflow-engine.mjs} +40 -38
  211. package/scripts/{v4-universal-workflow-self-dogfood.mjs → universal-workflow-self-dogfood.mjs} +12 -12
  212. package/scripts/verify-version-state-delta.mjs +4 -2
  213. package/scripts/{v4-warrant-shadow-plan.mjs → warrant-shadow-plan.mjs} +6 -6
  214. package/templates/universal-buildchain-bootstrap-recovery.yml +4 -4
  215. package/packages/core/buildchain-v4-domain.wasm +0 -0
  216. package/packages/core/v4-domain-wasm-artifact.js +0 -7
  217. package/packages/core/v4-partial-mutation-recovery-qualification.js +0 -18
  218. package/packages/core/v4-provider-operation-journal.js +0 -62
  219. package/packages/core/v4-release-activation-shadow.js +0 -32
  220. package/packages/core/v4-stable-publication-fence.js +0 -28
  221. /package/actions/{v4-release-candidate-promote → release-candidate-promote}/README.md +0 -0
  222. /package/architecture/{v4-adopter-delivery-parity.json → adopter-delivery-parity.json} +0 -0
  223. /package/architecture/{v3-core-mechanism-inventory.json → baseline-core-mechanism-inventory.json} +0 -0
  224. /package/architecture/{v4-canonical-contract-fixtures.json → canonical-contract-fixtures.json} +0 -0
  225. /package/architecture/{v4-compatibility-facts-parity.json → compatibility-facts-parity.json} +0 -0
  226. /package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.schema.json → delivery-warrant-shadow-bootstrap-plan.schema.json} +0 -0
  227. /package/architecture/{v4-delivery-warrant-shadow-fixtures.json → delivery-warrant-shadow-fixtures.json} +0 -0
  228. /package/architecture/{v4-delivery-warrant-shadow-fixtures.schema.json → delivery-warrant-shadow-fixtures.schema.json} +0 -0
  229. /package/architecture/{v4-exception-ledger.json → exception-ledger.json} +0 -0
  230. /package/architecture/{v4-exception-ledger.schema.json → exception-ledger.schema.json} +0 -0
  231. /package/architecture/{v4-floating-consumer-policy.json → floating-consumer-policy.json} +0 -0
  232. /package/architecture/{v4-publication-facade-patches.json → publication-facade-patches.json} +0 -0
  233. /package/architecture/{v4-release-invocation-fixtures.json → release-invocation-fixtures.json} +0 -0
@@ -278,7 +278,7 @@ export function devDeliveryCliOptions(args = [], environment = process.env) {
278
278
  rest,
279
279
  "read-evidence-output",
280
280
  environment.BUILDCHAIN_V4_WARRANT_READ_EVIDENCE ||
281
- ".buildchain/dev-delivery/v4-read-evidence.json",
281
+ ".buildchain/dev-delivery/read-evidence.json",
282
282
  ),
283
283
  now: flag(rest, "now", environment.BUILDCHAIN_DEV_DELIVERY_NOW),
284
284
  outputPath: flag(
@@ -54,7 +54,10 @@ function decodeGitHubBlobEnvelope(raw) {
54
54
  ).toString("utf8");
55
55
  }
56
56
 
57
- function validateStoredState(queue, { allowLegacyV3Readback = false } = {}) {
57
+ function validateStoredState(
58
+ queue,
59
+ { allowLegacyBaselineReadback = false } = {},
60
+ ) {
58
61
  const body = structuredClone(queue || {});
59
62
  const embeddedStateRoot = body.stateRoot;
60
63
  delete body.stateRoot;
@@ -67,7 +70,7 @@ function validateStoredState(queue, { allowLegacyV3Readback = false } = {}) {
67
70
  ) {
68
71
  normalizeDevDeliveryAuthorityState(queue);
69
72
  } else {
70
- normalizeDevDeliveryQueue(queue, { allowLegacyV3Readback });
73
+ normalizeDevDeliveryQueue(queue, { allowLegacyBaselineReadback });
71
74
  }
72
75
  return queue;
73
76
  }
@@ -157,9 +160,19 @@ export class GitHubDevDeliveryStore {
157
160
  return raw;
158
161
  }
159
162
 
160
- async read({ stateRef, protectedBase, now, allowLegacyV3Readback = false }) {
163
+ async read({
164
+ stateRef,
165
+ protectedBase,
166
+ now,
167
+ allowLegacyBaselineReadback = false,
168
+ }) {
161
169
  return this.retryParseableRead(async () =>
162
- this.readOnce({ stateRef, protectedBase, now, allowLegacyV3Readback }),
170
+ this.readOnce({
171
+ stateRef,
172
+ protectedBase,
173
+ now,
174
+ allowLegacyBaselineReadback,
175
+ }),
163
176
  );
164
177
  }
165
178
 
@@ -167,7 +180,7 @@ export class GitHubDevDeliveryStore {
167
180
  stateRef,
168
181
  protectedBase,
169
182
  now,
170
- allowLegacyV3Readback = false,
183
+ allowLegacyBaselineReadback = false,
171
184
  }) {
172
185
  let ref;
173
186
  try {
@@ -189,18 +202,24 @@ export class GitHubDevDeliveryStore {
189
202
  }
190
203
  const commitSha = exactSha(ref?.object?.sha, "state ref commit");
191
204
  const readback = await this.readCommit(commitSha, {
192
- allowLegacyV3Readback,
205
+ allowLegacyBaselineReadback,
193
206
  });
194
207
  return { exists: true, ...readback };
195
208
  }
196
209
 
197
- async readCommit(commitShaInput, { allowLegacyV3Readback = false } = {}) {
210
+ async readCommit(
211
+ commitShaInput,
212
+ { allowLegacyBaselineReadback = false } = {},
213
+ ) {
198
214
  return this.retryParseableRead(async () =>
199
- this.readCommitOnce(commitShaInput, { allowLegacyV3Readback }),
215
+ this.readCommitOnce(commitShaInput, { allowLegacyBaselineReadback }),
200
216
  );
201
217
  }
202
218
 
203
- async readCommitOnce(commitShaInput, { allowLegacyV3Readback = false } = {}) {
219
+ async readCommitOnce(
220
+ commitShaInput,
221
+ { allowLegacyBaselineReadback = false } = {},
222
+ ) {
204
223
  const commitSha = exactSha(commitShaInput, "state commit");
205
224
  const commit = await this.request(
206
225
  "GET",
@@ -221,7 +240,7 @@ export class GitHubDevDeliveryStore {
221
240
  );
222
241
  const bytes = decodeGitHubBlobEnvelope(raw);
223
242
  const queue = validateStoredState(JSON.parse(bytes), {
224
- allowLegacyV3Readback,
243
+ allowLegacyBaselineReadback,
225
244
  });
226
245
  return { commitSha, queue, bytes };
227
246
  }
@@ -17,7 +17,7 @@ import {
17
17
  } from "../packages/core/dev-delivery-warrant.js";
18
18
  import { recoverLegacyTerminalDevDeliveryQueue } from "../packages/core/dev-delivery-warrant-legacy-recovery.js";
19
19
  import { reuseExactActiveDevDeliverySourceProof } from "../packages/core/dev-delivery-candidate-identity.js";
20
- import { runV4DeliveryWarrantReadCandidate } from "../packages/core/v4-delivery-warrant-read-candidate.js";
20
+ import { runDeliveryWarrantReadCandidate } from "../packages/core/delivery-warrant-read-candidate.js";
21
21
 
22
22
  import { GitHubDevDeliveryStore } from "./dev-delivery-warrant-store.mjs";
23
23
  import { persistDevDeliveryTransition } from "./dev-delivery-warrant-transition.mjs";
@@ -363,7 +363,7 @@ async function observeQueue(loaded, options) {
363
363
  throw new Error("readMode must be v3 or v4");
364
364
  let observation = observeDevDeliveryQueue(loaded.queue, {
365
365
  now: options.now,
366
- allowLegacyV3Readback: true,
366
+ allowLegacyBaselineReadback: true,
367
367
  });
368
368
  let readCandidate;
369
369
  if (readMode === "v4") {
@@ -384,7 +384,7 @@ async function observeQueue(loaded, options) {
384
384
  );
385
385
  return { receiptRoot: evidence.evidenceRoot };
386
386
  });
387
- readCandidate = await runV4DeliveryWarrantReadCandidate(loaded.queue, {
387
+ readCandidate = await runDeliveryWarrantReadCandidate(loaded.queue, {
388
388
  qualification,
389
389
  expectedQualificationRoot: options.readQualificationRoot,
390
390
  expectedSources: {
@@ -444,7 +444,7 @@ export async function runDevDeliveryCommand(optionsInput = {}, clientInput) {
444
444
  stateRef: options.stateRef,
445
445
  protectedBase: options.branch,
446
446
  now: options.now,
447
- allowLegacyV3Readback: ["observe", "recover-legacy-terminal"].includes(
447
+ allowLegacyBaselineReadback: ["observe", "recover-legacy-terminal"].includes(
448
448
  options.command,
449
449
  ),
450
450
  });
@@ -143,7 +143,7 @@ export async function readCurrentDeliveryQueueState(client, repository, targetBr
143
143
  const { queue } = await store.read({
144
144
  stateRef: defaultDevDeliveryStateRef(targetBranch),
145
145
  protectedBase: targetBranch,
146
- allowLegacyV3Readback: true,
146
+ allowLegacyBaselineReadback: true,
147
147
  });
148
148
  return queue;
149
149
  }
@@ -4,7 +4,7 @@ import fs from "node:fs";
4
4
  import { writeWorkflowSource } from "./workflow-taxonomy.mjs";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
- import { migrateV4UniversalWorkflowFacade } from "./generate-v4-universal-workflow-facades.mjs";
7
+ import { migrateUniversalWorkflowFacade } from "./generate-universal-workflow-facades.mjs";
8
8
 
9
9
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
10
10
  const sourcePath = path.join(root, ".github/workflows/.build.yml");
@@ -405,7 +405,7 @@ export function generateChannelBuildWorkflow(source) {
405
405
  ].join("\n"),
406
406
  )
407
407
  .replace("\n alpha:\n", `\n${routerControllerPlanJob()}\n\n alpha:\n`);
408
- return migrateV4UniversalWorkflowFacade(
408
+ return migrateUniversalWorkflowFacade(
409
409
  `${generated.trimEnd()}\n\n${routerControllerReceiptJob()}\n\n${routerAggregateJob()}\n`,
410
410
  ".github/workflows/build.yml",
411
411
  );
@@ -4,7 +4,7 @@ import fs from "node:fs";
4
4
  import { writeWorkflowSource } from "./workflow-taxonomy.mjs";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
- import { migrateV4UniversalWorkflowFacade } from "./generate-v4-universal-workflow-facades.mjs";
7
+ import { migrateUniversalWorkflowFacade } from "./generate-universal-workflow-facades.mjs";
8
8
 
9
9
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
10
10
  const sourcePath = path.join(root, ".github/workflows/.release-candidate-promote.yml");
@@ -210,7 +210,7 @@ function consumerAdmissionJob() {
210
210
  with:
211
211
  repository: \${{ inputs.buildchain-repository }}
212
212
  ref: \${{ needs.resolve-promotion.outputs.router-sha }}
213
- path: .buildchain/v4-policy-runtime
213
+ path: .buildchain/policy-runtime
214
214
  persist-credentials: false
215
215
  - name: Enforce v4 floating consumer policy
216
216
  id: policy
@@ -223,16 +223,16 @@ function consumerAdmissionJob() {
223
223
  BUILDCHAIN_RUNTIME_SHA: \${{ needs.resolve-promotion.outputs.router-sha }}
224
224
  BUILDCHAIN_STABLE_CONTRACT_LOCK_PATH: \${{ inputs.buildchain-stable-contract-lock-path }}
225
225
  BUILDCHAIN_ALPHA_CONTRACT_LOCK_PATH: \${{ inputs.buildchain-alpha-contract-lock-path }}
226
- BUILDCHAIN_V4_POLICY_RECEIPT_PATH: .buildchain/evidence/v4-consumer-policy-receipt.json
226
+ BUILDCHAIN_V4_POLICY_RECEIPT_PATH: .buildchain/evidence/consumer-policy-receipt.json
227
227
  run: >-
228
- node .buildchain/v4-policy-runtime/scripts/v4-consumer-policy.mjs scan
228
+ node .buildchain/policy-runtime/scripts/consumer-policy.mjs scan
229
229
  --source-sha "\${{ inputs.target-sha || github.sha }}"
230
230
 
231
231
  - name: Upload rooted consumer admission receipt
232
232
  uses: actions/upload-artifact@v7.0.1
233
233
  with:
234
234
  name: v4-consumer-policy-release-candidate-promote-\${{ github.sha }}
235
- path: .buildchain/consumer/.buildchain/evidence/v4-consumer-policy-receipt.json
235
+ path: .buildchain/consumer/.buildchain/evidence/consumer-policy-receipt.json
236
236
  if-no-files-found: error
237
237
 
238
238
  - name: Authorize transient v4 runtime selection
@@ -240,18 +240,18 @@ function consumerAdmissionJob() {
240
240
  if: \${{ needs.resolve-promotion.outputs.override-used == 'true' }}
241
241
  uses: actions/github-script@v8
242
242
  env:
243
- BUILDCHAIN_RUNTIME_AUTHORIZATION_PATH: .buildchain/consumer/.buildchain/evidence/v4-runtime-authorization.json
243
+ BUILDCHAIN_RUNTIME_AUTHORIZATION_PATH: .buildchain/consumer/.buildchain/evidence/runtime-authorization.json
244
244
  with:
245
245
  script: |
246
- const script = require(process.env.GITHUB_WORKSPACE + "/.buildchain/v4-policy-runtime/scripts/authorize-promotion-runtime-override.cjs");
246
+ const script = require(process.env.GITHUB_WORKSPACE + "/.buildchain/policy-runtime/scripts/authorize-promotion-runtime-override.cjs");
247
247
  const result = await script.authorizePromotionRuntimeOverride({
248
248
  github,
249
249
  context,
250
250
  request: {
251
251
  consumerRoot: process.env.GITHUB_WORKSPACE + "/.buildchain/consumer",
252
- runtimeModulePath: process.env.GITHUB_WORKSPACE + "/.buildchain/v4-policy-runtime/packages/core/v4-runtime-ref-resume-authority.js",
252
+ runtimeModulePath: process.env.GITHUB_WORKSPACE + "/.buildchain/policy-runtime/packages/core/runtime-ref-resume-authority.js",
253
253
  runtimeRepository: "\${{ inputs.buildchain-repository }}",
254
- consumerPolicyReceiptPath: process.env.GITHUB_WORKSPACE + "/.buildchain/consumer/.buildchain/evidence/v4-consumer-policy-receipt.json",
254
+ consumerPolicyReceiptPath: process.env.GITHUB_WORKSPACE + "/.buildchain/consumer/.buildchain/evidence/consumer-policy-receipt.json",
255
255
  consumerPolicyReceiptRoot: "\${{ steps.policy.outputs.v4-consumer-policy-receipt-root }}",
256
256
  sourceSha: "\${{ inputs.target-sha || github.sha }}",
257
257
  requestedRef: "\${{ needs.resolve-promotion.outputs.runtime-ref }}",
@@ -272,7 +272,7 @@ function consumerAdmissionJob() {
272
272
  uses: actions/upload-artifact@v7.0.1
273
273
  with:
274
274
  name: v4-runtime-authorization-release-candidate-promote-\${{ github.run_id }}
275
- path: .buildchain/consumer/.buildchain/evidence/v4-runtime-authorization.json
275
+ path: .buildchain/consumer/.buildchain/evidence/runtime-authorization.json
276
276
  if-no-files-found: error
277
277
  `;
278
278
  }
@@ -304,7 +304,7 @@ export function generateChannelPromotionWorkflow(source, { major = 2, shellRouti
304
304
  if (!inputNames.includes(required)) throw new Error(`advanced promotion workflow missing input: ${required}`);
305
305
  }
306
306
  const invokeForwarded = routedInputs(inputNames, alphaRoute, major);
307
- return migrateV4UniversalWorkflowFacade(`# Generated by scripts/generate-channel-promotion-workflow.mjs. Do not edit directly.
307
+ return migrateUniversalWorkflowFacade(`# Generated by scripts/generate-channel-promotion-workflow.mjs. Do not edit directly.
308
308
  name: Release Candidate Promote
309
309
 
310
310
  on:
@@ -316,16 +316,7 @@ ${secrets.trimEnd()}
316
316
  outputs:
317
317
  ${publicOutputs(outputs)}
318
318
 
319
- permissions:
320
- actions: write
321
- artifact-metadata: write
322
- attestations: write
323
- checks: write
324
- contents: write
325
- id-token: write
326
- issues: write
327
- pull-requests: write
328
-
319
+ # Provider authority is inherited from the explicit caller envelope.
329
320
  jobs:
330
321
  resolve-promotion:
331
322
  name: Resolve promotion workflow shell and runtime
@@ -360,7 +351,7 @@ jobs:
360
351
  run: |
361
352
  set -euo pipefail
362
353
  repository="\${BUILDCHAIN_ROUTER_REPOSITORY}"
363
- ref="\${BUILDCHAIN_ROUTER_REF}"
354
+ ref="\${BUILDCHAIN_ROUTER_REF:-${alphaRoute.logicalRef}}"
364
355
  ref="\${ref#refs/heads/}"
365
356
  ref="\${ref#refs/tags/}"
366
357
  if [[ ! "\${repository}" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ || -z "\${ref}" || "\${ref}" = /* || "\${ref}" = *..* ]]; then
@@ -503,15 +494,7 @@ ${consumerAdmissionJob()}
503
494
  name: Invoke the single v4 publisher adapter
504
495
  needs: [resolve-promotion, consumer-admission]
505
496
  uses: kungfu-systems/buildchain/${alphaRoute.workflowPath}@${alphaRoute.callRef}
506
- permissions:
507
- actions: write
508
- artifact-metadata: write
509
- attestations: write
510
- checks: write
511
- contents: write
512
- id-token: write
513
- issues: write
514
- pull-requests: write
497
+ # Provider authority is inherited from the explicit caller envelope.
515
498
  with:
516
499
  ${invokeForwarded}
517
500
  secrets: inherit
@@ -4,11 +4,11 @@ import path from "node:path";
4
4
  import { execFileSync } from "node:child_process";
5
5
  import { pathToFileURL } from "node:url";
6
6
  import { createReleaseCandidatePassport, validateReleaseCandidatePassport } from "../packages/core/release-candidate.js";
7
- import { scanV4FloatingConsumerPolicy, v4ConsumerPolicyScannerRoot } from "../packages/core/v4-floating-consumer-policy.js";
8
- import { v4ContentRoot } from "../packages/core/v4-canonical-contracts.js";
9
- import { V4_STAGE_CAPSULE_CONTRACT, V4_STAGE_CAPSULE_IDENTITY_CONTRACT, v4StageCapsuleIdentityRoot, v4StageCapsuleRoot, validateV4StageCapsule } from "../packages/core/v4-stage-capsule.js";
10
- import { v4RuntimeResumeDocumentRoot } from "../packages/core/v4-runtime-ref-resume-authority.js";
11
- import { createV4PublicationQualificationReceipt } from "../packages/core/v4-publication-qualification.js";
7
+ import { scanFloatingConsumerPolicy, consumerPolicyScannerRoot } from "../packages/core/floating-consumer-policy.js";
8
+ import { domainContentRoot } from "../packages/core/canonical-contracts.js";
9
+ import { STAGE_CAPSULE_CONTRACT, STAGE_CAPSULE_IDENTITY_CONTRACT, stageCapsuleIdentityRoot, stageCapsuleRoot, validateStageCapsule } from "../packages/core/stage-capsule.js";
10
+ import { runtimeResumeDocumentRoot } from "../packages/core/runtime-ref-resume-authority.js";
11
+ import { createDomainPublicationQualificationReceipt } from "../packages/core/publication-qualification.js";
12
12
  import { writeGitHubOutputs } from "./build-contract-core.mjs";
13
13
 
14
14
  const env = (name, fallback = "") => process.env[name] || fallback;
@@ -37,12 +37,12 @@ export function createReleaseCandidateStageCapsules({
37
37
  const coordinate = coordinateByPlatform.get(platform.platformId);
38
38
  if (!coordinate || coordinate.name !== platform.artifactName) throw new Error(`Stage Capsule coordinate missing for ${platform.platformId}`);
39
39
  const manifest = readJsonFile(platform.manifestPath);
40
- return { role: platform.artifactName, platform: platform.platformId, artifactRoot: coordinate.digest, manifestRoot: v4ContentRoot("stage-capsule-artifact-manifest", manifest) };
40
+ return { role: platform.artifactName, platform: platform.platformId, artifactRoot: coordinate.digest, manifestRoot: domainContentRoot("stage-capsule-artifact-manifest", manifest) };
41
41
  });
42
42
  const qualificationExpiresAt = coordinates.artifacts.map((entry) => entry.expiresAt).sort((left, right) => Date.parse(left) - Date.parse(right))[0];
43
- const qualificationReceipt = createV4PublicationQualificationReceipt({
43
+ const qualificationReceipt = createDomainPublicationQualificationReceipt({
44
44
  repository: passport.repository, candidateRoot: `sha256:${passport.candidateHash}`,
45
- sourceSha: passport.source.headSha, sourceRoot: v4ContentRoot("candidate-identity", passport.source),
45
+ sourceSha: passport.source.headSha, sourceRoot: domainContentRoot("candidate-identity", passport.source),
46
46
  policyDigest: passport.consumerPolicy.receiptRoot, artifacts: qualificationArtifacts,
47
47
  issuedAt: passport.createdAt || new Date(Date.parse(qualificationExpiresAt) - 86_400_000).toISOString(), expiresAt: qualificationExpiresAt,
48
48
  });
@@ -57,13 +57,13 @@ export function createReleaseCandidateStageCapsules({
57
57
  }
58
58
  const manifest = readJsonFile(platform.manifestPath);
59
59
  const identity = {
60
- schema: V4_STAGE_CAPSULE_IDENTITY_CONTRACT,
61
- sourceRoot: v4ContentRoot("candidate-identity", passport.source),
60
+ schema: STAGE_CAPSULE_IDENTITY_CONTRACT,
61
+ sourceRoot: domainContentRoot("candidate-identity", passport.source),
62
62
  platform: platform.platformId,
63
- platformRoot: v4ContentRoot("candidate-identity", manifest.platform),
63
+ platformRoot: domainContentRoot("candidate-identity", manifest.platform),
64
64
  stage: "verify",
65
65
  toolchainRoots: [],
66
- runtimeRoot: v4ContentRoot("candidate-identity", {
66
+ runtimeRoot: domainContentRoot("candidate-identity", {
67
67
  sha: passport.buildchain.sha,
68
68
  }),
69
69
  policyRoot: passport.consumerPolicy.receiptRoot,
@@ -73,11 +73,11 @@ export function createReleaseCandidateStageCapsules({
73
73
  root: `sha256:${passport.candidateHash}`,
74
74
  },
75
75
  ],
76
- transformationRoot: v4ContentRoot("candidate-identity", {
76
+ transformationRoot: domainContentRoot("candidate-identity", {
77
77
  lifecycle: manifest.lifecycle,
78
78
  summary: platform.summary,
79
79
  }),
80
- outputManifestRoot: v4ContentRoot(
80
+ outputManifestRoot: domainContentRoot(
81
81
  "stage-capsule-artifact-manifest",
82
82
  { artifact: coordinate, manifest },
83
83
  ),
@@ -85,24 +85,24 @@ export function createReleaseCandidateStageCapsules({
85
85
  observationRoots: [
86
86
  {
87
87
  name: "provider-coordinate",
88
- root: v4ContentRoot("provider-readback-sample", coordinate),
88
+ root: domainContentRoot("provider-readback-sample", coordinate),
89
89
  },
90
90
  ],
91
91
  };
92
92
  const capsule = {
93
- schema: V4_STAGE_CAPSULE_CONTRACT,
93
+ schema: STAGE_CAPSULE_CONTRACT,
94
94
  writerAuthority: "typescript-v3",
95
95
  rustAuthority: "validation-only",
96
96
  identity,
97
- identityRoot: v4StageCapsuleIdentityRoot(identity),
97
+ identityRoot: stageCapsuleIdentityRoot(identity),
98
98
  retentionPromise: {
99
99
  class: "github-artifact",
100
100
  retainUntil: coordinate.expiresAt,
101
101
  },
102
102
  capsuleRoot: `sha256:${"0".repeat(64)}`,
103
103
  };
104
- capsule.capsuleRoot = v4StageCapsuleRoot(capsule);
105
- validateV4StageCapsule(capsule);
104
+ capsule.capsuleRoot = stageCapsuleRoot(capsule);
105
+ validateStageCapsule(capsule);
106
106
  return {
107
107
  platform: platform.platformId,
108
108
  artifactName: coordinate.name,
@@ -133,7 +133,7 @@ export function createReleaseCandidateStageCapsules({
133
133
  publicationQualificationReceipt: qualificationReceipt,
134
134
  capsules: entries,
135
135
  };
136
- return { ...body, root: v4RuntimeResumeDocumentRoot(body) };
136
+ return { ...body, root: runtimeResumeDocumentRoot(body) };
137
137
  }
138
138
 
139
139
  function writeReleaseCandidateStageCapsules({
@@ -188,12 +188,12 @@ export function resolveLegacyConsumerPolicyReceipt(options = {}) {
188
188
  if (!/^[0-9a-f]{40}$/u.test(options.runtimeRef || "") || options.runtimeRef !== options.runtimeSha || options.sourceTreeHash !== options.runtimeTreeHash()) return undefined;
189
189
  const root = path.resolve(options.root || ".buildchain/runtime");
190
190
  const alphaLock = readJsonFile(path.join(root, ".buildchain/alpha-contract-lock.json"));
191
- const result = scanV4FloatingConsumerPolicy({
191
+ const result = scanFloatingConsumerPolicy({
192
192
  root, repository: options.repository, sourceSha: options.sourceSha,
193
193
  invokedWorkflow: options.invokedWorkflow || ".github/workflows/build.yml", invocationSourcePath: options.invocationSourcePath,
194
194
  expectedInvocationChannel: "alpha", resolvedWorkflowSha: alphaLock.buildchain?.resolvedSha,
195
- resolvedRuntimeSha: options.runtimeSha, scannerRoot: v4ConsumerPolicyScannerRoot(),
196
- policy: readJsonFile(path.resolve(import.meta.dirname, "../architecture/v4-floating-consumer-policy.json")),
195
+ resolvedRuntimeSha: options.runtimeSha, scannerRoot: consumerPolicyScannerRoot(),
196
+ policy: readJsonFile(path.resolve(import.meta.dirname, "../architecture/floating-consumer-policy.json")),
197
197
  });
198
198
  if (!result.ok) throw new Error(`legacy floating-shell policy receipt invalid: ${result.failures.map(({ code }) => code).join(", ")}`);
199
199
  return { receipt: result.receipt, receiptRoot: result.receiptRoot };
@@ -51,31 +51,31 @@ const DEV_DELIVERY_AUTHORITY_SCHEMA =
51
51
  "schemas/dev-delivery-authority-v2.schema.json";
52
52
  const DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE =
53
53
  "contracts/dev-delivery-authority-v2.schema.json";
54
- const V4_COMPATIBILITY_FACTS_SCHEMA =
54
+ const COMPATIBILITY_FACTS_SCHEMA =
55
55
  "schemas/v4-compatibility-facts-v1.schema.json";
56
- const V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE =
56
+ const COMPATIBILITY_FACTS_SCHEMA_SOURCE =
57
57
  "contracts/v4-compatibility-facts-v1.schema.json";
58
- const V4_PUBLICATION_REHEARSAL_SCHEMA =
58
+ const PUBLICATION_REHEARSAL_SCHEMA =
59
59
  "schemas/v4-publication-rehearsal-capsule-v1.schema.json";
60
- const V4_PUBLICATION_REHEARSAL_SCHEMA_SOURCE =
60
+ const PUBLICATION_REHEARSAL_SCHEMA_SOURCE =
61
61
  "contracts/v4-publication-rehearsal-capsule-v1.schema.json";
62
- const V4_ADOPTER_DELIVERY_SCHEMA =
62
+ const ADOPTER_DELIVERY_SCHEMA =
63
63
  "schemas/v4-adopter-delivery-v1.schema.json";
64
- const V4_ADOPTER_DELIVERY_SCHEMA_SOURCE =
64
+ const ADOPTER_DELIVERY_SCHEMA_SOURCE =
65
65
  "contracts/v4-adopter-delivery-v1.schema.json";
66
66
  const RELEASE_TAIL_CAPABILITIES_SCHEMA =
67
67
  "schemas/release-tail-capabilities-v1.schema.json";
68
68
  const RELEASE_TAIL_CAPABILITIES_SCHEMA_SOURCE =
69
69
  "contracts/release-tail-capabilities-v1.schema.json";
70
- const V4_PUBLICATION_QUALIFICATION_SCHEMA =
70
+ const PUBLICATION_QUALIFICATION_SCHEMA =
71
71
  "schemas/v4-publication-qualification-v1.schema.json";
72
- const V4_PUBLICATION_QUALIFICATION_SCHEMA_SOURCE =
72
+ const PUBLICATION_QUALIFICATION_SCHEMA_SOURCE =
73
73
  "contracts/v4-publication-qualification-v1.schema.json";
74
74
  const PUBLICATION_REHEARSAL_SITE_SCHEMAS = [
75
- V4_PUBLICATION_REHEARSAL_SCHEMA,
76
- V4_ADOPTER_DELIVERY_SCHEMA,
75
+ PUBLICATION_REHEARSAL_SCHEMA,
76
+ ADOPTER_DELIVERY_SCHEMA,
77
77
  RELEASE_TAIL_CAPABILITIES_SCHEMA,
78
- V4_PUBLICATION_QUALIFICATION_SCHEMA,
78
+ PUBLICATION_QUALIFICATION_SCHEMA,
79
79
  ];
80
80
  const root = path.resolve(import.meta.dirname, "..");
81
81
  const outputDir = path.join(root, "dist", "site");
@@ -106,10 +106,10 @@ function stableJson(value) {
106
106
 
107
107
  function siteFileBytes(name, value) {
108
108
  if (name === DEV_DELIVERY_AUTHORITY_SCHEMA) return readText(DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE);
109
- if (name === V4_COMPATIBILITY_FACTS_SCHEMA) return readText(V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE);
110
- if (name === V4_PUBLICATION_REHEARSAL_SCHEMA) return readText(V4_PUBLICATION_REHEARSAL_SCHEMA_SOURCE);
111
- if (name === V4_PUBLICATION_QUALIFICATION_SCHEMA) return readText(V4_PUBLICATION_QUALIFICATION_SCHEMA_SOURCE);
112
- if (name === V4_ADOPTER_DELIVERY_SCHEMA) return readText(V4_ADOPTER_DELIVERY_SCHEMA_SOURCE);
109
+ if (name === COMPATIBILITY_FACTS_SCHEMA) return readText(COMPATIBILITY_FACTS_SCHEMA_SOURCE);
110
+ if (name === PUBLICATION_REHEARSAL_SCHEMA) return readText(PUBLICATION_REHEARSAL_SCHEMA_SOURCE);
111
+ if (name === PUBLICATION_QUALIFICATION_SCHEMA) return readText(PUBLICATION_QUALIFICATION_SCHEMA_SOURCE);
112
+ if (name === ADOPTER_DELIVERY_SCHEMA) return readText(ADOPTER_DELIVERY_SCHEMA_SOURCE);
113
113
  if (name === RELEASE_TAIL_CAPABILITIES_SCHEMA) return readText(RELEASE_TAIL_CAPABILITIES_SCHEMA_SOURCE);
114
114
  return stableJson(value);
115
115
  }
@@ -1331,8 +1331,8 @@ function buildSiteBundle() {
1331
1331
  [DEV_DELIVERY_AUTHORITY_SCHEMA]: readJson(
1332
1332
  DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE,
1333
1333
  ),
1334
- [V4_COMPATIBILITY_FACTS_SCHEMA]: readJson(
1335
- V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE,
1334
+ [COMPATIBILITY_FACTS_SCHEMA]: readJson(
1335
+ COMPATIBILITY_FACTS_SCHEMA_SOURCE,
1336
1336
  ),
1337
1337
  ...Object.fromEntries(
1338
1338
  PUBLICATION_REHEARSAL_SITE_SCHEMAS.map((name) => [
@@ -1,14 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ import { rewriteImplementationReferences } from "./implementation-references.mjs";
2
3
  import fs from "node:fs";
3
4
  import crypto from "node:crypto";
4
- import { currentWorkflowPath, writeWorkflowSource, rewriteRepositoryWorkflowPaths } from "./workflow-taxonomy.mjs";
5
+ import {
6
+ currentWorkflowPath,
7
+ writeWorkflowSource,
8
+ rewriteRepositoryWorkflowPaths,
9
+ } from "./workflow-taxonomy.mjs";
5
10
  import path from "node:path";
6
11
  import { execFileSync } from "node:child_process";
7
12
  import { fileURLToPath } from "node:url";
8
13
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
9
14
  const contractPath = path.join(
10
15
  root,
11
- "architecture/v4-universal-workflow-bootstrap.json",
16
+ "architecture/universal-workflow-bootstrap.json",
12
17
  );
13
18
  const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
14
19
  const laneBudgetPath = path.join(
@@ -96,6 +101,7 @@ function frozenFacadeSource(relative) {
96
101
  const mutableFacades = new Set([
97
102
  ...(contract.migration.channelGeneratedFacades || []),
98
103
  ".github/workflows/dev-pr-auto-merge.yml",
104
+ ...(contract.migration.postMigrationWorkflows || []),
99
105
  ]);
100
106
 
101
107
  function isMutableFacade(relative) {
@@ -187,9 +193,7 @@ function guardCompatibilityJobs(source, relative) {
187
193
  function addRuntimeBootstrapDependencies(source, relative) {
188
194
  if (
189
195
  relative !== ".github/workflows/.build.yml" ||
190
- source.includes(
191
- ".buildchain/workflow-shell/scripts/github-output.mjs\n",
192
- )
196
+ source.includes(".buildchain/workflow-shell/scripts/github-output.mjs\n")
193
197
  )
194
198
  return source;
195
199
  const anchor =
@@ -201,26 +205,60 @@ function addRuntimeBootstrapDependencies(source, relative) {
201
205
  }
202
206
 
203
207
  function applyPublicationFacadePatches(source, relative) {
204
- const document = JSON.parse(fs.readFileSync(path.join(root,
205
- "architecture/v4-publication-facade-patches.json"), "utf8"));
206
- const patch = document.facades.find(entry => entry.workflow === relative);
208
+ const document = JSON.parse(
209
+ fs.readFileSync(
210
+ path.join(root, "architecture/publication-facade-patches.json"),
211
+ "utf8",
212
+ ),
213
+ );
214
+ const patch = document.facades.find((entry) => entry.workflow === relative);
207
215
  if (!patch) return source;
208
- const digest = value => crypto.createHash("sha256").update(value).digest("hex");
216
+ const digest = (value) =>
217
+ crypto.createHash("sha256").update(value).digest("hex");
209
218
  if (digest(source) === patch.afterSha256) return source;
210
- if (digest(source) !== patch.beforeSha256) fail(`${relative}: publication facade source drift`);
219
+ if (digest(source) !== patch.beforeSha256)
220
+ fail(`${relative}: publication facade source drift`);
211
221
  for (const { before, after } of patch.replacements) {
212
- if (source.split(before).length !== 2) fail(`${relative}: ambiguous publication patch`);
222
+ if (source.split(before).length !== 2)
223
+ fail(`${relative}: ambiguous publication patch`);
213
224
  source = source.replace(before, () => after);
214
225
  }
215
- if (digest(source) !== patch.afterSha256) fail(`${relative}: publication facade result drift`);
226
+ if (digest(source) !== patch.afterSha256)
227
+ fail(`${relative}: publication facade result drift`);
216
228
  return source;
217
229
  }
218
230
 
219
- export function migrateV4UniversalWorkflowFacade(source, relative) {
220
- return rewriteRepositoryWorkflowPaths(root, applyPublicationFacadePatches(guardCompatibilityJobs(
221
- addUniversalInput(addRuntimeBootstrapDependencies(source, relative), relative),
222
- relative,
223
- ), relative));
231
+ function inheritPublicationProviderAuthority(source, relative) {
232
+ if (relative !== ".github/workflows/.release-candidate-promote.yml")
233
+ return source;
234
+ return source
235
+ .replace(
236
+ "permissions:\n contents: read\n",
237
+ "# Provider authority is inherited from the explicit caller envelope.\n",
238
+ )
239
+ .replace(
240
+ " permissions:\n actions: read\n checks: write\n contents: write\n id-token: write\n pull-requests: write\n",
241
+ " # Provider authority is inherited from the explicit caller envelope.\n",
242
+ );
243
+ }
244
+
245
+ export function migrateUniversalWorkflowFacade(source, relative) {
246
+ return rewriteImplementationReferences(rewriteRepositoryWorkflowPaths(
247
+ root,
248
+ inheritPublicationProviderAuthority(
249
+ applyPublicationFacadePatches(
250
+ guardCompatibilityJobs(
251
+ addUniversalInput(
252
+ addRuntimeBootstrapDependencies(source, relative),
253
+ relative,
254
+ ),
255
+ relative,
256
+ ),
257
+ relative,
258
+ ),
259
+ relative,
260
+ ),
261
+ ));
224
262
  }
225
263
 
226
264
  function verify(source, relative) {
@@ -243,7 +281,7 @@ function verify(source, relative) {
243
281
  fail(`${relative}#${header[1]} can overlap universal execution`);
244
282
  }
245
283
  if (!isMutableFacade(relative)) {
246
- const expected = migrateV4UniversalWorkflowFacade(
284
+ const expected = migrateUniversalWorkflowFacade(
247
285
  frozenFacadeSource(relative),
248
286
  relative,
249
287
  );
@@ -421,7 +459,8 @@ function main() {
421
459
  );
422
460
  } else {
423
461
  writeWorkflowSource(
424
- root, path.relative(root, recoveryWorkflowPath),
462
+ root,
463
+ path.relative(root, recoveryWorkflowPath),
425
464
  fs.readFileSync(recoveryTemplatePath, "utf8"),
426
465
  );
427
466
  }
@@ -434,8 +473,9 @@ function main() {
434
473
  if (check) verify(source, relative);
435
474
  else
436
475
  writeWorkflowSource(
437
- root, current,
438
- migrateV4UniversalWorkflowFacade(source, relative),
476
+ root,
477
+ current,
478
+ migrateUniversalWorkflowFacade(source, relative),
439
479
  );
440
480
  }
441
481
  if (!check) {
@@ -3,7 +3,7 @@
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
- import { architectureList, architectureShow } from "./v4-architecture.mjs";
6
+ import { architectureList, architectureShow } from "./architecture.mjs";
7
7
 
8
8
  const MAX_REQUEST_BYTES = 8 * 1024 * 1024;
9
9
  const SUPPORTED_CAPABILITIES = Object.freeze([
@@ -0,0 +1,25 @@
1
+ import fs from "node:fs";
2
+
3
+ const policy = JSON.parse(
4
+ fs.readFileSync(
5
+ new URL("../architecture/implementation-naming.json", import.meta.url),
6
+ "utf8",
7
+ ),
8
+ );
9
+
10
+ // Project frozen workflow sources through the explicit implementation relocation.
11
+ // Historical source commits and published wire identities stay unchanged.
12
+ export function rewriteImplementationReferences(source) {
13
+ for (const [before, after] of Object.entries({
14
+ ...policy.pathMigrations,
15
+ ...Object.fromEntries(
16
+ Object.entries(policy.ephemeralPathMigrations).filter(([before]) =>
17
+ before.startsWith(".buildchain/"),
18
+ ),
19
+ ),
20
+ }).sort(([a], [b]) => b.length - a.length))
21
+ source = source.replaceAll(before, after);
22
+ for (const [before, after] of Object.entries(policy.symbolMigrations))
23
+ source = source.replace(new RegExp(`\\b${before}\\b`, "gu"), after);
24
+ return source;
25
+ }