@kungfu-tech/buildchain 4.0.2-alpha.29 → 4.0.2-alpha.32

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 (57) hide show
  1. package/architecture/agent-change-map.md +6 -1
  2. package/architecture/internal-capabilities.json +5 -2
  3. package/architecture/maintainability-debt.json +91 -59
  4. package/architecture/maintainability-policy.json +22 -23
  5. package/architecture/v4-architecture-constitution.md +23 -20
  6. package/architecture/v4-partial-mutation-recovery-qualification.json +4 -1
  7. package/architecture/v4-provider-operation-journal-contract.json +5 -2
  8. package/architecture/v4-release-activation-shadow-domain.json +5 -2
  9. package/architecture/v4-release-topology.json +17 -2
  10. package/architecture/v4-rust-wasm-production-authority.json +57 -0
  11. package/architecture/v4-stable-publication-fence.json +5 -2
  12. package/bin/buildchain.mjs +7 -7
  13. package/contracts/dev-delivery-authority-v2.schema.json +16 -2
  14. package/dist/site/buildchain-contract.json +6 -6
  15. package/dist/site/buildchain-site.json +44 -8
  16. package/dist/site/capability-registry.json +1 -1
  17. package/dist/site/kfd-claims.json +17 -5
  18. package/dist/site/kfd-upstream-aggregate.json +1 -1
  19. package/dist/site/manual-registry.json +1 -1
  20. package/dist/site/node-api-registry.json +32 -32
  21. package/dist/site/page-registry.json +39 -3
  22. package/dist/site/public-surface-audit.json +7 -3
  23. package/dist/site/publication-registry.json +4 -4
  24. package/dist/site/schemas/dev-delivery-authority-v2.schema.json +16 -2
  25. package/dist/site/site-manifest.json +5 -5
  26. package/dist/site/workflow-registry.json +4 -4
  27. package/docs/node-api-reference.md +64 -64
  28. package/docs/v4-rust-wasm-production-authority.md +58 -0
  29. package/package.json +5 -3
  30. package/packages/core/buildchain-v4-domain.wasm +0 -0
  31. package/packages/core/dev-delivery-candidate-identity.js +26 -10
  32. package/packages/core/dev-delivery-warrant-state.js +3 -4
  33. package/packages/core/dev-delivery-warrant.js +12 -2
  34. package/packages/core/release-tail-provider-plane.js +68 -1048
  35. package/packages/core/v4-canonical-contracts.js +9 -75
  36. package/packages/core/v4-domain-wasm-artifact.js +7 -0
  37. package/packages/core/v4-domain-wasm.js +216 -0
  38. package/packages/core/v4-partial-mutation-recovery-qualification.js +9 -386
  39. package/packages/core/v4-product-publication.js +18 -384
  40. package/packages/core/v4-provider-operation-journal.js +18 -487
  41. package/packages/core/v4-provider-readback-idempotency.js +12 -97
  42. package/packages/core/v4-release-activation-shadow.js +13 -500
  43. package/packages/core/v4-release-invocation.js +28 -389
  44. package/packages/core/v4-stable-publication-fence.js +13 -342
  45. package/scripts/build-contract-core.mjs +1 -14
  46. package/scripts/build-v4-domain-wasm.mjs +189 -0
  47. package/scripts/check-action-bundles.mjs +12 -2
  48. package/scripts/check-v4-release-topology.mjs +50 -25
  49. package/scripts/copy-v4-domain-wasm.mjs +14 -0
  50. package/scripts/dev-delivery-authority-command-adapters.mjs +1 -1
  51. package/scripts/dev-delivery-authority.mjs +8 -8
  52. package/scripts/dev-delivery-source-proof-reuse.mjs +2 -1
  53. package/scripts/dev-delivery-warrant-options.mjs +14 -9
  54. package/scripts/dev-delivery-warrant.mjs +7 -2
  55. package/scripts/generate-v4-universal-workflow-facades.mjs +8 -3
  56. package/scripts/github-output.mjs +31 -0
  57. package/templates/native-dev-delivery.yml +4 -7
