@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
package/bin/buildchain.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { runLifecycle } from "../scripts/run-lifecycle-core.mjs";
|
|
|
11
11
|
import { runReleasePropagationCli } from "../scripts/release-propagation.mjs";
|
|
12
12
|
import { runReleaseGovernanceCli } from "../scripts/reconcile-release-governance.mjs";
|
|
13
13
|
import { runReleaseTailCli } from "../scripts/release-tail.mjs";
|
|
14
|
+
import { runV4TailResealCli } from "../scripts/v4-tail-reseal.mjs";
|
|
14
15
|
import { runPublicationArtifactCli } from "../scripts/publication-artifact.mjs";
|
|
15
16
|
import { runPublicationPackageCli } from "../scripts/publication-package.mjs";
|
|
16
17
|
import { runPublicationReproducibilityCli } from "../scripts/publication-reproducibility.mjs";
|
|
@@ -109,6 +110,8 @@ import {
|
|
|
109
110
|
dispatchTrustReleaseCommand,
|
|
110
111
|
} from "./internal/trust-release-cli.mjs";
|
|
111
112
|
import { dispatchRegisteredCommand } from "./internal/command-registry.mjs";
|
|
113
|
+
import { runCompatibilityFactsCli } from "./internal/compatibility-facts-cli.mjs";
|
|
114
|
+
import { runAdopterDeliveryCli } from "./internal/adopter-delivery-cli.mjs";
|
|
112
115
|
|
|
113
116
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
114
117
|
const embeddedPackageVersion = process.env.BUILDCHAIN_EMBEDDED_PACKAGE_VERSION || "";
|
|
@@ -987,6 +990,9 @@ async function runKfdCli(args = []) {
|
|
|
987
990
|
async function runBuildFactsCli(args = []) {
|
|
988
991
|
const [subcommand = "", ...factArgs] = args;
|
|
989
992
|
const cwd = path.resolve(readFlag(factArgs, "cwd", process.cwd()));
|
|
993
|
+
if (subcommand === "compatibility") {
|
|
994
|
+
return runCompatibilityFactsCli({ args: factArgs, cwd, packageRoot: root });
|
|
995
|
+
}
|
|
990
996
|
if (subcommand === "module") {
|
|
991
997
|
const fact = collectModuleBuildFacts({
|
|
992
998
|
cwd,
|
|
@@ -1060,7 +1066,7 @@ async function runBuildFactsCli(args = []) {
|
|
|
1060
1066
|
}
|
|
1061
1067
|
return;
|
|
1062
1068
|
}
|
|
1063
|
-
throw new Error("usage: buildchain facts <module|aggregate|verify> ...");
|
|
1069
|
+
throw new Error("usage: buildchain facts <module|aggregate|verify|compatibility> ...");
|
|
1064
1070
|
}
|
|
1065
1071
|
|
|
1066
1072
|
function appendJsonLine(filePath, value) {
|
|
@@ -1385,12 +1391,20 @@ async function handleDevCommand(args) {
|
|
|
1385
1391
|
runScript("dev-delivery-warrant.mjs", devArgs);
|
|
1386
1392
|
return;
|
|
1387
1393
|
}
|
|
1394
|
+
if (subcommand === "authority") {
|
|
1395
|
+
runScript("dev-delivery-authority.mjs", devArgs);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1388
1398
|
if (subcommand === "proof") {
|
|
1389
1399
|
runScript("dev-delivery-proof.mjs", devArgs);
|
|
1390
1400
|
return;
|
|
1391
1401
|
}
|
|
1402
|
+
if (subcommand === "two-phase") {
|
|
1403
|
+
runScript("dev-delivery-two-phase.mjs", devArgs);
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1392
1406
|
if (subcommand !== "merge-queue") {
|
|
1393
|
-
throw new Error("usage: buildchain dev <pr-admit|merge-queue|warrant|proof> [options]");
|
|
1407
|
+
throw new Error("usage: buildchain dev <pr-admit|merge-queue|warrant|authority|proof|two-phase> [options]");
|
|
1394
1408
|
}
|
|
1395
1409
|
runScript("dev-merge-queue.mjs", devArgs);
|
|
1396
1410
|
return;
|
|
@@ -1662,7 +1676,15 @@ async function handleReleaseGovernanceCommand(args) {
|
|
|
1662
1676
|
}
|
|
1663
1677
|
|
|
1664
1678
|
async function handleReleaseTailCommand(args) {
|
|
1665
|
-
runReleaseTailCli(args);
|
|
1679
|
+
await runReleaseTailCli(args);
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
async function handleTailResealCommand(args) {
|
|
1683
|
+
await runV4TailResealCli(args);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
async function handleNextDevelopmentCommand(args) {
|
|
1687
|
+
runScript("next-development-transition.mjs", args);
|
|
1666
1688
|
}
|
|
1667
1689
|
|
|
1668
1690
|
async function handleGitHubGovernanceCommand(args) {
|
|
@@ -1729,6 +1751,10 @@ async function handleArchitectureCommand(args) {
|
|
|
1729
1751
|
runScript("v4-architecture.mjs", args);
|
|
1730
1752
|
}
|
|
1731
1753
|
|
|
1754
|
+
async function handleAdopterDeliveryCommand(args) {
|
|
1755
|
+
await runAdopterDeliveryCli(args);
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1732
1758
|
const BUILDCHAIN_COMMAND_HANDLERS = Object.freeze({
|
|
1733
1759
|
"help": handleHelpCommand,
|
|
1734
1760
|
"version": handleVersionCommand,
|
|
@@ -1761,12 +1787,15 @@ const BUILDCHAIN_COMMAND_HANDLERS = Object.freeze({
|
|
|
1761
1787
|
"release-propagation": handleReleasePropagationCommand,
|
|
1762
1788
|
"release-governance": handleReleaseGovernanceCommand,
|
|
1763
1789
|
"release-tail": handleReleaseTailCommand,
|
|
1790
|
+
"tail-reseal": handleTailResealCommand,
|
|
1791
|
+
"next-development": handleNextDevelopmentCommand,
|
|
1764
1792
|
"github-governance": handleGitHubGovernanceCommand,
|
|
1765
1793
|
"badges": handleBadgesCommand,
|
|
1766
1794
|
"homebrew": handleHomebrewCommand,
|
|
1767
1795
|
"build-contract": handleBuildContractCommand,
|
|
1768
1796
|
"publish-source": handlePublishSourceCommand,
|
|
1769
1797
|
"architecture": handleArchitectureCommand,
|
|
1798
|
+
"adopter-delivery": handleAdopterDeliveryCommand,
|
|
1770
1799
|
});
|
|
1771
1800
|
|
|
1772
1801
|
async function main(argv = process.argv.slice(2)) {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadV4PublishedAdopterDeliveryAuthority,
|
|
3
|
+
qualifyV4AdopterDeliveryBootstrap,
|
|
4
|
+
runV4AdopterDeliveryGate,
|
|
5
|
+
verifyV4AdopterDeliveryReadback,
|
|
6
|
+
} from "../../packages/core/v4-adopter-delivery.js";
|
|
7
|
+
import {
|
|
8
|
+
printJson,
|
|
9
|
+
readFlag,
|
|
10
|
+
readJsonInput,
|
|
11
|
+
writeJsonFile,
|
|
12
|
+
} from "./cli-options.mjs";
|
|
13
|
+
|
|
14
|
+
function emit(args, value) {
|
|
15
|
+
writeJsonFile(readFlag(args, "output", ""), value);
|
|
16
|
+
printJson(value);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function runAdopterDeliveryCli(args = []) {
|
|
20
|
+
const [subcommand = "", ...commandArgs] = args;
|
|
21
|
+
if (subcommand === "run") {
|
|
22
|
+
const input = readJsonInput(readFlag(commandArgs, "input", ""), {
|
|
23
|
+
label: "adopter delivery input",
|
|
24
|
+
});
|
|
25
|
+
emit(commandArgs, runV4AdopterDeliveryGate(input));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (subcommand === "verify") {
|
|
29
|
+
const input = readJsonInput(readFlag(commandArgs, "input", ""), {
|
|
30
|
+
label: "adopter delivery input",
|
|
31
|
+
});
|
|
32
|
+
const readback = readJsonInput(readFlag(commandArgs, "readback", ""), {
|
|
33
|
+
label: "adopter delivery readback",
|
|
34
|
+
});
|
|
35
|
+
emit(commandArgs, verifyV4AdopterDeliveryReadback({ input, readback }));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (subcommand === "bootstrap") {
|
|
39
|
+
const request = readJsonInput(readFlag(commandArgs, "input", ""), {
|
|
40
|
+
label: "adopter delivery bootstrap input",
|
|
41
|
+
});
|
|
42
|
+
emit(commandArgs, qualifyV4AdopterDeliveryBootstrap(request));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (subcommand === "archive") {
|
|
46
|
+
const request = readJsonInput(readFlag(commandArgs, "input", ""), {
|
|
47
|
+
label: "published archive input",
|
|
48
|
+
});
|
|
49
|
+
const authority = await loadV4PublishedAdopterDeliveryAuthority(request);
|
|
50
|
+
try {
|
|
51
|
+
emit(commandArgs, {
|
|
52
|
+
schemaVersion: authority.schemaVersion,
|
|
53
|
+
contract: authority.contract,
|
|
54
|
+
packages: authority.packages,
|
|
55
|
+
moduleCoordinates: authority.moduleCoordinates,
|
|
56
|
+
authorityRoot: authority.authorityRoot,
|
|
57
|
+
qualifying: authority.qualifying,
|
|
58
|
+
selfCertified: authority.selfCertified,
|
|
59
|
+
releaseAuthorized: authority.releaseAuthorized,
|
|
60
|
+
finalAuthority: authority.finalAuthority,
|
|
61
|
+
});
|
|
62
|
+
} finally {
|
|
63
|
+
await authority.dispose();
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
throw new Error(
|
|
68
|
+
"usage: buildchain adopter-delivery <run|verify|bootstrap|archive> --input <json-or-path> [--readback <json-or-path>] [--output <path>]",
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -33,12 +33,15 @@ const BUILDCHAIN_COMMAND_REGISTRY = Object.freeze([
|
|
|
33
33
|
{ id: "release-propagation", aliases: [] },
|
|
34
34
|
{ id: "release-governance", aliases: [] },
|
|
35
35
|
{ id: "release-tail", aliases: [] },
|
|
36
|
+
{ id: "tail-reseal", aliases: [] },
|
|
37
|
+
{ id: "next-development", aliases: [] },
|
|
36
38
|
{ id: "github-governance", aliases: [] },
|
|
37
39
|
{ id: "badges", aliases: [] },
|
|
38
40
|
{ id: "homebrew", aliases: [] },
|
|
39
41
|
{ id: "build-contract", aliases: [] },
|
|
40
42
|
{ id: "publish-source", aliases: [] },
|
|
41
43
|
{ id: "architecture", aliases: [] },
|
|
44
|
+
{ id: "adopter-delivery", aliases: [] },
|
|
42
45
|
]);
|
|
43
46
|
|
|
44
47
|
function buildCommandLookup(registry = BUILDCHAIN_COMMAND_REGISTRY) {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createBuildchainCompatibilityFactRegistry,
|
|
5
|
+
verifyBuildchainCompatibilityFactRegistry,
|
|
6
|
+
} from "../../packages/core/buildchain-compatibility-fact.js";
|
|
7
|
+
import {
|
|
8
|
+
createBuildchainCompatibilityPathQuery,
|
|
9
|
+
createBuildchainCompatibilityProofRegistry,
|
|
10
|
+
verifyBuildchainCompatibilityPath,
|
|
11
|
+
} from "../../packages/core/buildchain-compatibility-authority.js";
|
|
12
|
+
import { createBuildchainContractWorld } from "../../packages/core/buildchain-contract.js";
|
|
13
|
+
import {
|
|
14
|
+
printJson,
|
|
15
|
+
readBooleanFlag,
|
|
16
|
+
readFlag,
|
|
17
|
+
readJsonInput,
|
|
18
|
+
writeJsonFile,
|
|
19
|
+
} from "./cli-options.mjs";
|
|
20
|
+
|
|
21
|
+
export function runCompatibilityFactsCli({ args, cwd, packageRoot }) {
|
|
22
|
+
const [action = "project", ...factArgs] = args;
|
|
23
|
+
const registryInput = readFlag(factArgs, "registry", "");
|
|
24
|
+
const registry = registryInput
|
|
25
|
+
? readJsonInput(registryInput, {
|
|
26
|
+
cwd,
|
|
27
|
+
label: "compatibility Fact registry",
|
|
28
|
+
})
|
|
29
|
+
: createBuildchainCompatibilityFactRegistry();
|
|
30
|
+
if (action === "project") {
|
|
31
|
+
const world = createBuildchainContractWorld({ root: packageRoot });
|
|
32
|
+
const projection = createBuildchainCompatibilityProofRegistry({
|
|
33
|
+
proofs: registry.legacyProofs,
|
|
34
|
+
surfaces: world.surfaces,
|
|
35
|
+
majorLine: world.majorLine,
|
|
36
|
+
});
|
|
37
|
+
const result = {
|
|
38
|
+
schema: "kungfu.buildchain.compatibility-fact-projection/v1",
|
|
39
|
+
authority: "Fact-registry-only",
|
|
40
|
+
grantsReleaseAuthority: false,
|
|
41
|
+
registry,
|
|
42
|
+
projections: projection.projections,
|
|
43
|
+
};
|
|
44
|
+
const output = readFlag(factArgs, "output", "");
|
|
45
|
+
if (output) writeJsonFile(path.resolve(cwd, output), result);
|
|
46
|
+
if (readBooleanFlag(factArgs, "json") || !output) printJson(result);
|
|
47
|
+
else
|
|
48
|
+
process.stdout.write(
|
|
49
|
+
`buildchain facts compatibility project: wrote ${output}\n`,
|
|
50
|
+
);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (action === "verify") {
|
|
54
|
+
const result = verifyBuildchainCompatibilityFactRegistry(registry);
|
|
55
|
+
printJson(result);
|
|
56
|
+
if (!result.ok) process.exitCode = 1;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (action === "query") {
|
|
60
|
+
const queryInput = readFlag(factArgs, "query", "");
|
|
61
|
+
if (!queryInput) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
"usage: buildchain facts compatibility query --query <json-or-path> [--registry <json-or-path>]",
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
const query = readJsonInput(queryInput, {
|
|
67
|
+
cwd,
|
|
68
|
+
label: "compatibility Fact query",
|
|
69
|
+
});
|
|
70
|
+
const receipt = verifyBuildchainCompatibilityPath({ registry, query });
|
|
71
|
+
printJson(receipt);
|
|
72
|
+
if (receipt.record.status !== "accepted") process.exitCode = 1;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (action === "query-template") {
|
|
76
|
+
const factRoot = readFlag(factArgs, "fact-root", "");
|
|
77
|
+
const fact = registry.facts.find((entry) => entry.factRoot === factRoot);
|
|
78
|
+
if (!fact) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
"buildchain facts compatibility query-template requires a current --fact-root",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
printJson(
|
|
84
|
+
createBuildchainCompatibilityPathQuery({
|
|
85
|
+
registry,
|
|
86
|
+
queryId: readFlag(
|
|
87
|
+
factArgs,
|
|
88
|
+
"query-id",
|
|
89
|
+
`buildchain:compatibility:${fact.factId}`,
|
|
90
|
+
),
|
|
91
|
+
sourceRoot: fact.sourceRoot,
|
|
92
|
+
targetRoot: fact.targetRoot,
|
|
93
|
+
relationPathRoots: [fact.factRoot],
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
throw new Error(
|
|
99
|
+
"usage: buildchain facts compatibility <project|verify|query|query-template> ...",
|
|
100
|
+
);
|
|
101
|
+
}
|