@kungfu-tech/buildchain 4.0.2 → 4.0.3

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
@@ -1,20 +1,20 @@
1
1
  import crypto from "node:crypto";
2
2
 
3
3
  import {
4
- V4ContractFault,
5
- v4ContentRoot,
6
- validateV4Clock,
7
- validateV4Root,
8
- } from "./v4-canonical-contracts.js";
9
- import { validateV4StageCapsule } from "./v4-stage-capsule.js";
4
+ ContractFault,
5
+ domainContentRoot,
6
+ validateClock,
7
+ validateRoot,
8
+ } from "./canonical-contracts.js";
9
+ import { validateStageCapsule } from "./stage-capsule.js";
10
10
 
11
- export const V4_STAGE_CAPSULE_OUTPUT_MANIFEST_CONTRACT =
11
+ export const STAGE_CAPSULE_OUTPUT_MANIFEST_CONTRACT =
12
12
  "buildchain-v4-stage-capsule-output-manifest/v1";
13
- export const V4_STAGE_CAPSULE_RETENTION_STATE_CONTRACT =
13
+ export const STAGE_CAPSULE_RETENTION_STATE_CONTRACT =
14
14
  "buildchain-v4-stage-capsule-retention-state/v1";
15
- export const V4_STAGE_CAPSULE_TRANSPORT_CONTRACT =
15
+ export const STAGE_CAPSULE_TRANSPORT_CONTRACT =
16
16
  "buildchain-v4-stage-capsule-transport/v1";
17
- export const V4_STAGE_CAPSULE_STORE_RECEIPT_CONTRACT =
17
+ export const STAGE_CAPSULE_STORE_RECEIPT_CONTRACT =
18
18
  "buildchain-v4-stage-capsule-store-receipt/v1";
19
19
 
20
20
  const TOKEN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
@@ -38,7 +38,7 @@ const OUTCOMES = new Set([
38
38
  ]);
39
39
 
40
40
  function fault(code, path, message) {
41
- throw new V4ContractFault(code, path, message);
41
+ throw new ContractFault(code, path, message);
42
42
  }
43
43
 