@@ -20,7 +20,21 @@ export const EXACT_DEV_DELIVERY_PROOF_FIELDS = Object.freeze([
20
20
  "environmentRoot",
21
21
  "sourceWorkflowRunId",
22
22
  ]);
23
-
23
+ export function devDeliverySourceBinding(input = {}) {
24
+ const [sourceRoot, assignmentRoot, initiativeRoot] = [
25
+ "sourceRoot",
26
+ "assignmentRoot",
27
+ "initiativeRoot",
28
+ ].map((field) => String(input[field] || "").trim());
29
+ if (sourceRoot && !assignmentRoot && !initiativeRoot)
30
+ return { sourceRoot: exactRoot(sourceRoot, "sourceRoot") };
31
+ if (!sourceRoot && assignmentRoot && initiativeRoot)
32
+ return {
33
+ assignmentRoot: exactRoot(assignmentRoot, "assignmentRoot"),
34
+ initiativeRoot: exactRoot(initiativeRoot, "initiativeRoot"),
35
+ };
36
+ throw new Error("provide sourceRoot alone or both historical roots");
37
+ }
24
38
  export function matchesExactDevDeliveryCandidate(existing, attempted) {
25
39
  return (
26
40
  existing.sourceHead === attempted.sourceHead &&
@@ -37,14 +51,19 @@ export function matchesExactDevDeliveryCandidate(existing, attempted) {
37
51
  attempted.releaseBlockerPriority?.claimRoot
38
52
  );
39
53
  }
40
-
41
54
  export function reuseExactActiveDevDeliverySourceProof(active, input) {
55
+ const phaseCompatible =
56
+ ["provisional", "qualified"].includes(active?.phase) ||
57
+ (!Object.hasOwn(active || {}, "phase") &&
58
+ active?.deliveryClass === "non-native-fast" &&
59
+ !Object.hasOwn(active || {}, "environmentRoot"));
42
60
  const exact =
43
- ["provisional", "qualified"].includes(active?.phase) &&
61
+ phaseCompatible &&
62
+ ["sourceRoot", "assignmentRoot", "initiativeRoot"].every(
63
+ (field) => active[field] === input[field],
64
+ ) &&
44
65
  [
45
66
  "pullRequestNumber",
46
- "assignmentRoot",
47
- "initiativeRoot",
48
67
  "sourceIdentityRoot",
49
68
  "deliveryClass",
50
69
  "priority",
@@ -68,8 +87,7 @@ export function createDevDeliveryCandidateIdentity(
68
87
  input.pullRequestNumber,
69
88
  "pullRequestNumber",
70
89
  ),
71
- assignmentRoot: exactRoot(input.assignmentRoot, "assignmentRoot"),
72
- initiativeRoot: exactRoot(input.initiativeRoot, "initiativeRoot"),
90
+ ...devDeliverySourceBinding(input),
73
91
  sourceIdentityRoot: exactRoot(
74
92
  input.sourceIdentityRoot,
75
93
  "sourceIdentityRoot",
@@ -77,11 +95,10 @@ export function createDevDeliveryCandidateIdentity(
77
95
  deliveryClass: deliveryClass(input.deliveryClass),
78
96
  };
79
97
  if (input.identitySemantics) {
80
- if (text(input.identitySemantics) !== CHAINED_ATTEMPT_IDENTITY) {
98
+ if (text(input.identitySemantics) !== CHAINED_ATTEMPT_IDENTITY)
81
99
  throw new Error(
82
100
  `unsupported candidate identity semantics ${input.identitySemantics}`,
83
101
  );
84
- }
85
102
  identity.identitySemantics = CHAINED_ATTEMPT_IDENTITY;
86
103
  identity.predecessorCandidateId = exactRoot(
87
104
  input.predecessorCandidateId,
@@ -90,7 +107,6 @@ export function createDevDeliveryCandidateIdentity(
90
107
  }
91
108
  return { ...identity, candidateId: devDeliveryContentRoot(identity) };
92
109
  }
93
-
94
110
  export function validateDevDeliveryCandidateChain(candidates, terminalStates) {
95
111
  const precedingCandidates = new Map();
96
112
  const latestByPullRequest = new Map();
@@ -12,6 +12,7 @@ import {
12
12
  import {
13
13
  chainedDevDeliveryAttemptInput,
14
14
  createDevDeliveryCandidateIdentity,
15
+ devDeliverySourceBinding,
15
16
  EXACT_DEV_DELIVERY_PROOF_FIELDS,
16
17
  matchesExactDevDeliveryCandidate,
17
18
  validateDevDeliveryCandidateChain,
@@ -86,8 +87,7 @@ export function issueDevDeliveryWarrant(
86
87
  candidateId: candidate.candidateId,
87
88
  pullRequestNumber: candidate.pullRequestNumber,
88
89
  sourceHead: candidate.sourceHead,
89
- assignmentRoot: candidate.assignmentRoot,
90
- initiativeRoot: candidate.initiativeRoot,
90
+ ...devDeliverySourceBinding(candidate),
91
91
  sourceIdentityRoot: candidate.sourceIdentityRoot,
92
92
  sourcePatchRoot: candidate.sourcePatchRoot,
93
93
  sourceProofRoot: candidate.sourceProofRoot,
@@ -413,8 +413,7 @@ function submissionReceipt({ before, after, candidate, action, now }) {
413
413
  candidateId: candidate.candidateId,
414
414
  pullRequestNumber: candidate.pullRequestNumber,
415
415
  sourceHead: candidate.sourceHead,
416
- assignmentRoot: candidate.assignmentRoot,
417
- initiativeRoot: candidate.initiativeRoot,
416
+ ...devDeliverySourceBinding(candidate),
418
417
  sourceIdentityRoot: candidate.sourceIdentityRoot,
419
418
  sourcePatchRoot: candidate.sourcePatchRoot,
420
419
  sourceProofRoot: candidate.sourceProofRoot,
@@ -198,8 +198,8 @@ export function selectDevDeliveryWarrant(
198
198
  candidateId: transaction.result.candidate.candidateId,
199
199
  pullRequestNumber: transaction.result.candidate.pullRequestNumber,
200
200
  sourceHead: transaction.result.candidate.sourceHead,
201
- assignmentRoot: transaction.result.candidate.assignmentRoot,
202
- initiativeRoot: transaction.result.candidate.initiativeRoot,
201
+ ...candidateSourceBinding(transaction.result.candidate),
202
+
203
203
  sourceIdentityRoot: transaction.result.candidate.sourceIdentityRoot,
204
204
  sourcePatchRoot: transaction.result.candidate.sourcePatchRoot,
205
205
  sourceProofRoot: transaction.result.candidate.sourceProofRoot,
@@ -488,6 +488,7 @@ function createDevDeliverySuccessorWake(queue, now) {
488
488
  "candidateId",
489
489
  "pullRequestNumber",
490
490
  "sourceHead",
491
+ "sourceRoot",
491
492
  "assignmentRoot",
492
493
  "initiativeRoot",
493
494
  "sourceIdentityRoot",
@@ -586,3 +587,12 @@ export function observeDevDeliveryQueue(
586
587
  observedAt: currentTime,
587
588
  };
588
589
  }
590
+
591
+ function candidateSourceBinding(candidate) {
592
+ return candidate.sourceRoot
593
+ ? { sourceRoot: candidate.sourceRoot }
594
+ : {
595
+ assignmentRoot: candidate.assignmentRoot,
596
+ initiativeRoot: candidate.initiativeRoot,
597
+ };
598
+ }