@kungfu-tech/buildchain 3.0.9-alpha.1 → 3.0.9-alpha.10
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/bin/buildchain.mjs +9 -1
- package/contracts/dev-delivery-authority-v2.schema.json +253 -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/next-development-request-v1.schema.json +66 -0
- package/contracts/next-development-transition-v1.schema.json +292 -0
- package/dist/site/agent-index.json +1 -0
- package/dist/site/artifact-schemas.json +2 -0
- package/dist/site/buildchain-contract.json +74 -14
- package/dist/site/buildchain-site.json +334 -36
- package/dist/site/capability-registry.json +7 -6
- package/dist/site/cli-registry.json +41 -2
- package/dist/site/kfd-claims.json +193 -9
- package/dist/site/kfd-upstream-aggregate.json +9 -9
- package/dist/site/manual-registry.json +23 -7
- package/dist/site/node-api-registry.json +7789 -4648
- package/dist/site/page-registry.json +315 -25
- package/dist/site/public-surface-audit.json +353 -8
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-passport-check-manifest.json +1 -0
- package/dist/site/release-provenance.json +12 -0
- package/dist/site/schemas/dev-delivery-authority-v2.schema.json +442 -0
- package/dist/site/schemas/release-passport-v1.schema.json +3 -0
- package/dist/site/site-manifest.json +19 -11
- package/dist/site/workflow-registry.json +15 -7
- package/docs/MAP.md +5 -2
- package/docs/adopter-delivery-gate.md +106 -0
- package/docs/aws-us-elastic-runner-burst-plane.md +30 -3
- package/docs/cli-reference.md +200 -13
- package/docs/dev-alpha-candidate-patrol.md +8 -0
- package/docs/dev-delivery-qualification-landing-adr.md +137 -0
- package/docs/dev-delivery-warrant.md +149 -22
- package/docs/kfd-support.md +7 -2
- package/docs/next-development-transition.md +119 -0
- package/docs/node-api-reference.md +381 -204
- package/docs/release-governance.md +10 -7
- package/docs/release-passport.md +8 -2
- package/docs/versioning.md +4 -1
- package/package.json +21 -6
- package/packages/core/README.md +25 -0
- package/packages/core/adopter-delivery-gate.js +576 -0
- package/packages/core/adopter-delivery-json.js +66 -0
- 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/artifact-verification-envelope.js +5 -5
- package/packages/core/buildchain-agent-manuals.js +1 -0
- package/packages/core/buildchain-channel-identity.js +2 -3
- package/packages/core/buildchain-compatibility-proof.js +22 -0
- package/packages/core/buildchain-delivery-bootstrap.js +240 -0
- package/packages/core/buildchain-delivery-infrastructure.js +164 -0
- package/packages/core/channel-candidate.js +8 -0
- package/packages/core/channel-promotion-baseline.js +52 -0
- package/packages/core/dev-alpha-candidate-selection.js +10 -2
- package/packages/core/dev-delivery-authority.js +996 -0
- package/packages/core/dev-delivery-native-proof.js +418 -0
- package/packages/core/dev-delivery-warrant-settlement.js +67 -20
- package/packages/core/dev-delivery-warrant.js +128 -46
- package/packages/core/kfd-adopter-category-driver.js +167 -0
- package/packages/core/kfd-adopter-manifest.js +49 -50
- 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 +726 -0
- package/packages/core/next-development-projection.js +288 -0
- package/packages/core/next-development-transition.js +738 -0
- package/packages/core/paper-agent-entry.js +7 -4
- package/packages/core/paper.js +14 -7
- package/packages/core/release-passport-contract.js +10 -6
- package/packages/core/release-passport.js +29 -12
- package/scripts/aws-macos-jit-controller-core.mjs +239 -4
- package/scripts/aws-macos-jit-controller.mjs +198 -2
- package/scripts/aws-macos-jit-instance-rehydrate.mjs +260 -0
- package/scripts/aws-macos-jit-source-rebind.mjs +235 -14
- package/scripts/aws-macos-jit.mjs +12 -0
- package/scripts/buildchain-cli-help.mjs +9 -2
- package/scripts/check-internal-architecture.mjs +1 -0
- package/scripts/check-inventory.mjs +12 -1
- package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
- package/scripts/dev-delivery-authority.mjs +368 -0
- package/scripts/dev-delivery-native-run.mjs +235 -0
- package/scripts/dev-delivery-proof.mjs +64 -2
- package/scripts/dev-delivery-two-phase-resume.mjs +90 -0
- package/scripts/dev-delivery-two-phase.mjs +577 -0
- package/scripts/dev-delivery-warrant.mjs +47 -5
- package/scripts/dev-pr-delivery-warrant.mjs +19 -14
- package/scripts/generate-buildchain-kfd-witnesses.mjs +2 -2
- package/scripts/generate-channel-build-workflow.mjs +4 -0
- package/scripts/generate-next-development-guidance.mjs +49 -0
- package/scripts/generate-site-bundle.mjs +8 -3
- package/scripts/init-repo.mjs +135 -62
- package/scripts/next-development-self-dogfood-harness.mjs +409 -0
- package/scripts/next-development-self-dogfood.mjs +532 -0
- package/scripts/next-development-transition.mjs +47 -0
- package/scripts/release-candidate-tail-reseal.mjs +426 -0
- package/scripts/seal-artifact-signing-requests.mjs +7 -4
- package/scripts/site-capability-metadata.mjs +23 -1
- package/scripts/stable-candidate-qualification.mjs +7 -7
- package/scripts/workflow-call-contract.mjs +1 -1
- package/templates/native-dev-delivery.yml +86 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { classifyDevDeliveryDelta, createIntegrationDeliveryProof, createProjectCutReplayPlan, createProjectCutReplayProof, createSourceQualificationProof, verifyIntegrationDeliveryProof, verifyProjectCutReplayProof, verifySourceQualificationProof } from "../packages/core/dev-delivery-warrant.js";
|
|
4
|
+
import { classifyDevDeliveryDelta, createIntegrationDeliveryProof, createNativeProofReuseDecision, createNativeQualificationProof, createProjectCutReplayPlan, createProjectCutReplayProof, createSourceQualificationProof, verifyIntegrationDeliveryProof, verifyNativeProofReuseDecision, verifyNativeQualificationProof, verifyProjectCutReplayProof, verifySourceQualificationProof } from "../packages/core/dev-delivery-warrant.js";
|
|
5
5
|
|
|
6
6
|
function flag(args, name, fallback = "") {
|
|
7
7
|
const index = args.indexOf(`--${name}`);
|
|
@@ -49,9 +49,11 @@ export function devDeliveryProofCliOptions(args = [], environment = process.env)
|
|
|
49
49
|
closureRoot: flag(rest, "closure-root", environment.BUILDCHAIN_DEV_DELIVERY_CLOSURE_ROOT),
|
|
50
50
|
dependencyRoot: flag(rest, "dependency-root", environment.BUILDCHAIN_DEV_DELIVERY_DEPENDENCY_ROOT),
|
|
51
51
|
toolchainRoot: flag(rest, "toolchain-root", environment.BUILDCHAIN_DEV_DELIVERY_TOOLCHAIN_ROOT),
|
|
52
|
+
environmentRoot: flag(rest, "environment-root", environment.BUILDCHAIN_DEV_DELIVERY_ENVIRONMENT_ROOT),
|
|
52
53
|
affectedPaths: flag(rest, "affected-paths-json", environment.BUILDCHAIN_DEV_DELIVERY_AFFECTED_PATHS || "[]"),
|
|
53
54
|
shardEvidenceRoots: flag(rest, "shard-evidence-roots-json", environment.BUILDCHAIN_DEV_DELIVERY_SHARD_EVIDENCE_ROOTS || "[]"),
|
|
54
55
|
qualifiedAt: flag(rest, "qualified-at", environment.BUILDCHAIN_DEV_DELIVERY_QUALIFIED_AT),
|
|
56
|
+
qualifiedBase: flag(rest, "qualified-base", environment.BUILDCHAIN_DEV_DELIVERY_QUALIFIED_BASE),
|
|
55
57
|
sourceProofPath: flag(rest, "source-proof", environment.BUILDCHAIN_DEV_DELIVERY_SOURCE_PROOF),
|
|
56
58
|
sourceProofRoot: flag(rest, "source-proof-root", environment.BUILDCHAIN_DEV_DELIVERY_SOURCE_PROOF_ROOT),
|
|
57
59
|
warrantResultPath: flag(rest, "warrant-result", environment.BUILDCHAIN_DEV_DELIVERY_WARRANT_RESULT),
|
|
@@ -66,6 +68,8 @@ export function devDeliveryProofCliOptions(args = [], environment = process.env)
|
|
|
66
68
|
pullRequestNumber: flag(rest, "pull-request", environment.BUILDCHAIN_DEV_DELIVERY_PR_NUMBER),
|
|
67
69
|
changedPaths: flag(rest, "changed-paths-json", environment.BUILDCHAIN_DEV_DELIVERY_CHANGED_PATHS || "[]"),
|
|
68
70
|
graphKnown: boolean(flag(rest, "graph-known", environment.BUILDCHAIN_DEV_DELIVERY_GRAPH_KNOWN), false),
|
|
71
|
+
attributionComplete: boolean(flag(rest, "attribution-complete", environment.BUILDCHAIN_DEV_DELIVERY_ATTRIBUTION_COMPLETE), false),
|
|
72
|
+
renames: flag(rest, "renames-json", environment.BUILDCHAIN_DEV_DELIVERY_RENAMES || "[]"),
|
|
69
73
|
outputPath: flag(rest, "output", environment.BUILDCHAIN_DEV_DELIVERY_PROOF_OUTPUT || ".buildchain/dev-delivery/proof.json"),
|
|
70
74
|
json: hasFlag(rest, "json"),
|
|
71
75
|
};
|
|
@@ -117,6 +121,64 @@ export function runDevDeliveryProofCommand(options) {
|
|
|
117
121
|
},
|
|
118
122
|
});
|
|
119
123
|
}
|
|
124
|
+
if (options.command === "native") {
|
|
125
|
+
return createNativeQualificationProof({
|
|
126
|
+
repository: options.repository,
|
|
127
|
+
protectedBase: options.protectedBase,
|
|
128
|
+
sourceIdentityRoot: options.sourceIdentityRoot,
|
|
129
|
+
sourcePatchRoot: options.sourcePatchRoot,
|
|
130
|
+
planRoot: options.planRoot,
|
|
131
|
+
closureRoot: options.closureRoot,
|
|
132
|
+
dependencyRoot: options.dependencyRoot,
|
|
133
|
+
toolchainRoot: options.toolchainRoot,
|
|
134
|
+
environmentRoot: options.environmentRoot,
|
|
135
|
+
qualifiedBase: options.qualifiedBase,
|
|
136
|
+
affectedPaths: jsonList(options.affectedPaths, "affected paths"),
|
|
137
|
+
shardEvidenceRoots: jsonList(options.shardEvidenceRoots, "shard evidence roots", { required: true }),
|
|
138
|
+
qualifiedAt: options.qualifiedAt,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (options.command === "verify-native") {
|
|
142
|
+
return verifyNativeQualificationProof(jsonFile(options.sourceProofPath, "native proof"));
|
|
143
|
+
}
|
|
144
|
+
if (options.command === "classify-native") {
|
|
145
|
+
return createNativeProofReuseDecision({
|
|
146
|
+
proof: jsonFile(options.sourceProofPath, "native proof"),
|
|
147
|
+
current: {
|
|
148
|
+
sourceIdentityRoot: options.sourceIdentityRoot,
|
|
149
|
+
sourcePatchRoot: options.sourcePatchRoot,
|
|
150
|
+
planRoot: options.planRoot,
|
|
151
|
+
closureRoot: options.closureRoot,
|
|
152
|
+
dependencyRoot: options.dependencyRoot,
|
|
153
|
+
toolchainRoot: options.toolchainRoot,
|
|
154
|
+
environmentRoot: options.environmentRoot,
|
|
155
|
+
currentBase: options.currentBase,
|
|
156
|
+
graphKnown: options.graphKnown,
|
|
157
|
+
attributionComplete: options.attributionComplete,
|
|
158
|
+
changedPaths: jsonList(options.changedPaths, "changed paths"),
|
|
159
|
+
renames: jsonList(options.renames, "renames"),
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (options.command === "verify-native-reuse") {
|
|
164
|
+
return verifyNativeProofReuseDecision(jsonFile(options.qualificationReceiptPath, "native reuse decision"), {
|
|
165
|
+
proof: jsonFile(options.sourceProofPath, "native proof"),
|
|
166
|
+
current: {
|
|
167
|
+
sourceIdentityRoot: options.sourceIdentityRoot,
|
|
168
|
+
sourcePatchRoot: options.sourcePatchRoot,
|
|
169
|
+
planRoot: options.planRoot,
|
|
170
|
+
closureRoot: options.closureRoot,
|
|
171
|
+
dependencyRoot: options.dependencyRoot,
|
|
172
|
+
toolchainRoot: options.toolchainRoot,
|
|
173
|
+
environmentRoot: options.environmentRoot,
|
|
174
|
+
currentBase: options.currentBase,
|
|
175
|
+
graphKnown: options.graphKnown,
|
|
176
|
+
attributionComplete: options.attributionComplete,
|
|
177
|
+
changedPaths: jsonList(options.changedPaths, "changed paths"),
|
|
178
|
+
renames: jsonList(options.renames, "renames"),
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
}
|
|
120
182
|
if (options.command === "replay") {
|
|
121
183
|
return createProjectCutReplayPlan({
|
|
122
184
|
repository: options.repository,
|
|
@@ -168,7 +230,7 @@ export function runDevDeliveryProofCommand(options) {
|
|
|
168
230
|
}
|
|
169
231
|
|
|
170
232
|
function usage() {
|
|
171
|
-
return "Usage:\n buildchain dev proof <source|verify-source|classify|replay|replay-proof|verify-replay|integration|verify-integration> [options] [--output FILE] [--json]\n";
|
|
233
|
+
return "Usage:\n buildchain dev proof <source|verify-source|classify|native|verify-native|classify-native|verify-native-reuse|replay|replay-proof|verify-replay|integration|verify-integration> [options] [--output FILE] [--json]\n";
|
|
172
234
|
}
|
|
173
235
|
|
|
174
236
|
async function main() {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { createNativeProofReuseDecision } from "../packages/core/dev-delivery-warrant.js";
|
|
2
|
+
|
|
3
|
+
const ROOT_PATTERN = /^sha256:[0-9a-f]{64}$/u;
|
|
4
|
+
|
|
5
|
+
export function attributedGitHubBaseDelta(data, previousBase) {
|
|
6
|
+
const files = Array.isArray(data?.files) ? data.files : [];
|
|
7
|
+
const graphKnown =
|
|
8
|
+
data?.status === "ahead" &&
|
|
9
|
+
data?.merge_base_commit?.sha === previousBase &&
|
|
10
|
+
files.length < 300;
|
|
11
|
+
const renames = files
|
|
12
|
+
.filter((entry) => entry.status === "renamed")
|
|
13
|
+
.map((entry) => ({
|
|
14
|
+
from: String(entry.previous_filename || ""),
|
|
15
|
+
to: String(entry.filename || ""),
|
|
16
|
+
}));
|
|
17
|
+
const attributionComplete =
|
|
18
|
+
graphKnown && renames.every((entry) => entry.from && entry.to);
|
|
19
|
+
return {
|
|
20
|
+
graphKnown,
|
|
21
|
+
attributionComplete,
|
|
22
|
+
changedPaths: attributionComplete
|
|
23
|
+
? [
|
|
24
|
+
...new Set(
|
|
25
|
+
files
|
|
26
|
+
.flatMap((entry) => [
|
|
27
|
+
String(entry.filename || ""),
|
|
28
|
+
String(entry.previous_filename || ""),
|
|
29
|
+
])
|
|
30
|
+
.filter(Boolean),
|
|
31
|
+
),
|
|
32
|
+
].sort()
|
|
33
|
+
: [],
|
|
34
|
+
renames: attributionComplete ? renames : [],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function replayQualifiedNativeWarrant({
|
|
39
|
+
warrant,
|
|
40
|
+
pullRequestNumber,
|
|
41
|
+
expectedHead,
|
|
42
|
+
exactPullRequestHead,
|
|
43
|
+
}) {
|
|
44
|
+
if (warrant.phase !== "qualified") return null;
|
|
45
|
+
if (
|
|
46
|
+
!ROOT_PATTERN.test(warrant.nativeProofRoot || "") ||
|
|
47
|
+
!ROOT_PATTERN.test(warrant.nativeProofReuseRoot || "")
|
|
48
|
+
) {
|
|
49
|
+
throw new Error("qualified Warrant is missing rooted native evidence");
|
|
50
|
+
}
|
|
51
|
+
await exactPullRequestHead(pullRequestNumber, expectedHead);
|
|
52
|
+
return {
|
|
53
|
+
schema: "kungfu.buildchain.two-phase-delivery-result/v1",
|
|
54
|
+
ok: true,
|
|
55
|
+
outcome: "already-qualified-warrant",
|
|
56
|
+
nativeAttempts: 0,
|
|
57
|
+
nativeProofRoot: warrant.nativeProofRoot,
|
|
58
|
+
nativeReuseDecisionRoot: warrant.nativeProofReuseRoot,
|
|
59
|
+
qualificationReceiptRoot: null,
|
|
60
|
+
landingAuthority: false,
|
|
61
|
+
qualifiedWarrant: warrant,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function classifyNativeProofAgainstCurrent(
|
|
66
|
+
proof,
|
|
67
|
+
options,
|
|
68
|
+
client,
|
|
69
|
+
) {
|
|
70
|
+
const currentBase = await client.baseSha(options.branch);
|
|
71
|
+
const delta = await client.baseDelta(proof.qualifiedBase, currentBase);
|
|
72
|
+
const current = {
|
|
73
|
+
sourceIdentityRoot: options.sourceIdentityRoot,
|
|
74
|
+
sourcePatchRoot: options.sourcePatchRoot,
|
|
75
|
+
planRoot: options.planRoot,
|
|
76
|
+
closureRoot: options.closureRoot,
|
|
77
|
+
dependencyRoot: options.dependencyRoot,
|
|
78
|
+
toolchainRoot: options.toolchainRoot,
|
|
79
|
+
environmentRoot: options.environmentRoot,
|
|
80
|
+
currentBase,
|
|
81
|
+
graphKnown: delta.graphKnown,
|
|
82
|
+
attributionComplete: delta.attributionComplete,
|
|
83
|
+
changedPaths: delta.changedPaths,
|
|
84
|
+
renames: delta.renames,
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
current,
|
|
88
|
+
decision: createNativeProofReuseDecision({ proof, current }),
|
|
89
|
+
};
|
|
90
|
+
}
|