@kungfu-tech/buildchain 4.0.1-alpha.2 → 4.0.1-alpha.21
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.
- package/actions/release-tail/README.md +8 -0
- package/architecture/ci-lane-change-budget.json +187 -0
- package/architecture/decisions/0002-next-development-transition.md +101 -0
- package/architecture/decisions/0003-two-phase-delivery-warrant.md +152 -0
- package/architecture/internal-capabilities.json +211 -8
- package/architecture/maintainability-policy.json +113 -28
- package/architecture/release-tail-contract-inventory.json +5 -2
- package/architecture/v3-core-mechanism-inventory.json +91 -0
- package/architecture/v4-adopter-delivery-parity.json +32 -5
- package/architecture/v4-capability-state-machine-manifest.json +73 -0
- package/architecture/v4-compatibility-facts-parity.json +77 -0
- package/architecture/v4-delivery-authority-parity.json +250 -0
- package/architecture/v4-delivery-warrant-shadow-fixtures.json +41 -9
- package/architecture/v4-floating-consumer-policy.json +6 -0
- package/architecture/v4-next-development-parity.json +192 -0
- package/architecture/v4-publication-rehearsal-parity.json +84 -0
- package/architecture/v4-release-train-parity.json +1 -0
- package/architecture/v4-tail-reseal-parity.json +150 -0
- package/bin/buildchain.mjs +32 -3
- package/bin/internal/adopter-delivery-cli.mjs +70 -0
- package/bin/internal/command-registry.mjs +3 -0
- package/bin/internal/compatibility-facts-cli.mjs +101 -0
- package/contracts/dev-delivery-authority-v2.schema.json +662 -0
- package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +40 -0
- package/contracts/fixtures/v4-adopter-delivery-v1/archive-template.json +19 -0
- package/contracts/fixtures/v4-adopter-delivery-v1/bootstrap-positive.json +93 -0
- package/contracts/fixtures/v4-adopter-delivery-v1/gate-positive.json +29 -0
- package/contracts/fixtures/v4-adopter-delivery-v1/gate-unknown-selector.json +26 -0
- package/contracts/fixtures/v4-adopter-delivery-v1/offline-vectors.json +50 -0
- package/contracts/fixtures/v4-compatibility-facts-v1/shared.json +1129 -0
- package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +7 -1
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/artifacts/product.bin +1 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/config/buildchain.toml +5 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/documents/release-activation.json +1 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/documents/signed-channel.json +1 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/evidence/qualification.json +1 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/manifests/candidate.json +5 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/candidate/manifests/release-passport.json +1 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/capsule.json +707 -0
- package/contracts/fixtures/v4-publication-rehearsal-v1/offline-vectors.json +27 -0
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +229 -0
- package/contracts/next-development-request-v1.schema.json +66 -0
- package/contracts/next-development-transition-v1.schema.json +292 -0
- package/contracts/v4-adopter-delivery-v1.schema.json +81 -0
- package/contracts/v4-compatibility-facts-v1.schema.json +230 -0
- package/contracts/v4-floating-consumer-policy-receipt-v1.schema.json +4 -2
- package/contracts/v4-publication-rehearsal-capsule-v1.schema.json +233 -0
- package/contracts/v4-tail-reseal-v1.schema.json +276 -0
- package/dist/site/agent-index.json +5 -0
- package/dist/site/artifact-schemas.json +10 -0
- package/dist/site/buildchain-contract.json +1475 -27
- package/dist/site/buildchain-site.json +627 -31
- package/dist/site/capability-registry.json +17 -14
- package/dist/site/cli-registry.json +205 -3
- package/dist/site/kfd-claims.json +490 -16
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +52 -6
- package/dist/site/node-api-registry.json +14736 -8851
- package/dist/site/page-registry.json +593 -21
- package/dist/site/public-surface-audit.json +837 -48
- package/dist/site/publication-authority-registry.json +44 -8
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +24 -0
- package/dist/site/schemas/dev-delivery-authority-v2.schema.json +662 -0
- package/dist/site/schemas/release-tail-capabilities-v1.schema.json +199 -0
- package/dist/site/schemas/v4-adopter-delivery-v1.schema.json +81 -0
- package/dist/site/schemas/v4-compatibility-facts-v1.schema.json +230 -0
- package/dist/site/schemas/v4-publication-rehearsal-capsule-v1.schema.json +233 -0
- package/dist/site/site-manifest.json +34 -10
- package/dist/site/workflow-registry.json +160 -10
- package/docs/MAP.md +8 -2
- package/docs/cli-reference.md +404 -13
- package/docs/cli.md +8 -0
- package/docs/dev-alpha-candidate-patrol.md +8 -0
- package/docs/dev-delivery-qualification-landing-adr.md +251 -0
- package/docs/dev-delivery-warrant.md +351 -38
- package/docs/next-development-transition.md +118 -0
- package/docs/node-api-reference.md +646 -293
- package/docs/release-tail-provider-plane.md +30 -0
- package/docs/v4-adopter-delivery.md +133 -0
- package/docs/v4-compatibility-facts.md +91 -0
- package/docs/v4-publication-rehearsal.md +130 -0
- package/docs/v4-tail-reseal.md +73 -0
- package/docs/versioning.md +4 -3
- package/package.json +34 -6
- package/packages/core/adopter-delivery-passport.js +259 -0
- package/packages/core/adopter-delivery-vectors.js +158 -0
- package/packages/core/adopter-delivery-vectors.json +77 -0
- package/packages/core/buildchain-agent-manuals.js +3 -0
- package/packages/core/buildchain-compatibility-authority.js +336 -0
- package/packages/core/buildchain-compatibility-fact.js +394 -0
- package/packages/core/buildchain-compatibility-facts.json +217 -0
- package/packages/core/buildchain-compatibility-proof.js +566 -0
- package/packages/core/buildchain-config.js +84 -0
- package/packages/core/buildchain-contract.js +96 -143
- package/packages/core/buildchain-delivery-bootstrap.js +240 -0
- package/packages/core/buildchain-delivery-infrastructure.js +164 -0
- package/packages/core/buildchain-delivery-self-dogfood.js +395 -0
- package/packages/core/buildchain-publication-authority.js +1 -0
- package/packages/core/channel-candidate.js +8 -0
- package/packages/core/channel-promotion-baseline.js +55 -0
- package/packages/core/ci-lane-change-budget.js +247 -0
- package/packages/core/dev-alpha-candidate-selection.js +10 -2
- package/packages/core/dev-delivery-authority-candidate.js +270 -0
- package/packages/core/dev-delivery-authority-evidence.js +146 -0
- package/packages/core/dev-delivery-authority-landing.js +461 -0
- package/packages/core/dev-delivery-authority-observation.js +48 -0
- package/packages/core/dev-delivery-authority-qualification.js +591 -0
- package/packages/core/dev-delivery-authority-settlement.js +213 -0
- package/packages/core/dev-delivery-authority-state.js +583 -0
- package/packages/core/dev-delivery-candidate-identity.js +13 -0
- package/packages/core/dev-delivery-contract-surface.js +76 -0
- package/packages/core/dev-delivery-execution-failure.js +133 -0
- package/packages/core/dev-delivery-execution-transfer.js +592 -0
- package/packages/core/dev-delivery-landing-admission-core.js +119 -0
- package/packages/core/dev-delivery-landing-readback.js +598 -0
- package/packages/core/dev-delivery-landing-terminal-evidence.js +271 -0
- package/packages/core/dev-delivery-landing-testing-port.js +6 -0
- package/packages/core/dev-delivery-native-execution.js +110 -0
- package/packages/core/dev-delivery-native-proof.js +562 -0
- package/packages/core/dev-delivery-process-boundary.js +563 -0
- package/packages/core/dev-delivery-provider-attempt.js +127 -0
- package/packages/core/dev-delivery-provider-heartbeat.js +382 -0
- package/packages/core/dev-delivery-warrant-cancellation.js +1 -0
- package/packages/core/dev-delivery-warrant-qualification.js +145 -0
- package/packages/core/dev-delivery-warrant-settlement.js +237 -36
- package/packages/core/dev-delivery-warrant-state.js +587 -0
- package/packages/core/dev-delivery-warrant.js +328 -370
- package/packages/core/github-governance-authority.js +1 -0
- package/packages/core/index.js +5 -0
- package/packages/core/kungfu-temporal-fact.js +557 -0
- package/packages/core/legacy-kfd-adopter-driver.js +167 -0
- package/packages/core/next-development-candidate-reservation.js +186 -0
- package/packages/core/next-development-controller.js +728 -0
- package/packages/core/next-development-projection.js +287 -0
- package/packages/core/next-development-transition.js +738 -0
- package/packages/core/paper-agent-entry.js +11 -5
- package/packages/core/paper.js +16 -5
- package/packages/core/published-delivery-authority.js +266 -0
- package/packages/core/release-candidate-recovery.js +70 -15
- package/packages/core/release-candidate.js +2 -2
- package/packages/core/release-passport.js +36 -9
- package/packages/core/v4-adopter-delivery-parity.js +3 -3
- package/packages/core/v4-adopter-delivery.js +359 -0
- package/packages/core/v4-canonical-contracts.js +5 -0
- package/packages/core/v4-delivery-warrant-read-candidate.js +10 -3
- package/packages/core/v4-floating-consumer-evidence.js +18 -4
- package/packages/core/v4-floating-consumer-policy.js +143 -20
- package/packages/core/v4-floating-consumer-release-passport.js +32 -5
- package/packages/core/v4-publication-rehearsal-capsule.js +468 -0
- package/packages/core/v4-publication-rehearsal-provider-bindings.js +212 -0
- package/packages/core/v4-publication-rehearsal.js +481 -0
- package/packages/core/v4-tail-reseal-contract.js +26 -0
- package/packages/core/v4-tail-reseal-github.js +178 -0
- package/packages/core/v4-tail-reseal-receipt.js +225 -0
- package/packages/core/v4-tail-reseal.js +594 -0
- package/packages/core/workflow-yaml-contract.js +24 -2
- package/scripts/buildchain-cli-help.mjs +41 -2
- package/scripts/check-ci-lane-change-budget.mjs +100 -0
- package/scripts/check-inventory.mjs +14 -3
- package/scripts/check-v4-floating-consumer-policy-contract.mjs +23 -4
- package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
- package/scripts/dev-delivery-authority-command-adapters.mjs +206 -0
- package/scripts/dev-delivery-authority-provider.mjs +28 -0
- package/scripts/dev-delivery-authority.mjs +490 -0
- package/scripts/dev-delivery-native-run.mjs +177 -0
- package/scripts/dev-delivery-process-boundary.mjs +260 -0
- package/scripts/dev-delivery-proof.mjs +67 -2
- package/scripts/dev-delivery-provider-heartbeat.mjs +215 -0
- package/scripts/dev-delivery-source-proof-replay.mjs +153 -0
- package/scripts/dev-delivery-source-proof-reuse.mjs +13 -97
- package/scripts/dev-delivery-two-phase-resume.mjs +345 -0
- package/scripts/dev-delivery-two-phase.mjs +573 -0
- package/scripts/dev-delivery-warrant-options.mjs +266 -0
- package/scripts/dev-delivery-warrant-store.mjs +231 -0
- package/scripts/dev-delivery-warrant.mjs +232 -194
- package/scripts/dev-pr-auto-merge.mjs +1 -1
- package/scripts/dev-pr-delivery-warrant.mjs +11 -0
- package/scripts/dev-qualification-patrol.mjs +9 -9
- package/scripts/dispatch-artifact-signing-authority.mjs +1 -1
- package/scripts/generate-channel-promotion-workflow.mjs +2 -2
- package/scripts/generate-next-development-guidance.mjs +49 -0
- package/scripts/generate-release-candidate-passport.mjs +152 -0
- package/scripts/generate-site-bundle.mjs +69 -4
- package/scripts/init-repo.mjs +22 -4
- package/scripts/next-development-self-dogfood-harness.mjs +460 -0
- package/scripts/next-development-self-dogfood.mjs +597 -0
- package/scripts/next-development-transition.mjs +47 -0
- package/scripts/npm-publish-transaction.mjs +2 -2
- package/scripts/promotion-channel-router.mjs +4 -4
- package/scripts/release-candidate-anchor-provenance.mjs +99 -0
- package/scripts/release-tail.mjs +51 -3
- package/scripts/release-train-self-dogfood.mjs +94 -92
- package/scripts/resume-from-candidate-run.mjs +557 -30
- package/scripts/site-capability-metadata.mjs +41 -0
- package/scripts/stable-candidate-qualification.mjs +9 -10
- package/scripts/v4-consumer-policy.mjs +5 -5
- package/scripts/v4-publication-rehearsal-fixture.mjs +144 -0
- package/scripts/v4-tail-reseal-macos-rehearsal.mjs +134 -0
- package/scripts/v4-tail-reseal.mjs +416 -0
- package/templates/native-dev-delivery.yml +143 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
devDeliveryClone as clone,
|
|
3
|
+
devDeliveryContentRoot,
|
|
4
|
+
devDeliveryExactRoot as exactRoot,
|
|
5
|
+
devDeliveryExactSha as exactSha,
|
|
6
|
+
devDeliveryPositiveInteger as positiveInteger,
|
|
7
|
+
devDeliveryText as text,
|
|
8
|
+
} from "./dev-delivery-common.js";
|
|
9
|
+
|
|
10
|
+
function normalizedFailure(failureInput, transfer) {
|
|
11
|
+
const failure = clone(failureInput || {});
|
|
12
|
+
const evidenceRoot = exactRoot(
|
|
13
|
+
failure.evidenceRoot,
|
|
14
|
+
"native failure evidence root",
|
|
15
|
+
);
|
|
16
|
+
delete failure.evidenceRoot;
|
|
17
|
+
if (devDeliveryContentRoot(failure) !== evidenceRoot) {
|
|
18
|
+
throw new Error("native failure evidence root drift");
|
|
19
|
+
}
|
|
20
|
+
const normalized = {
|
|
21
|
+
schema: "kungfu.buildchain.two-phase-delivery-failure/v1",
|
|
22
|
+
pullRequestNumber: positiveInteger(
|
|
23
|
+
failure.pullRequestNumber,
|
|
24
|
+
"failure pull request number",
|
|
25
|
+
),
|
|
26
|
+
expectedHead: exactSha(failure.expectedHead, "failure expected head"),
|
|
27
|
+
fencingToken: exactRoot(failure.fencingToken, "failure fencing token"),
|
|
28
|
+
leaseGeneration: positiveInteger(
|
|
29
|
+
failure.leaseGeneration,
|
|
30
|
+
"failure lease generation",
|
|
31
|
+
),
|
|
32
|
+
nativeAttempts: Number(failure.nativeAttempts),
|
|
33
|
+
reason: text(failure.reason),
|
|
34
|
+
workerTerminationProven: failure.workerTerminationProven === true,
|
|
35
|
+
};
|
|
36
|
+
if (
|
|
37
|
+
!Number.isInteger(normalized.nativeAttempts) ||
|
|
38
|
+
normalized.nativeAttempts < 0
|
|
39
|
+
) {
|
|
40
|
+
throw new Error("failure nativeAttempts must be a non-negative integer");
|
|
41
|
+
}
|
|
42
|
+
if (JSON.stringify(failure) !== JSON.stringify(normalized)) {
|
|
43
|
+
throw new Error("native failure evidence is not exact canonical content");
|
|
44
|
+
}
|
|
45
|
+
if (
|
|
46
|
+
normalized.pullRequestNumber !== transfer.warrant.pullRequestNumber ||
|
|
47
|
+
normalized.expectedHead !== transfer.warrant.sourceHead ||
|
|
48
|
+
normalized.fencingToken !== transfer.warrant.fencingToken ||
|
|
49
|
+
normalized.leaseGeneration !== transfer.warrant.generation
|
|
50
|
+
) {
|
|
51
|
+
throw new Error("native failure evidence Warrant binding mismatch");
|
|
52
|
+
}
|
|
53
|
+
return { ...normalized, evidenceRoot };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function normalizedFailureSettlement(settlementInput, failure, transfer) {
|
|
57
|
+
const settlement = clone(settlementInput || {});
|
|
58
|
+
const normalized = {
|
|
59
|
+
schema: "kungfu.buildchain.two-phase-provider-settlement-required/v1",
|
|
60
|
+
evidenceRoot: exactRoot(
|
|
61
|
+
settlement.evidenceRoot,
|
|
62
|
+
"provider failure evidence root",
|
|
63
|
+
),
|
|
64
|
+
stateRoot: exactRoot(settlement.stateRoot, "provider failure state root"),
|
|
65
|
+
candidateId: exactRoot(
|
|
66
|
+
settlement.candidateId,
|
|
67
|
+
"provider failure candidate id",
|
|
68
|
+
),
|
|
69
|
+
fencingToken: exactRoot(
|
|
70
|
+
settlement.fencingToken,
|
|
71
|
+
"provider failure fencing token",
|
|
72
|
+
),
|
|
73
|
+
leaseGeneration: positiveInteger(
|
|
74
|
+
settlement.leaseGeneration,
|
|
75
|
+
"provider failure lease generation",
|
|
76
|
+
),
|
|
77
|
+
pullRequestNumber: positiveInteger(
|
|
78
|
+
settlement.pullRequestNumber,
|
|
79
|
+
"provider failure pull request number",
|
|
80
|
+
),
|
|
81
|
+
sourceHead: exactSha(settlement.sourceHead, "provider failure source head"),
|
|
82
|
+
workerTerminationProven: settlement.workerTerminationProven === true,
|
|
83
|
+
nextAction: text(settlement.nextAction),
|
|
84
|
+
};
|
|
85
|
+
if (JSON.stringify(settlement) !== JSON.stringify(normalized)) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
"native failure settlement binding is not exact canonical content",
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (
|
|
91
|
+
normalized.evidenceRoot !== failure.evidenceRoot ||
|
|
92
|
+
normalized.workerTerminationProven !== failure.workerTerminationProven ||
|
|
93
|
+
normalized.stateRoot !== transfer.warrant.stateRoot ||
|
|
94
|
+
normalized.candidateId !== transfer.warrant.candidateId ||
|
|
95
|
+
normalized.fencingToken !== transfer.warrant.fencingToken ||
|
|
96
|
+
normalized.leaseGeneration !== transfer.warrant.generation ||
|
|
97
|
+
normalized.pullRequestNumber !== transfer.warrant.pullRequestNumber ||
|
|
98
|
+
normalized.sourceHead !== transfer.warrant.sourceHead
|
|
99
|
+
) {
|
|
100
|
+
throw new Error("native failure settlement binding mismatch");
|
|
101
|
+
}
|
|
102
|
+
return normalized;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function verifyNativeExecutionFailureOutcome(
|
|
106
|
+
transfer,
|
|
107
|
+
{ readCanonical } = {},
|
|
108
|
+
) {
|
|
109
|
+
if (
|
|
110
|
+
transfer.nativeProofRoot !== null ||
|
|
111
|
+
transfer.nativeReuseDecisionRoot !== null
|
|
112
|
+
) {
|
|
113
|
+
throw new Error("failed native transfer cannot claim proof roots");
|
|
114
|
+
}
|
|
115
|
+
if (typeof readCanonical !== "function") {
|
|
116
|
+
throw new Error("canonical failure artifact reader is required");
|
|
117
|
+
}
|
|
118
|
+
const failure = normalizedFailure(
|
|
119
|
+
readCanonical("failure.json", "native failure evidence"),
|
|
120
|
+
transfer,
|
|
121
|
+
);
|
|
122
|
+
return {
|
|
123
|
+
failure,
|
|
124
|
+
failureSettlement: normalizedFailureSettlement(
|
|
125
|
+
readCanonical(
|
|
126
|
+
"failure-provider-settlement.json",
|
|
127
|
+
"native failure settlement binding",
|
|
128
|
+
),
|
|
129
|
+
failure,
|
|
130
|
+
transfer,
|
|
131
|
+
),
|
|
132
|
+
};
|
|
133
|
+
}
|