@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
@@ -0,0 +1,72 @@
1
+ import { nextDevelopmentRoot } from "./next-development-transition.js";
2
+
3
+ const VERSION =
4
+ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-alpha\.(0|[1-9]\d*))?$/u;
5
+
6
+ export function developmentVersionParts(version) {
7
+ const parts = VERSION.exec(version || "");
8
+ if (!parts) throw new Error("expected a stable or alpha semantic version");
9
+ return parts
10
+ .slice(1)
11
+ .map((part) => (part === undefined ? null : BigInt(part)));
12
+ }
13
+
14
+ export function compareDevelopmentVersions(left, right) {
15
+ const a = developmentVersionParts(left),
16
+ b = developmentVersionParts(right);
17
+ for (let i = 0; i < 4; i += 1) {
18
+ if (a[i] === b[i]) continue;
19
+ if (a[i] === null) return 1;
20
+ if (b[i] === null) return -1;
21
+ return a[i] < b[i] ? -1 : 1;
22
+ }
23
+ return 0;
24
+ }
25
+
26
+ export function nextPatchDevelopmentVersion(stableVersion) {
27
+ const [major, minor, patch, alpha] = developmentVersionParts(stableVersion);
28
+ if (alpha !== null)
29
+ throw new Error("completed stable version must not be a prerelease");
30
+ return `${major}.${minor}.${patch + 1n}-alpha.0`;
31
+ }
32
+
33
+ export function createStableDevelopmentTransition({
34
+ repository,
35
+ completedStable,
36
+ model,
37
+ sourcePaths,
38
+ derivedPaths,
39
+ }) {
40
+ const value = completedStable || {};
41
+ const version = nextPatchDevelopmentVersion(value.version);
42
+ if (
43
+ !/^[^/\s]+\/[^/\s]+$/u.test(repository || "") ||
44
+ value.outcome !== "succeeded" ||
45
+ value.exactTag !== `v${value.version}` ||
46
+ ![value.releaseSha, value.treeSha].every((sha) =>
47
+ /^[a-f0-9]{40}$/u.test(sha || ""),
48
+ ) ||
49
+ !/^sha256:[a-f0-9]{64}$/u.test(value.publicationRoot || "") ||
50
+ !Number.isFinite(Date.parse(value.completedAt))
51
+ )
52
+ throw new Error(
53
+ "stable development requires an exact completed publication",
54
+ );
55
+ if (model.strategy !== "semver" || model.next !== "auto")
56
+ throw new Error("automatic next-patch development requires semver/auto");
57
+ const identity = {
58
+ contract: "buildchain.stable-development-transition/v1",
59
+ repository,
60
+ completedStable: value,
61
+ model,
62
+ sourcePaths,
63
+ derivedPaths,
64
+ };
65
+ return {
66
+ ...identity,
67
+ idempotencyKey: nextDevelopmentRoot(identity),
68
+ target: { version },
69
+ state: { status: "planned" },
70
+ publicationOutcome: "preserved-success",
71
+ };
72
+ }
@@ -1,6 +1,6 @@
1
1
  import crypto from "node:crypto";
2
2
 
3
- export const V4_PUBLICATION_QUALIFICATION_SCHEMA =
3
+ export const PUBLICATION_QUALIFICATION_SCHEMA =
4
4
  "kungfu.buildchain.v4-publication-qualification/v1";
5
5
 
6
6
  const ROOT = /^sha256:[0-9a-f]{64}$/u;
@@ -16,16 +16,16 @@ const FORBIDDEN_EXECUTION_KEYS = new Set([
16
16
  "shell",
17
17
  ]);
18
18
 