44
44
  function exactKeys(value, keys, path) {
@@ -71,7 +71,7 @@ function token(value, path) {
71
71
  return value;
72
72
  }
73
73
 
74
- export function v4StageCapsuleBlobRoot(bytes) {
74
+ export function stageCapsuleBlobRoot(bytes) {
75
75
  const value = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
76
76
  return `sha256:${crypto.createHash("sha256").update(value).digest("hex")}`;
77
77
  }
@@ -80,17 +80,20 @@ function manifestPayload(value) {
80
80
  return { schema: value.schema, entries: value.entries };
81
81
  }
82
82
 
83
- export function v4StageCapsuleOutputManifestRoot(value) {
84
- validateV4StageCapsuleOutputManifest(value, { verifyRoot: false });
85
- return v4ContentRoot("stage-capsule-output-manifest", manifestPayload(value));
83
+ export function stageCapsuleOutputManifestRoot(value) {
84
+ validateStageCapsuleOutputManifest(value, { verifyRoot: false });
85
+ return domainContentRoot(
86
+ "stage-capsule-output-manifest",
87
+ manifestPayload(value),
88
+ );
86
89
  }
87
90
 
88
- export function validateV4StageCapsuleOutputManifest(
91
+ export function validateStageCapsuleOutputManifest(
89
92
  value,
90
93
  { verifyRoot = true } = {},
91
94
  ) {
92
95
  exactKeys(value, ["schema", "entries", "manifestRoot"], "$/manifest");
93
- if (value.schema !== V4_STAGE_CAPSULE_OUTPUT_MANIFEST_CONTRACT)
96
+ if (value.schema !== STAGE_CAPSULE_OUTPUT_MANIFEST_CONTRACT)
94
97
  fault(
95
98
  "unsupported-stage-capsule-store-version",
96
99
  "$/manifest/schema",
@@ -107,7 +110,7 @@ export function validateV4StageCapsuleOutputManifest(
107
110
  const entryPath = `$/manifest/entries/${index}`;
108
111
  exactKeys(entry, ["name", "root", "size"], entryPath);
109
112
  token(entry.name, `${entryPath}/name`);
110
- validateV4Root(entry.root, `${entryPath}/root`);
113
+ validateRoot(entry.root, `${entryPath}/root`);
111
114
  if (!Number.isSafeInteger(entry.size) || entry.size < 0)
112
115
  fault(
113
116
  "invalid-stage-capsule-content-size",
@@ -122,11 +125,11 @@ export function validateV4StageCapsuleOutputManifest(
122
125
  );
123
126
  prior = entry.name;
124
127
  }
125
- validateV4Root(value.manifestRoot, "$/manifest/manifestRoot");
128
+ validateRoot(value.manifestRoot, "$/manifest/manifestRoot");
126
129
  if (
127
130
  verifyRoot &&
128
131
  value.manifestRoot !==
129
- v4ContentRoot("stage-capsule-output-manifest", manifestPayload(value))
132
+ domainContentRoot("stage-capsule-output-manifest", manifestPayload(value))
130
133
  )
131
134
  fault(
132
135
  "stage-capsule-manifest-root-mismatch",
@@ -136,20 +139,20 @@ export function validateV4StageCapsuleOutputManifest(
136
139
  return value;
137
140
  }
138
141
 
139
- export function v4StageCapsuleRetentionPromiseRoot(promise) {
142
+ export function stageCapsuleRetentionPromiseRoot(promise) {
140
143
  exactKeys(promise, ["class", "retainUntil"], "$/retentionPromise");
141
144
  token(promise.class, "$/retentionPromise/class");
142
- validateV4Clock(promise.retainUntil, "$/retentionPromise/retainUntil");
143
- return v4ContentRoot("stage-capsule-retention-promise", promise);
145
+ validateClock(promise.retainUntil, "$/retentionPromise/retainUntil");
146
+ return domainContentRoot("stage-capsule-retention-promise", promise);
144
147
  }
145
148
 
146
- export function createV4StageCapsuleRetentionState({ capsule, evaluatedAt }) {
147
- validateV4StageCapsule(capsule);
148
- validateV4Clock(evaluatedAt, "$/evaluatedAt");
149
+ export function createStageCapsuleRetentionState({ capsule, evaluatedAt }) {
150
+ validateStageCapsule(capsule);
151
+ validateClock(evaluatedAt, "$/evaluatedAt");
149
152
  const value = {
150
- schema: V4_STAGE_CAPSULE_RETENTION_STATE_CONTRACT,
153
+ schema: STAGE_CAPSULE_RETENTION_STATE_CONTRACT,
151
154
  capsuleRoot: capsule.capsuleRoot,
152
- promiseRoot: v4StageCapsuleRetentionPromiseRoot(capsule.retentionPromise),
155
+ promiseRoot: stageCapsuleRetentionPromiseRoot(capsule.retentionPromise),
153
156
  evaluatedAt,
154
157
  status:
155
158
  evaluatedAt <= capsule.retentionPromise.retainUntil
@@ -158,11 +161,11 @@ export function createV4StageCapsuleRetentionState({ capsule, evaluatedAt }) {
158
161
  };
159
162
  return {
160
163
  ...value,
161
- stateRoot: v4ContentRoot("stage-capsule-retention-state", value),
164
+ stateRoot: domainContentRoot("stage-capsule-retention-state", value),
162
165
  };
163
166
  }
164
167
 
165
- export function validateV4StageCapsuleRetentionState(value) {
168
+ export function validateStageCapsuleRetentionState(value) {
166
169
  exactKeys(
167
170
  value,
168
171
  [
@@ -175,24 +178,24 @@ export function validateV4StageCapsuleRetentionState(value) {
175
178
  ],
176
179
  "$/retentionState",
177
180
  );
178
- if (value.schema !== V4_STAGE_CAPSULE_RETENTION_STATE_CONTRACT)
181
+ if (value.schema !== STAGE_CAPSULE_RETENTION_STATE_CONTRACT)
179
182
  fault(
180
183
  "unsupported-stage-capsule-store-version",
181
184
  "$/retentionState/schema",
182
185
  "unsupported retention-state schema",
183
186
  );
184
- validateV4Root(value.capsuleRoot, "$/retentionState/capsuleRoot");
185
- validateV4Root(value.promiseRoot, "$/retentionState/promiseRoot");
186
- validateV4Clock(value.evaluatedAt, "$/retentionState/evaluatedAt");
187
+ validateRoot(value.capsuleRoot, "$/retentionState/capsuleRoot");
188
+ validateRoot(value.promiseRoot, "$/retentionState/promiseRoot");
189
+ validateClock(value.evaluatedAt, "$/retentionState/evaluatedAt");
187
190
  if (!new Set(["retained", "expired"]).has(value.status))
188
191
  fault(
189
192
  "invalid-stage-capsule-retention-state",
190
193
  "$/retentionState/status",
191
194
  "retention status must be retained or expired",
192
195
  );
193
- validateV4Root(value.stateRoot, "$/retentionState/stateRoot");
196
+ validateRoot(value.stateRoot, "$/retentionState/stateRoot");
194
197
  const { stateRoot, ...body } = value;
195
- if (stateRoot !== v4ContentRoot("stage-capsule-retention-state", body))
198
+ if (stateRoot !== domainContentRoot("stage-capsule-retention-state", body))
196
199
  fault(
197
200
  "stage-capsule-retention-root-mismatch",
198
201
  "$/retentionState/stateRoot",
@@ -201,7 +204,7 @@ export function validateV4StageCapsuleRetentionState(value) {
201
204
  return value;
202
205
  }
203
206
 
204
- export function createV4StageCapsuleTransport({
207
+ export function createStageCapsuleTransport({
205
208
  provider,
206
209
  mode,
207
210
  locatorRoot,
@@ -214,10 +217,10 @@ export function createV4StageCapsuleTransport({
214
217
  "$/transport",
215
218
  "unsupported transport provider or mode",
216
219
  );
217
- validateV4Root(locatorRoot, "$/transport/locatorRoot");
218
- validateV4Clock(observedAt, "$/transport/observedAt");
220
+ validateRoot(locatorRoot, "$/transport/locatorRoot");
221
+ validateClock(observedAt, "$/transport/observedAt");
219
222
  const value = {
220
- schema: V4_STAGE_CAPSULE_TRANSPORT_CONTRACT,
223
+ schema: STAGE_CAPSULE_TRANSPORT_CONTRACT,
221
224
  provider,
222
225
  mode,
223
226
  locatorRoot,
@@ -225,11 +228,11 @@ export function createV4StageCapsuleTransport({
225
228
  };
226
229
  return {
227
230
  ...value,
228
- transportRoot: v4ContentRoot("stage-capsule-transport", value),
231
+ transportRoot: domainContentRoot("stage-capsule-transport", value),
229
232
  };
230
233
  }
231
234
 
232
- export function validateV4StageCapsuleTransport(value) {
235
+ export function validateStageCapsuleTransport(value) {
233
236
  exactKeys(
234
237
  value,
235
238
  [
@@ -242,7 +245,7 @@ export function validateV4StageCapsuleTransport(value) {
242
245
  ],
243
246
  "$/transport",
244
247
  );
245
- const rebuilt = createV4StageCapsuleTransport(value);
248
+ const rebuilt = createStageCapsuleTransport(value);
246
249
  if (
247
250
  rebuilt.schema !== value.schema ||
248
251
  rebuilt.transportRoot !== value.transportRoot
@@ -255,9 +258,9 @@ export function validateV4StageCapsuleTransport(value) {
255
258
  return value;
256
259
  }
257
260
 
258
- export function createV4StageCapsuleStoreReceipt(value) {
261
+ export function createStageCapsuleStoreReceipt(value) {
259
262
  const body = {
260
- schema: V4_STAGE_CAPSULE_STORE_RECEIPT_CONTRACT,
263
+ schema: STAGE_CAPSULE_STORE_RECEIPT_CONTRACT,
261
264
  operation: value.operation,
262
265
  recordedAt: value.recordedAt,
263
266
  capsuleRoot: value.capsuleRoot,
@@ -271,12 +274,12 @@ export function createV4StageCapsuleStoreReceipt(value) {
271
274
  };
272
275
  const receipt = {
273
276
  ...body,
274
- receiptRoot: v4ContentRoot("stage-capsule-store-receipt", body),
277
+ receiptRoot: domainContentRoot("stage-capsule-store-receipt", body),
275
278
  };
276
- return validateV4StageCapsuleStoreReceipt(receipt);
279
+ return validateStageCapsuleStoreReceipt(receipt);
277
280
  }
278
281
 
279
- export function validateV4StageCapsuleStoreReceipt(value) {
282
+ export function validateStageCapsuleStoreReceipt(value) {
280
283
  exactKeys(
281
284
  value,
282
285
  [
@@ -295,7 +298,7 @@ export function validateV4StageCapsuleStoreReceipt(value) {
295
298
  ],
296
299
  "$/receipt",
297
300
  );
298
- if (value.schema !== V4_STAGE_CAPSULE_STORE_RECEIPT_CONTRACT)
301
+ if (value.schema !== STAGE_CAPSULE_STORE_RECEIPT_CONTRACT)
299
302
  fault(
300
303
  "unsupported-stage-capsule-store-version",
301
304
  "$/receipt/schema",
@@ -307,7 +310,7 @@ export function validateV4StageCapsuleStoreReceipt(value) {
307
310
  "$/receipt",
308
311
  "unsupported store operation or outcome",
309
312
  );
310
- validateV4Clock(value.recordedAt, "$/receipt/recordedAt");
313
+ validateClock(value.recordedAt, "$/receipt/recordedAt");
311
314
  for (const name of [
312
315
  "capsuleRoot",
313
316
  "manifestRoot",
@@ -317,7 +320,7 @@ export function validateV4StageCapsuleStoreReceipt(value) {
317
320
  "qualificationRoot",
318
321
  "receiptRoot",
319
322
  ])
320
- validateV4Root(value[name], `$/receipt/${name}`);
323
+ validateRoot(value[name], `$/receipt/${name}`);
321
324
  if (value.faultCode !== null)
322
325
  fault(
323
326
  "invalid-stage-capsule-store-receipt",
@@ -325,7 +328,7 @@ export function validateV4StageCapsuleStoreReceipt(value) {
325
328
  "successful store receipts cannot carry a fault",
326
329
  );
327
330
  const { receiptRoot, ...body } = value;
328
- if (receiptRoot !== v4ContentRoot("stage-capsule-store-receipt", body))
331
+ if (receiptRoot !== domainContentRoot("stage-capsule-store-receipt", body))
329
332
  fault(
330
333
  "stage-capsule-store-receipt-root-mismatch",
331
334
  "$/receipt/receiptRoot",
@@ -341,12 +344,12 @@ function validateProviderRequest(operation, request) {
341
344
  : ["capsuleRoot", "locatorRoot", "recordedAt"];
342
345
  exactKeys(request, keys, "$/adapter/request");
343
346
  for (const name of keys.filter((name) => name.endsWith("Root")))
344
- validateV4Root(request[name], `$/adapter/request/${name}`);
345
- validateV4Clock(request.recordedAt, "$/adapter/request/recordedAt");
347
+ validateRoot(request[name], `$/adapter/request/${name}`);
348
+ validateClock(request.recordedAt, "$/adapter/request/recordedAt");
346
349
  return request;
347
350
  }
348
351
 
349
- export function createV4StageCapsuleProviderAdapter({
352
+ export function createStageCapsuleProviderAdapter({
350
353
  provider,
351
354
  mode = "effect-disabled",
352
355
  fixture = null,
@@ -388,7 +391,7 @@ export function createV4StageCapsuleProviderAdapter({
388
391
  mode,
389
392
  observe: (request) => {
390
393
  exactKeys(request, ["locatorRoot", "observedAt"], "$/adapter/request");
391
- return createV4StageCapsuleTransport({
394
+ return createStageCapsuleTransport({
392
395
  provider,
393
396
  mode,
394
397
  locatorRoot: request.locatorRoot,
@@ -1,16 +1,16 @@
1
1
  import {
2
- V4ContractFault,
3
- v4ContentRoot,
4
- validateV4Clock,
5
- validateV4Root,
6
- } from "./v4-canonical-contracts.js";
2
+ ContractFault,
3
+ domainContentRoot,
4
+ validateClock,
5
+ validateRoot,
6
+ } from "./canonical-contracts.js";
7
7
 
8
- export const V4_STAGE_CAPSULE_CONTRACT = "buildchain-v4-stage-capsule/v1";
9
- export const V4_STAGE_CAPSULE_IDENTITY_CONTRACT =
8
+ export const STAGE_CAPSULE_CONTRACT = "buildchain-v4-stage-capsule/v1";
9
+ export const STAGE_CAPSULE_IDENTITY_CONTRACT =
10
10
  "buildchain-v4-stage-capsule-identity/v1";
11
- export const V4_STAGE_CAPSULE_AVAILABILITY_CONTRACT =
11
+ export const STAGE_CAPSULE_AVAILABILITY_CONTRACT =
12
12
  "buildchain-v4-stage-capsule-availability/v1";
13
- export const V4_STAGE_CAPSULE_REUSE_CONTRACT =
13
+ export const STAGE_CAPSULE_REUSE_CONTRACT =
14
14
  "buildchain-v4-stage-capsule-reuse/v1";
15
15
 
16
16
  const TOKEN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
@@ -25,7 +25,7 @@ const AVAILABILITY = new Set([
25
25
  ]);
26
26
 
27
27
  function fault(code, path, message) {
28
- throw new V4ContractFault(code, path, message);
28
+ throw new ContractFault(code, path, message);
29
29
  }
30
30
 
31
31
  function exactKeys(value, keys, path) {
@@ -61,7 +61,7 @@ function validateNamedRoots(value, path) {
61
61
  const entryPath = `${path}/${index}`;
62
62
  exactKeys(entry, ["name", "root"], entryPath);
63
63
  validateToken(entry.name, `${entryPath}/name`);
64
- validateV4Root(entry.root, `${entryPath}/root`);
64
+ validateRoot(entry.root, `${entryPath}/root`);
65
65
  if (prior !== null && entry.name <= prior)
66
66
  fault(
67
67
  "unordered-stage-capsule-roots",
@@ -72,7 +72,7 @@ function validateNamedRoots(value, path) {
72
72
  }
73
73
  }
74
74
 
75
- export function validateV4StageCapsuleIdentity(value) {
75
+ export function validateStageCapsuleIdentity(value) {
76
76
  exactKeys(
77
77
  value,
78
78
  [
@@ -92,7 +92,7 @@ export function validateV4StageCapsuleIdentity(value) {
92
92
  ],
93
93
  "$/identity",
94
94
  );
95
- if (value.schema !== V4_STAGE_CAPSULE_IDENTITY_CONTRACT)
95
+ if (value.schema !== STAGE_CAPSULE_IDENTITY_CONTRACT)
96
96
  fault(
97
97
  "unsupported-stage-capsule-version",
98
98
  "$/identity/schema",
@@ -109,22 +109,22 @@ export function validateV4StageCapsuleIdentity(value) {
109
109
  "outputManifestRoot",
110
110
  "qualificationRoot",
111
111
  ])
112
- validateV4Root(value[name], `$/identity/${name}`);
112
+ validateRoot(value[name], `$/identity/${name}`);
113
113
  validateNamedRoots(value.toolchainRoots, "$/identity/toolchainRoots");
114
114
  validateNamedRoots(value.declaredInputs, "$/identity/declaredInputs");
115
115
  validateNamedRoots(value.observationRoots, "$/identity/observationRoots");
116
116
  return value;
117
117
  }
118
118
 
119
- export function v4StageCapsuleIdentityRoot(identity) {
120
- validateV4StageCapsuleIdentity(identity);
121
- return v4ContentRoot("stage-capsule-identity", identity);
119
+ export function stageCapsuleIdentityRoot(identity) {
120
+ validateStageCapsuleIdentity(identity);
121
+ return domainContentRoot("stage-capsule-identity", identity);
122
122
  }
123
123
 
124
124
  function validateRetentionPromise(value) {
125
125
  exactKeys(value, ["class", "retainUntil"], "$/retentionPromise");
126
126
  validateToken(value.class, "$/retentionPromise/class");
127
- validateV4Clock(value.retainUntil, "$/retentionPromise/retainUntil");
127
+ validateClock(value.retainUntil, "$/retentionPromise/retainUntil");
128
128
  }
129
129
 
130
130
  function capsulePayload(value) {
@@ -138,7 +138,7 @@ function capsulePayload(value) {
138
138
  };
139
139
  }
140
140
 
141
- export function validateV4StageCapsule(value) {
141
+ export function validateStageCapsule(value) {
142
142
  exactKeys(
143
143
  value,
144
144
  [
@@ -152,7 +152,7 @@ export function validateV4StageCapsule(value) {
152
152
  ],
153
153
  "$",
154
154
  );
155
- if (value.schema !== V4_STAGE_CAPSULE_CONTRACT)
155
+ if (value.schema !== STAGE_CAPSULE_CONTRACT)
156
156
  fault(
157
157
  "unsupported-stage-capsule-version",
158
158
  "$/schema",
@@ -167,8 +167,8 @@ export function validateV4StageCapsule(value) {
167
167
  "$/writerAuthority",
168
168
  "Stage Capsule authority must remain TypeScript v3 with validation-only Rust",
169
169
  );
170
- const identityRoot = v4StageCapsuleIdentityRoot(value.identity);
171
- validateV4Root(value.identityRoot, "$/identityRoot");
170
+ const identityRoot = stageCapsuleIdentityRoot(value.identity);
171
+ validateRoot(value.identityRoot, "$/identityRoot");
172
172
  if (value.identityRoot !== identityRoot)
173
173
  fault(
174
174
  "stage-capsule-identity-root-mismatch",
@@ -176,8 +176,8 @@ export function validateV4StageCapsule(value) {
176
176
  "identityRoot does not bind the canonical Stage Capsule identity",
177
177
  );
178
178
  validateRetentionPromise(value.retentionPromise);
179
- validateV4Root(value.capsuleRoot, "$/capsuleRoot");
180
- const capsuleRoot = v4ContentRoot("stage-capsule", capsulePayload(value));
179
+ validateRoot(value.capsuleRoot, "$/capsuleRoot");
180
+ const capsuleRoot = domainContentRoot("stage-capsule", capsulePayload(value));
181
181
  if (value.capsuleRoot !== capsuleRoot)
182
182
  fault(
183
183
  "stage-capsule-root-mismatch",
@@ -187,13 +187,13 @@ export function validateV4StageCapsule(value) {
187
187
  return value;
188
188
  }
189
189
 
190
- export function v4StageCapsuleRoot(value) {
191
- validateV4StageCapsuleIdentity(value.identity);
190
+ export function stageCapsuleRoot(value) {
191
+ validateStageCapsuleIdentity(value.identity);
192
192
  validateRetentionPromise(value.retentionPromise);
193
- return v4ContentRoot("stage-capsule", capsulePayload(value));
193
+ return domainContentRoot("stage-capsule", capsulePayload(value));
194
194
  }
195
195
 
196
- export function validateV4StageCapsuleAvailability(value) {
196
+ export function validateStageCapsuleAvailability(value) {
197
197
  exactKeys(
198
198
  value,
199
199
  [
@@ -208,14 +208,14 @@ export function validateV4StageCapsuleAvailability(value) {
208
208
  ],
209
209
  "$/availability",
210
210
  );
211
- if (value.schema !== V4_STAGE_CAPSULE_AVAILABILITY_CONTRACT)
211
+ if (value.schema !== STAGE_CAPSULE_AVAILABILITY_CONTRACT)
212
212
  fault(
213
213
  "unsupported-stage-capsule-version",
214
214
  "$/availability/schema",
215
215
  "unsupported Stage Capsule availability schema",
216
216
  );
217
- validateV4Root(value.capsuleRoot, "$/availability/capsuleRoot");
218
- validateV4Clock(value.observedAt, "$/availability/observedAt");
217
+ validateRoot(value.capsuleRoot, "$/availability/capsuleRoot");
218
+ validateClock(value.observedAt, "$/availability/observedAt");
219
219
  if (!AVAILABILITY.has(value.status))
220
220
  fault(
221
221
  "invalid-stage-capsule-availability",
@@ -224,7 +224,7 @@ export function validateV4StageCapsuleAvailability(value) {
224
224
  );
225
225
  for (const name of ["contentRoot", "qualificationRoot"])
226
226
  if (value[name] !== null)
227
- validateV4Root(value[name], `$/availability/${name}`);
227
+ validateRoot(value[name], `$/availability/${name}`);
228
228
  validateNamedRoots(value.transports, "$/availability/transports");
229
229
  if (value.faultCode !== null)
230
230
  validateToken(value.faultCode, "$/availability/faultCode");
@@ -248,12 +248,12 @@ export function validateV4StageCapsuleAvailability(value) {
248
248
  return value;
249
249
  }
250
250
 
251
- export function v4StageCapsuleAvailabilityRoot(value) {
252
- validateV4StageCapsuleAvailability(value);
253
- return v4ContentRoot("stage-capsule-availability", value);
251
+ export function stageCapsuleAvailabilityRoot(value) {
252
+ validateStageCapsuleAvailability(value);
253
+ return domainContentRoot("stage-capsule-availability", value);
254
254
  }
255
255
 
256
- export function evaluateV4StageCapsuleReuse(request) {
256
+ export function evaluateStageCapsuleReuse(request) {
257
257
  exactKeys(
258
258
  request,
259
259
  [
@@ -267,26 +267,26 @@ export function evaluateV4StageCapsuleReuse(request) {
267
267
  ],
268
268
  "$",
269
269
  );
270
- if (request.schema !== V4_STAGE_CAPSULE_REUSE_CONTRACT)
270
+ if (request.schema !== STAGE_CAPSULE_REUSE_CONTRACT)
271
271
  fault(
272
272
  "unsupported-stage-capsule-version",
273
273
  "$/schema",
274
274
  "unsupported Stage Capsule reuse schema",
275
275
  );
276
- validateV4StageCapsule(request.capsule);
277
- validateV4StageCapsuleAvailability(request.availability);
278
- validateV4Clock(request.evaluatedAt, "$/evaluatedAt");
276
+ validateStageCapsule(request.capsule);
277
+ validateStageCapsuleAvailability(request.availability);
278
+ validateClock(request.evaluatedAt, "$/evaluatedAt");
279
279
  for (const name of [
280
280
  "expectedCapsuleRoot",
281
281
  "expectedOutputManifestRoot",
282
282
  "expectedQualificationRoot",
283
283
  ])
284
- validateV4Root(request[name], `$/${name}`);
284
+ validateRoot(request[name], `$/${name}`);
285
285
  const fail = (reason) => ({
286
- schema: V4_STAGE_CAPSULE_REUSE_CONTRACT,
286
+ schema: STAGE_CAPSULE_REUSE_CONTRACT,
287
287
  eligible: false,
288
288
  capsuleRoot: request.capsule.capsuleRoot,
289
- availabilityRoot: v4StageCapsuleAvailabilityRoot(request.availability),
289
+ availabilityRoot: stageCapsuleAvailabilityRoot(request.availability),
290
290
  reason,
291
291
  });
292
292
  if (
@@ -310,10 +310,10 @@ export function evaluateV4StageCapsuleReuse(request) {
310
310
  )
311
311
  return fail("root-mismatch");
312
312
  return {
313
- schema: V4_STAGE_CAPSULE_REUSE_CONTRACT,
313
+ schema: STAGE_CAPSULE_REUSE_CONTRACT,
314
314
  eligible: true,
315
315
  capsuleRoot: request.capsule.capsuleRoot,
316
- availabilityRoot: v4StageCapsuleAvailabilityRoot(request.availability),
316
+ availabilityRoot: stageCapsuleAvailabilityRoot(request.availability),
317
317
  reason: "eligible",
318
318
  };
319
319
  }
@@ -1,24 +1,24 @@
1
- export const V4_TAIL_RESEAL_REQUEST_CONTRACT =
1
+ export const TAIL_RESEAL_REQUEST_CONTRACT =
2
2
  "kungfu-buildchain-v4-tail-reseal-request/v1";
3
- export const V4_TAIL_RESEAL_PLAN_CONTRACT =
3
+ export const TAIL_RESEAL_PLAN_CONTRACT =
4
4
  "kungfu-buildchain-v4-tail-reseal-plan/v1";
5
5
 
6
- export const V4_TAIL_RESEAL_PLATFORMS = Object.freeze([
6
+ export const TAIL_RESEAL_PLATFORMS = Object.freeze([
7
7
  "linux-arm64",
8
8
  "linux-x64",
9
9
  "macos-arm64",
10
10
  "windows-x64",
11
11
  ]);
12
12
 
13
- export const V4_TAIL_RESEAL_PLATFORM_RUNNERS = Object.freeze({
13
+ export const TAIL_RESEAL_PLATFORM_RUNNERS = Object.freeze({
14
14
  "linux-arm64": '["ubuntu-24.04-arm"]',
15
15
  "linux-x64": '["ubuntu-24.04"]',
16
16
  "macos-arm64": '["macos-15"]',
17
17
  "windows-x64": '["windows-2025"]',
18
18
  });
19
19
 
20
- export const V4_TAIL_RESEAL_REUSED_STAGE_KEYS = Object.freeze(
21
- V4_TAIL_RESEAL_PLATFORMS.flatMap((platformId) =>
20
+ export const TAIL_RESEAL_REUSED_STAGE_KEYS = Object.freeze(
21
+ TAIL_RESEAL_PLATFORMS.flatMap((platformId) =>
22
22
  ["build", "install", "package", "verify"].map(
23
23
  (stage) => `${platformId}:${stage}`,
24
24
  ),
@@ -1,10 +1,7 @@
1
- import { v4ContentRoot } from "./v4-canonical-contracts.js";
2
- import {
3
- V4TailResealFault,
4
- normalizeV4TailResealRequest,
5
- } from "./v4-tail-reseal.js";
1
+ import { domainContentRoot } from "./canonical-contracts.js";
2
+ import { TailResealFault, normalizeTailResealRequest } from "./tail-reseal.js";
6
3
 
7
- export const V4_TAIL_RESEAL_ADMISSION_CONTRACT =
4
+ export const TAIL_RESEAL_ADMISSION_CONTRACT =
8
5
  "kungfu-buildchain-v4-tail-reseal-admission/v1";
9
6
 
10
7
  const REQUIRED_SUCCESS_JOBS = Object.freeze([
@@ -22,7 +19,7 @@ const REQUIRED_SUCCESS_JOBS = Object.freeze([
22
19
  ]);
23
20
 
24
21
  function fault(code, path, message) {
25
- throw new V4TailResealFault(code, path, message);
22
+ throw new TailResealFault(code, path, message);
26
23
  }
27
24
 
28
25
  function exactArtifact(artifacts, name, digest, path) {
@@ -141,7 +138,7 @@ function validateSigningAuthority(normalized, signingRun, signingArtifacts) {
141
138
  );
142
139
  }
143
140
 
144
- export function validateV4TailResealGitHubEvidence({
141
+ export function validateTailResealGitHubEvidence({
145
142
  request,
146
143
  sourceCommit,
147
144
  sourceRun,
@@ -150,13 +147,13 @@ export function validateV4TailResealGitHubEvidence({
150
147
  signingRun,
151
148
  signingArtifacts,
152
149
  } = {}) {
153
- const normalized = normalizeV4TailResealRequest(request);
150
+ const normalized = normalizeTailResealRequest(request);
154
151
  validateSourceIdentity(normalized, sourceCommit, sourceRun);
155
152
  validateSourceJobs(normalized, sourceJobs);
156
153
  validateRetainedArtifacts(normalized, sourceArtifacts);
157
154
  validateSigningAuthority(normalized, signingRun, signingArtifacts);
158
155
  const payload = {
159
- schema: V4_TAIL_RESEAL_ADMISSION_CONTRACT,
156
+ schema: TAIL_RESEAL_ADMISSION_CONTRACT,
160
157
  repository: normalized.repository,
161
158
  sourceRoot: normalized.source.sourceRoot,
162
159
  sourceRunId: normalized.source.runId,
@@ -171,8 +168,11 @@ export function validateV4TailResealGitHubEvidence({
171
168
  };
172
169
  return {
173
170
  ...payload,
174
- admissionRoot: v4ContentRoot("tail-reseal-admission", payload),
171
+ admissionRoot: domainContentRoot("tail-reseal-admission", payload),
175
172
  };
176
173
  }
177
174
 
178
- export { REQUIRED_SUCCESS_JOBS as V4_TAIL_RESEAL_REQUIRED_SUCCESS_JOBS };
175
+ export {
176
+ REQUIRED_SUCCESS_JOBS as TAIL_RESEAL_REQUIRED_SUCCESS_JOBS,
177
+ REQUIRED_SUCCESS_JOBS as V4_TAIL_RESEAL_REQUIRED_SUCCESS_JOBS,
178
+ };