19
- export class V4PublicationQualificationError extends Error {
19
+ export class PublicationQualificationError extends Error {
20
20
  constructor(code, message) {
21
21
  super(message);
22
- this.name = "V4PublicationQualificationError";
22
+ this.name = "PublicationQualificationError";
23
23
  this.code = code;
24
24
  }
25
25
  }
26
26
 
27
27
  function fail(code, message) {
28
- throw new V4PublicationQualificationError(code, message);
28
+ throw new PublicationQualificationError(code, message);
29
29
  }
30
30
 
31
31
  function canonical(value) {
@@ -39,14 +39,14 @@ function canonical(value) {
39
39
  return JSON.stringify(value);
40
40
  }
41
41
 
42
- export function v4PublicationQualificationRoot(value) {
42
+ export function domainPublicationQualificationRoot(value) {
43
43
  return `sha256:${crypto.createHash("sha256").update(canonical(value)).digest("hex")}`;
44
44
  }
45
45
 
46
- export function assertNoV4ExecutionFields(value, location = "$") {
46
+ export function assertNoExecutionFields(value, location = "$") {
47
47
  if (Array.isArray(value)) {
48
48
  value.forEach((entry, index) =>
49
- assertNoV4ExecutionFields(entry, `${location}[${index}]`),
49
+ assertNoExecutionFields(entry, `${location}[${index}]`),
50
50
  );
51
51
  return;
52
52
  }
@@ -58,7 +58,7 @@ export function assertNoV4ExecutionFields(value, location = "$") {
58
58
  `v4 declarative publication forbids ${location}.${key}`,
59
59
  );
60
60
  }
61
- assertNoV4ExecutionFields(entry, `${location}.${key}`);
61
+ assertNoExecutionFields(entry, `${location}.${key}`);
62
62
  }
63
63
  }
64
64
 
@@ -109,7 +109,7 @@ function normalizedArtifacts(artifacts) {
109
109
  return normalized;
110
110
  }
111
111
 
112
- export function createV4PublicationQualificationReceipt({
112
+ export function createDomainPublicationQualificationReceipt({
113
113
  repository,
114
114
  candidateRoot,
115
115
  sourceSha,
@@ -120,7 +120,7 @@ export function createV4PublicationQualificationReceipt({
120
120
  expiresAt,
121
121
  }) {
122
122
  const body = {
123
- schema: V4_PUBLICATION_QUALIFICATION_SCHEMA,
123
+ schema: PUBLICATION_QUALIFICATION_SCHEMA,
124
124
  repository: String(repository || ""),
125
125
  candidateRoot: exactRoot(candidateRoot, "candidateRoot"),
126
126
  sourceSha: exactSha(sourceSha, "sourceSha"),
@@ -140,16 +140,16 @@ export function createV4PublicationQualificationReceipt({
140
140
  expires <= issued
141
141
  )
142
142
  fail("schema-invalid", "qualification freshness interval is invalid");
143
- assertNoV4ExecutionFields(body);
144
- const artifactRoot = v4PublicationQualificationRoot(body.artifacts);
143
+ assertNoExecutionFields(body);
144
+ const artifactRoot = domainPublicationQualificationRoot(body.artifacts);
145
145
  const receipt = { ...body, artifactRoot };
146
146
  return {
147
147
  ...receipt,
148
- receiptRoot: v4PublicationQualificationRoot(receipt),
148
+ receiptRoot: domainPublicationQualificationRoot(receipt),
149
149
  };
150
150
  }
151
151
 
152
- export function validateV4PublicationQualificationReceipt(
152
+ export function validatePublicationQualificationReceipt(
153
153
  receipt,
154
154
  {
155
155
  repository,
@@ -163,8 +163,8 @@ export function validateV4PublicationQualificationReceipt(
163
163
  ) {
164
164
  if (!receipt)
165
165
  fail("qualification-missing", "qualification receipt is required");
166
- assertNoV4ExecutionFields(receipt);
167
- const recreated = createV4PublicationQualificationReceipt(receipt);
166
+ assertNoExecutionFields(receipt);
167
+ const recreated = createDomainPublicationQualificationReceipt(receipt);
168
168
  if (
169
169
  receipt.artifactRoot !== recreated.artifactRoot ||
170
170
  receipt.receiptRoot !== recreated.receiptRoot
@@ -204,7 +204,7 @@ export function validateV4PublicationQualificationReceipt(
204
204
  });
205
205
  }
206
206
 
207
- export function assertV4DeclarativePromotionInputs(inputs) {
207
+ export function assertDeclarativePromotionInputs(inputs) {
208
208
  const forbidden = Object.entries(inputs || {}).filter(
209
209
  ([name, value]) =>
210
210
  name !== "dry-run" &&
@@ -7,7 +7,7 @@ import {
7
7
  validateReleaseTailTransaction,
8
8
  } from "./release-tail-provider-plane.js";
9
9
  import {
10
- V4PublicationRehearsalFault,
10
+ PublicationRehearsalFault,
11
11
  publicationRehearsalByteSorted as byteSorted,
12
12
  publicationRehearsalExactKeys as exactKeys,
13
13
  publicationRehearsalFault as fault,
@@ -15,26 +15,26 @@ import {
15
15
  publicationRehearsalRoot as root,
16
16
  publicationRehearsalText as text,
17
17
  publicationRehearsalToken as token,
18
- validateV4PublicationRehearsalProviderBindings,
19
- } from "./v4-publication-rehearsal-provider-bindings.js";
18
+ validatePublicationRehearsalProviderBindings,
19
+ } from "./publication-rehearsal-provider-bindings.js";
20
20
 
21
21
  export {
22
- V4PublicationRehearsalFault,
22
+ PublicationRehearsalFault,
23
23
  exactKeys as assertPublicationRehearsalExactKeys,
24
24
  fault as publicationRehearsalFault,
25
25
  root as publicationRehearsalRoot,
26
- validateV4PublicationRehearsalProviderBindings,
26
+ validatePublicationRehearsalProviderBindings,
27
27
  };
28
28
 
29
- export const V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT =
29
+ export const DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT =
30
30
  "buildchain-v4-publication-rehearsal-capsule/v1";
31
- export const V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT =
31
+ export const DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT =
32
32
  "buildchain-v4-publication-rehearsal-evidence/v1";
33
- export const V4_PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT =
33
+ export const PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT =
34
34
  "buildchain-v4-publication-rehearsal-authority/v1";
35
- export const V4_PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT =
35
+ export const PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT =
36
36
  "buildchain-v4-publication-rehearsal-provider-policy/v1";
37
- export const V4_PUBLICATION_REHEARSAL_CORE_VERSION =
37
+ export const PUBLICATION_REHEARSAL_CORE_VERSION =
38
38
  RELEASE_TAIL_TRANSACTION_POLICY;
39
39
 
40
40
  const ROOT = /^sha256:[0-9a-f]{64}$/u;
@@ -138,7 +138,7 @@ function normalizeCandidateInputs(value) {
138
138
  `$/${name}`,
139
139
  `${name} is not bound by the candidate inventory`,
140
140
  );
141
- const providerBindings = validateV4PublicationRehearsalProviderBindings(
141
+ const providerBindings = validatePublicationRehearsalProviderBindings(
142
142
  value.providerBindings,
143
143
  );
144
144
  root(value.providerBindingsRoot, "$/providerBindingsRoot");
@@ -177,7 +177,7 @@ function normalizeProviderPolicy(value, declaration) {
177
177
  "$/providerPolicy",
178
178
  );
179
179
  if (
180
- value.schema !== V4_PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT ||
180
+ value.schema !== PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT ||
181
181
  value.effectDefault !== "disabled"
182
182
  )
183
183
  fault(
@@ -295,10 +295,10 @@ function normalizeObservation(value, index, operationIds) {
295
295
  return structuredClone(value);
296
296
  }
297
297
 
298
- export function createV4PublicationRehearsalProviderPolicy(declarationInput) {
298
+ export function createPublicationRehearsalProviderPolicy(declarationInput) {
299
299
  const declaration = parseReleaseTailDeclaration(declarationInput);
300
300
  const body = {
301
- schema: V4_PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
301
+ schema: PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
302
302
  effectDefault: "disabled",
303
303
  allowedCapabilityIds: declaration.capabilities
304
304
  .map(({ id }) => id)
@@ -310,7 +310,7 @@ export function createV4PublicationRehearsalProviderPolicy(declarationInput) {
310
310
  return { ...body, root: releaseTailRoot(body) };
311
311
  }
312
312
 
313
- export function createV4PublicationRehearsalCapsule(input) {
313
+ export function createDomainPublicationRehearsalCapsule(input) {
314
314
  const declaration = parseReleaseTailDeclaration(input.declaration);
315
315
  const transaction =
316
316
  input.transaction || createReleaseTailTransaction(declaration);
@@ -323,14 +323,14 @@ export function createV4PublicationRehearsalCapsule(input) {
323
323
  };
324
324
  const policy =
325
325
  input.providerPolicy ||
326
- createV4PublicationRehearsalProviderPolicy(declaration);
326
+ createPublicationRehearsalProviderPolicy(declaration);
327
327
  const observations = structuredClone(input.expectedObservations || []);
328
- const providerBindings = validateV4PublicationRehearsalProviderBindings(
328
+ const providerBindings = validatePublicationRehearsalProviderBindings(
329
329
  input.providerBindings,
330
330
  );
331
331
  const body = {
332
- schema: V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
333
- coreVersion: V4_PUBLICATION_REHEARSAL_CORE_VERSION,
332
+ schema: DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
333
+ coreVersion: PUBLICATION_REHEARSAL_CORE_VERSION,
334
334
  source: { ...source, root: sourceRoot(source) },
335
335
  candidate: { root: candidateRoot(files) },
336
336
  manifest: structuredClone(input.manifest),
@@ -346,13 +346,13 @@ export function createV4PublicationRehearsalCapsule(input) {
346
346
  transaction: structuredClone(transaction),
347
347
  files,
348
348
  };
349
- return validateV4PublicationRehearsalCapsule({
349
+ return validatePublicationRehearsalCapsule({
350
350
  ...body,
351
351
  capsuleRoot: releaseTailRoot(body),
352
352
  });
353
353
  }
354
354
 
355
- export function validateV4PublicationRehearsalCapsule(value) {
355
+ export function validatePublicationRehearsalCapsule(value) {
356
356
  exactKeys(
357
357
  value,
358
358
  [
@@ -374,8 +374,8 @@ export function validateV4PublicationRehearsalCapsule(value) {
374
374
  "$",
375
375
  );
376
376
  if (
377
- value.schema !== V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT ||
378
- value.coreVersion !== V4_PUBLICATION_REHEARSAL_CORE_VERSION
377
+ value.schema !== DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT ||
378
+ value.coreVersion !== PUBLICATION_REHEARSAL_CORE_VERSION
379
379
  )
380
380
  fault(
381
381
  "unsupported-publication-rehearsal-core-version",
@@ -6,9 +6,9 @@ import {
6
6
  } from "./publication-rehearsal-runtime.js";
7
7
 
8
8
  export const PUBLICATION_REHEARSAL_AGENT_SECTION_START =
9
- "<!-- buildchain:publication-rehearsal:v4:start -->";
9
+ "<!-- buildchain:publication-rehearsal:start -->";
10
10
  export const PUBLICATION_REHEARSAL_AGENT_SECTION_END =
11
- "<!-- buildchain:publication-rehearsal:v4:end -->";
11
+ "<!-- buildchain:publication-rehearsal:end -->";
12
12
  export const PUBLICATION_REHEARSAL_WORKFLOW_PATH =
13
13
  ".github/workflows/publication-rehearsal.yml";
14
14
 
@@ -1,14 +1,14 @@
1
- export class V4PublicationRehearsalFault extends Error {
1
+ export class PublicationRehearsalFault extends Error {
2
2
  constructor(code, location, message) {
3
3
  super(`${location}: ${message}`);
4
- this.name = "V4PublicationRehearsalFault";
4
+ this.name = "PublicationRehearsalFault";
5
5
  this.code = code;
6
6
  this.location = location;
7
7
  }
8
8
  }
9
9
 
10
10
  export function publicationRehearsalFault(code, location, message) {
11
- throw new V4PublicationRehearsalFault(code, location, message);
11
+ throw new PublicationRehearsalFault(code, location, message);
12
12
  }
13
13
 
14
14
  export function publicationRehearsalExactKeys(value, expected, location) {
@@ -130,7 +130,7 @@ function canonicalObject(value, location, normalize) {
130
130
  );
131
131
  }
132
132
 
133
- export function validateV4PublicationRehearsalProviderBindings(value) {
133
+ export function validatePublicationRehearsalProviderBindings(value) {
134
134
  publicationRehearsalExactKeys(
135
135
  value,
136
136
  ["schema", "artifacts", "documents", "evidence"],
@@ -3,18 +3,18 @@ import path from "node:path";
3
3
 
4
4
  import { releaseTailRoot } from "./release-tail-provider-plane.js";
5
5
  import {
6
- V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
7
- V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
8
- createV4PublicationRehearsalCapsule,
9
- executeV4PublicationRehearsal,
10
- validateV4PublicationRehearsalCapsule,
11
- verifyV4PublicationRehearsalCapsule,
12
- } from "./v4-publication-rehearsal.js";
6
+ DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
7
+ DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
8
+ createDomainPublicationRehearsalCapsule,
9
+ executeDomainPublicationRehearsal,
10
+ validatePublicationRehearsalCapsule,
11
+ verifyDomainPublicationRehearsalCapsule,
12
+ } from "./publication-rehearsal.js";
13
13
 
14
14
  export const PUBLICATION_REHEARSAL_CAPSULE_CONTRACT =
15
- V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT;
15
+ DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT;
16
16
  export const PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT =
17
- V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT;
17
+ DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT;
18
18
  export const PUBLICATION_REHEARSAL_DIAGNOSTIC_CONTRACT =
19
19
  "buildchain-v4-publication-rehearsal-compatibility-diagnostic/v1";
20
20
  export const RELEASE_LOCAL_CONSTRUCTIBILITY_ADR =
@@ -24,7 +24,7 @@ export const RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT =
24
24
  export const PUBLICATION_REHEARSAL_COMMAND =
25
25
  'buildchain release-tail rehearse --capsule "$PWD/.buildchain/publication-rehearsal/capsule.json" --candidate-root "$PWD/.buildchain/publication-rehearsal/candidate" --mode simulate --state "$PWD/.buildchain/publication-rehearsal/state.json" --evidence "$PWD/.buildchain/publication-rehearsal/evidence.json"';
26
26
 
27
- const REQUIRED_V4_INPUTS = Object.freeze([
27
+ const REQUIRED_INPUTS = Object.freeze([
28
28
  "source.repository",
29
29
  "source.revision",
30
30
  "manifest.path",
@@ -41,8 +41,8 @@ function migrationReceipt(surface, reasonCode) {
41
41
  reasonCode,
42
42
  replacement: {
43
43
  module: "@kungfu-tech/buildchain/v4-publication-rehearsal",
44
- capsuleContract: V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
45
- requiredInputs: REQUIRED_V4_INPUTS,
44
+ capsuleContract: DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
45
+ requiredInputs: REQUIRED_INPUTS,
46
46
  },
47
47
  productionAuthority: false,
48
48
  };
@@ -68,7 +68,7 @@ export class PublicationRehearsalError extends Error {
68
68
  }
69
69
  }
70
70
 
71
- function hasV4CreationBindings(input) {
71
+ function hasCreationBindings(input) {
72
72
  return Boolean(
73
73
  input?.source?.repository &&
74
74
  input?.source?.revision &&
@@ -79,8 +79,8 @@ function hasV4CreationBindings(input) {
79
79
  );
80
80
  }
81
81
 
82
- function requireV4CreationBindings(input, surface) {
83
- if (hasV4CreationBindings(input)) return;
82
+ function requireCreationBindings(input, surface) {
83
+ if (hasCreationBindings(input)) return;
84
84
  const migration = migrationReceipt(surface, "v4-source-binding-required");
85
85
  throw new PublicationRehearsalError(
86
86
  "v3 rehearsal capsules cannot be upgraded implicitly; provide the v4 source, manifest, and config bindings",
@@ -89,15 +89,15 @@ function requireV4CreationBindings(input, surface) {
89
89
  }
90
90
 
91
91
  export function createPublicationRehearsalCapsule(input = {}) {
92
- requireV4CreationBindings(
92
+ requireCreationBindings(
93
93
  input,
94
94
  "@kungfu-tech/buildchain/publication-rehearsal-runtime#createPublicationRehearsalCapsule",
95
95
  );
96
- return createV4PublicationRehearsalCapsule(input);
96
+ return createDomainPublicationRehearsalCapsule(input);
97
97
  }
98
98
 
99
99
  export function normalizePublicationRehearsalCapsule(input) {
100
- return validateV4PublicationRehearsalCapsule(input);
100
+ return validatePublicationRehearsalCapsule(input);
101
101
  }
102
102
 
103
103
  export function verifyPublicationRehearsalCapsule({
@@ -105,11 +105,11 @@ export function verifyPublicationRehearsalCapsule({
105
105
  capsuleRoot,
106
106
  candidateRoot = capsuleRoot,
107
107
  } = {}) {
108
- return verifyV4PublicationRehearsalCapsule({ capsule, candidateRoot });
108
+ return verifyDomainPublicationRehearsalCapsule({ capsule, candidateRoot });
109
109
  }
110
110
 
111
111
  export function publicationRehearsalBindingRoot(capsule) {
112
- return validateV4PublicationRehearsalCapsule(capsule).capsuleRoot;
112
+ return validatePublicationRehearsalCapsule(capsule).capsuleRoot;
113
113
  }
114
114
 
115
115
  export function publicationRehearsalDiagnostic(error, { capsule } = {}) {
@@ -156,7 +156,7 @@ export async function executePublicationRehearsal({
156
156
  { code: "undeclared-environment", classification: "input", migration },
157
157
  );
158
158
  }
159
- return executeV4PublicationRehearsal({
159
+ return executeDomainPublicationRehearsal({
160
160
  capsule,
161
161
  candidateRoot,
162
162
  mode,
@@ -8,32 +8,32 @@ import {
8
8
  validateReleaseTailTransaction,
9
9
  } from "./release-tail-provider-plane.js";
10
10
  import {
11
- V4_PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
12
- V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
13
- V4_PUBLICATION_REHEARSAL_CORE_VERSION,
14
- V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
15
- V4_PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
16
- V4PublicationRehearsalFault,
11
+ PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
12
+ DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
13
+ PUBLICATION_REHEARSAL_CORE_VERSION,
14
+ DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
15
+ PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
16
+ PublicationRehearsalFault,
17
17
  assertPublicationRehearsalExactKeys as exactKeys,
18
- createV4PublicationRehearsalCapsule,
19
- createV4PublicationRehearsalProviderPolicy,
18
+ createDomainPublicationRehearsalCapsule,
19
+ createPublicationRehearsalProviderPolicy,
20
20
  publicationRehearsalFault as fault,
21
21
  publicationRehearsalRoot,
22
- validateV4PublicationRehearsalCapsule,
23
- validateV4PublicationRehearsalProviderBindings,
24
- } from "./v4-publication-rehearsal-capsule.js";
22
+ validatePublicationRehearsalCapsule,
23
+ validatePublicationRehearsalProviderBindings,
24
+ } from "./publication-rehearsal-capsule.js";
25
25
 
26
26
  export {
27
- V4_PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
28
- V4_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
29
- V4_PUBLICATION_REHEARSAL_CORE_VERSION,
30
- V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
31
- V4_PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
32
- V4PublicationRehearsalFault,
33
- createV4PublicationRehearsalCapsule,
34
- createV4PublicationRehearsalProviderPolicy,
35
- validateV4PublicationRehearsalCapsule,
36
- validateV4PublicationRehearsalProviderBindings,
27
+ PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
28
+ DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
29
+ PUBLICATION_REHEARSAL_CORE_VERSION,
30
+ DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
31
+ PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
32
+ PublicationRehearsalFault,
33
+ createDomainPublicationRehearsalCapsule,
34
+ createPublicationRehearsalProviderPolicy,
35
+ validatePublicationRehearsalCapsule,
36
+ validatePublicationRehearsalProviderBindings,
37
37
  };
38
38
 
39
39
  const ROOT = /^sha256:[0-9a-f]{64}$/u;
@@ -118,11 +118,11 @@ function resolveCandidateOutput(candidateRootPath, relative, location) {
118
118
  return resolved;
119
119
  }
120
120
 
121
- export function verifyV4PublicationRehearsalCapsule({
121
+ export function verifyDomainPublicationRehearsalCapsule({
122
122
  capsule,
123
123
  candidateRoot: candidateRootPath,
124
124
  }) {
125
- const normalized = validateV4PublicationRehearsalCapsule(capsule);
125
+ const normalized = validatePublicationRehearsalCapsule(capsule);
126
126
  if (!path.isAbsolute(candidateRootPath || ""))
127
127
  fault(
128
128
  "publication-rehearsal-implicit-root-forbidden",
@@ -157,17 +157,17 @@ export function verifyV4PublicationRehearsalCapsule({
157
157
  return normalized;
158
158
  }
159
159
 
160
- export function resolveV4PublicationRehearsalProviderBindings({
160
+ export function resolvePublicationRehearsalProviderBindings({
161
161
  capsule,
162
162
  candidateRoot: candidateRootPath,
163
163
  providerBindings = capsule?.providerBindings,
164
164
  }) {
165
- const normalized = verifyV4PublicationRehearsalCapsule({
165
+ const normalized = verifyDomainPublicationRehearsalCapsule({
166
166
  capsule,
167
167
  candidateRoot: candidateRootPath,
168
168
  });
169
169
  const supplied =
170
- validateV4PublicationRehearsalProviderBindings(providerBindings);
170
+ validatePublicationRehearsalProviderBindings(providerBindings);
171
171
  if (
172
172
  releaseTailRoot(supplied) !== normalized.providerBindingsRoot ||
173
173
  JSON.stringify(supplied) !== JSON.stringify(normalized.providerBindings)
@@ -347,13 +347,13 @@ function observationAdapters(capsule, transcript, adapters, mode) {
347
347
  );
348
348
  }
349
349
 
350
- export function createV4PublicationRehearsalAuthority(
350
+ export function createPublicationRehearsalAuthority(
351
351
  capsule,
352
352
  { authorizationRoot } = {},
353
353
  ) {
354
- const normalized = validateV4PublicationRehearsalCapsule(capsule);
354
+ const normalized = validatePublicationRehearsalCapsule(capsule);
355
355
  const body = {
356
- schema: V4_PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
356
+ schema: PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
357
357
  mode: "provider-rehearsal",
358
358
  capsuleRoot: normalized.capsuleRoot,
359
359
  providerPolicyRoot: normalized.providerPolicy.root,
@@ -385,7 +385,7 @@ function validateAuthority(value, capsule) {
385
385
  const body = { ...value };
386
386
  delete body.authorityRoot;
387
387
  if (
388
- value.schema !== V4_PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT ||
388
+ value.schema !== PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT ||
389
389
  value.mode !== "provider-rehearsal" ||
390
390
  value.productionAuthority !== false ||
391
391
  value.capsuleRoot !== capsule.capsuleRoot ||
@@ -402,7 +402,7 @@ function validateAuthority(value, capsule) {
402
402
  return structuredClone(value);
403
403
  }
404
404
 
405
- export async function executeV4PublicationRehearsal({
405
+ export async function executeDomainPublicationRehearsal({
406
406
  capsule,
407
407
  candidateRoot: candidateRootPath,
408
408
  mode = "simulate",
@@ -417,7 +417,7 @@ export async function executeV4PublicationRehearsal({
417
417
  "$/mode",
418
418
  "simulate, replay, or provider required",
419
419
  );
420
- const normalized = verifyV4PublicationRehearsalCapsule({
420
+ const normalized = verifyDomainPublicationRehearsalCapsule({
421
421
  capsule,
422
422
  candidateRoot: candidateRootPath,
423
423
  });
@@ -448,7 +448,7 @@ export async function executeV4PublicationRehearsal({
448
448
  checkpoint,
449
449
  });
450
450
  const body = {
451
- schema: V4_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
451
+ schema: DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
452
452
  mode,
453
453
  truth:
454
454
  mode === "provider"