@kungfu-tech/buildchain 4.1.3-alpha.9 → 4.1.4-alpha.0
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/AGENTS.md +11 -13
- package/CONTRIBUTING.md +32 -9
- package/README.md +56 -140
- package/actions/release/promotion/ref/README.md +1 -1
- package/architecture/action-taxonomy.json +1 -1
- package/architecture/agent-change-map.md +32 -45
- package/architecture/build-orchestration.json +1 -1
- package/architecture/capability-state-machine-manifest.json +5 -5
- package/architecture/ci-lane-change-budget.json +92 -92
- package/architecture/code-layout.json +2 -12
- package/architecture/core-mechanisms.json +38 -39
- package/architecture/cross-platform-adopter-qualification.json +1 -1
- package/architecture/dev-delivery-orchestration.json +2 -2
- package/architecture/floating-consumer-policy.json +3 -3
- package/architecture/internal-capabilities.json +27 -28
- package/architecture/maintainability-debt.json +60 -94
- package/architecture/maintainability-policy.json +7 -13
- package/architecture/minimal-consumer-migration.json +43 -5014
- package/architecture/platform-stage-checkpoints.json +1 -1
- package/architecture/release-tail-contract.json +2 -2
- package/architecture/release-topology.json +33 -25
- package/architecture/stage-capsule-qualification.json +1 -1
- package/architecture/universal-workflow-bootstrap.json +60 -60
- package/architecture/universal-workflow-capability-policy.json +3 -3
- package/architecture/universal-workflow-fault-campaign.json +7 -7
- package/architecture/workflow-taxonomy.json +59 -60
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/dist/site/buildchain-contract.json +138 -66
- package/dist/site/buildchain-site.json +257 -331
- package/dist/site/capability-registry.json +4 -4
- package/dist/site/cli-registry.json +6 -142
- package/dist/site/controller-registry.json +19 -19
- package/dist/site/kfd-claims.json +481 -529
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +22 -22
- package/dist/site/node-api-registry.json +82 -339
- package/dist/site/page-registry.json +229 -304
- package/dist/site/public-surface-audit.json +544 -754
- package/dist/site/publication-authority-registry.json +316 -316
- package/dist/site/publication-registry.json +1 -1
- package/dist/site/site-manifest.json +23 -23
- package/dist/site/workflow-registry.json +1071 -1027
- package/docs/MAP.md +28 -20
- package/docs/auditable-demo.md +17 -49
- package/docs/bootstrap-recovery.md +46 -37
- package/docs/cli-reference.md +2 -46
- package/docs/cli.md +97 -186
- package/docs/code-organization.md +7 -5
- package/docs/dev-alpha-candidate-patrol.md +19 -42
- package/docs/dev-delivery-orchestration.md +15 -11
- package/docs/dev-delivery-qualification-landing-adr.md +10 -9
- package/docs/dev-delivery-warrant.md +17 -16
- package/docs/dev-qualification-patrol.md +25 -20
- package/docs/getting-started.md +80 -139
- package/docs/github-artifact-attestation.md +31 -81
- package/docs/install.md +66 -30
- package/docs/lifecycle-protocol.md +19 -57
- package/docs/migration-inventory.md +17 -45
- package/docs/next-development-transition.md +13 -13
- package/docs/node-api-reference.md +122 -138
- package/docs/oci-publication.md +13 -10
- package/docs/publication-artifacts.md +128 -486
- package/docs/publication-authority.md +15 -45
- package/docs/publish-transaction.md +13 -11
- package/docs/release-candidate.md +126 -355
- package/docs/release-discussions.md +36 -67
- package/docs/release-flow.md +80 -339
- package/docs/release-governance.md +114 -962
- package/docs/release-promotion-request.md +45 -43
- package/docs/release-propagation.md +13 -27
- package/docs/release-tail-provider-plane.md +38 -65
- package/docs/reusable-build-surface.md +78 -196
- package/docs/runtime-train-validation.md +8 -6
- package/docs/stable-candidate-patrol.md +13 -66
- package/docs/v4-adopter-delivery.md +15 -15
- package/docs/v4-declarative-release-tail-migration.md +19 -17
- package/docs/v4-production-release.md +11 -6
- package/docs/v4-publication-rehearsal.md +12 -27
- package/docs/v4-stage-capsule.md +14 -20
- package/docs/v4-tail-reseal.md +34 -20
- package/docs/web-surface-deployments.md +26 -264
- package/docs/workflow-catalog.md +31 -31
- package/docs/workflow-path-migration.md +10 -4
- package/package.json +5 -4
- package/packages/core/adoption/buildchain-kfd-claims.js +7 -7
- package/packages/core/adoption/cli/output.mjs +1 -9
- package/packages/core/adoption/cli/product-gate.mjs +1 -15
- package/packages/core/adoption/cli/project.mjs +9 -10
- package/packages/core/adoption/cli/standards.mjs +1 -14
- package/packages/core/adoption/cli/support.mjs +0 -2
- package/packages/core/adoption/cli/surface-register.mjs +0 -2
- package/packages/core/adoption/commands/init-repo.mjs +77 -485
- package/packages/core/adoption/consumer-init.js +279 -0
- package/packages/core/adoption/qualification/admission.js +1 -1
- package/packages/core/build/cli/cache.mjs +0 -2
- package/packages/core/build/cli/facts.mjs +0 -3
- package/packages/core/build/cli/homebrew.mjs +0 -4
- package/packages/core/build/cli/lifecycle.mjs +0 -3
- package/packages/core/build/github-artifact-attestation.js +2 -2
- package/packages/core/build/platform-stage-checkpoints.js +1 -1
- package/packages/core/build/signing/dispatch.js +1 -1
- package/packages/core/consumer/buildchain-config.js +9 -0
- package/packages/core/consumer/contract/inspection.js +351 -9
- package/packages/core/consumer/contract/javascript-syntax.js +439 -0
- package/packages/core/consumer/contract/javascript-values.js +61 -0
- package/packages/core/consumer/contract/javascript.js +555 -0
- package/packages/core/consumer/contract/local-validation.js +84 -0
- package/packages/core/contracts/buildchain-contract.js +39 -8
- package/packages/core/contracts/cli/introspection.mjs +1 -9
- package/packages/core/contracts/public-surface-cli.js +0 -1
- package/packages/core/dev-delivery/dev-delivery-contract-surface.js +2 -2
- package/packages/core/governance/buildchain-publication-authority.js +24 -24
- package/packages/core/governance/cli/doctor.mjs +58 -42
- package/packages/core/governance/commands/architecture.mjs +6 -1
- package/packages/core/governance/commands/audit-publication-control-plane.mjs +1 -1
- package/packages/core/governance/commands/workflow-friction-report.mjs +1 -1
- package/packages/core/governance/github-governance-authority.js +2 -2
- package/packages/core/governance/publication/collection.js +1 -1
- package/packages/core/index.js +1 -3
- package/packages/core/observability/cli/candidate.mjs +0 -2
- package/packages/core/observability/cli/context.mjs +0 -5
- package/packages/core/observability/cli/diagnostics.mjs +0 -7
- package/packages/core/observability/cli/events.mjs +2 -10
- package/packages/core/paper/commands/paper-work-fleet-cli.mjs +1 -1
- package/packages/core/paper/commands/paper.mjs +33 -422
- package/packages/core/paper/consumer-status.js +72 -0
- package/packages/core/paper/operations/identity.js +0 -3
- package/packages/core/paper/operations/migration.js +460 -0
- package/packages/core/paper/operations/preflight-checks.js +8 -68
- package/packages/core/paper/operations/scaffold.js +16 -326
- package/packages/core/paper/operations/status.js +27 -53
- package/packages/core/paper/paper-agent-entry.js +36 -147
- package/packages/core/paper/paper-fleet.js +24 -39
- package/packages/core/paper/paper-repository.js +16 -0
- package/packages/core/paper/paper-runtime-channels.js +1 -1
- package/packages/core/paper/paper-scaffold-content.js +153 -162
- package/packages/core/paper/paper-work.js +3 -10
- package/packages/core/paper/paper.js +43 -5
- package/packages/core/providers/github/artifact-attestation.js +1 -1
- package/packages/core/providers/github/pipeline-context-artifacts.js +172 -0
- package/packages/core/providers/github/pipeline-release-evidence.js +17 -98
- package/packages/core/providers/github/pipeline-stable-baseline.js +86 -0
- package/packages/core/providers/github/pipeline-stable-source.js +22 -4
- package/packages/core/providers/github/release-evidence-assets.js +97 -0
- package/packages/core/publication/authority/control-plane.js +2 -2
- package/packages/core/publication/authority/seal.js +1 -1
- package/packages/core/publication/cli/dispatch.mjs +1 -12
- package/packages/core/publication/pipeline/actions.js +16 -9
- package/packages/core/publication/pipeline/apply.js +17 -9
- package/packages/core/publication/pipeline/context.js +29 -0
- package/packages/core/publication/pipeline/journal.js +13 -1
- package/packages/core/publication/pipeline/prepare.js +15 -6
- package/packages/core/publication/pipeline/recovery-import.js +1 -1
- package/packages/core/publication/pipeline/recovery-materials.js +63 -1
- package/packages/core/publication/pipeline/recovery-prepare.js +21 -9
- package/packages/core/publication/pipeline/stable-entry.js +12 -3
- package/packages/core/publication/pipeline/stable-products.js +21 -19
- package/packages/core/publication/pipeline/version-actions.js +15 -6
- package/packages/core/publication/publication-rehearsal-projection.js +0 -9
- package/packages/core/release/cli/dispatch.mjs +1 -4
- package/packages/core/release/cli/inspection-handlers.mjs +1 -33
- package/packages/core/release/cli/release-handlers.mjs +2 -19
- package/packages/core/release/cli/verification-handlers.mjs +4 -25
- package/packages/core/release/next-development-projection.js +13 -13
- package/packages/core/release/passport/locations.js +13 -8
- package/packages/core/release/release-passport.js +70 -5
- package/packages/core/web/cli/badges.mjs +0 -4
- package/packages/core/web/publication-admission.js +1 -1
- package/packages/core/web/publication-capability.js +1 -1
- package/packages/core/web/readme-badges.js +1 -1
- package/packages/core/workflow/cli/main.mjs +1 -4
- package/packages/core/workflow/cli/process.mjs +1 -1
- package/packages/core/workflow/commands/buildchain-cli-help.mjs +2 -8
- package/packages/core/workflow/engine/conformance.js +1 -1
- package/packages/core/workflow/pipeline/build.js +21 -1
- package/packages/core/workflow/pipeline/delivery-observation.js +6 -2
- package/packages/core/workflow/workflow-taxonomy.mjs +61 -17
- package/scripts/check-code-layout.mjs +2 -0
- package/scripts/check-core-mechanism-inventory.mjs +29 -13
- package/scripts/check-floating-consumer-policy-contract.mjs +3 -3
- package/scripts/check-inventory.mjs +27 -27
- package/scripts/check-maintainability.mjs +28 -5
- package/scripts/check-public-dogfood-contract.mjs +3 -3
- package/scripts/check-release-topology.mjs +1 -1
- package/scripts/check-self-consumer-contract.mjs +7 -7
- package/scripts/check-universal-workflow-bootstrap.mjs +1 -1
- package/scripts/generate-channel-promotion-workflow.mjs +1 -1
- package/scripts/generate-minimal-consumer-contract.mjs +21 -1
- package/scripts/generate-site-bundle.mjs +2 -1
- package/scripts/generate-tail-reseal-fixture.mjs +3 -3
- package/scripts/inventory/promotion.mjs +1 -1
- package/scripts/next-development-self-dogfood-harness.mjs +1 -1
- package/scripts/next-development-self-dogfood.mjs +4 -4
- package/scripts/site-capability-metadata.mjs +2 -6
- package/scripts/source-metric-lineage.mjs +62 -7
- package/scripts/verify-golden-path.mjs +31 -35
- package/templates/native-dev-delivery.yml +1 -1
- package/templates/universal-buildchain-bootstrap.yml +1 -1
- package/packages/core/paper/operations/bootstrap.js +0 -75
- package/packages/core/paper/operations/plans.js +0 -213
- package/packages/core/paper/operations/provisioning.js +0 -113
- package/packages/core/paper/operations/scaffold-config.js +0 -77
- package/packages/core/paper/operations/scaffold-workflows.js +0 -116
- package/packages/core/paper/operations/workspace.js +0 -60
- package/packages/core/paper/paper-npm-bootstrap.js +0 -492
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { readNpmPackResult } from "../../publication/npm/pack-result.js";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import { jsonText, extractUrls, safeParseJson, toPosix } from "./files.js";
|
|
5
|
-
import {
|
|
6
|
-
NPM_REGISTRY,
|
|
7
|
-
DEFAULT_BOOTSTRAP_VERSION,
|
|
8
|
-
PAPER_NPM_BOOTSTRAP_CONTRACT,
|
|
9
|
-
} from "./identity.js";
|
|
10
|
-
import { executePaperNpmBootstrap as executePaperNpmBootstrapOperation } from "../paper-npm-bootstrap.js";
|
|
11
|
-
import {
|
|
12
|
-
PAPER_PATHS,
|
|
13
|
-
commandResult,
|
|
14
|
-
normalizeRepository,
|
|
15
|
-
paperConfig,
|
|
16
|
-
resolvePaperRepository,
|
|
17
|
-
} from "../paper-repository.js";
|
|
18
|
-
import os from "node:os";
|
|
19
|
-
import {
|
|
20
|
-
expectedPaperTrustedPublisher,
|
|
21
|
-
validatePaperProvisioningAuthority,
|
|
22
|
-
} from "./provisioning-validation.js";
|
|
23
|
-
import {
|
|
24
|
-
liveNpmAuthObservation,
|
|
25
|
-
liveNpmPackageObservation,
|
|
26
|
-
liveNpmTrustObservation,
|
|
27
|
-
} from "./npm-observation.js";
|
|
28
|
-
import { normalizePackageName } from "./runtime.js";
|
|
29
|
-
export function writePaperReceipt(cwd, relativePath, value) {
|
|
30
|
-
const target = path.resolve(cwd, relativePath);
|
|
31
|
-
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
32
|
-
fs.writeFileSync(target, jsonText(value));
|
|
33
|
-
return relativePath;
|
|
34
|
-
}
|
|
35
|
-
export function bootstrapPackageShape({ packageName, version }) {
|
|
36
|
-
return {
|
|
37
|
-
name: packageName,
|
|
38
|
-
version,
|
|
39
|
-
private: false,
|
|
40
|
-
license: "Apache-2.0",
|
|
41
|
-
description: "Bootstrap package for npm Trusted Publishing setup.",
|
|
42
|
-
publishConfig: {
|
|
43
|
-
access: "public",
|
|
44
|
-
registry: NPM_REGISTRY,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export function executePaperNpmBootstrap(options = {}) {
|
|
49
|
-
return executePaperNpmBootstrapOperation(options, {
|
|
50
|
-
DEFAULT_BOOTSTRAP_VERSION,
|
|
51
|
-
NPM_REGISTRY,
|
|
52
|
-
PAPER_NPM_BOOTSTRAP_CONTRACT,
|
|
53
|
-
PAPER_PATHS,
|
|
54
|
-
bootstrapPackageShape,
|
|
55
|
-
commandResult,
|
|
56
|
-
expectedPaperTrustedPublisher,
|
|
57
|
-
extractUrls,
|
|
58
|
-
fs,
|
|
59
|
-
jsonText,
|
|
60
|
-
liveNpmAuthObservation,
|
|
61
|
-
liveNpmPackageObservation,
|
|
62
|
-
liveNpmTrustObservation,
|
|
63
|
-
normalizePackageName,
|
|
64
|
-
normalizeRepository,
|
|
65
|
-
os,
|
|
66
|
-
paperConfig,
|
|
67
|
-
path,
|
|
68
|
-
resolvePaperRepository,
|
|
69
|
-
safeParseJson,
|
|
70
|
-
readNpmPackResult,
|
|
71
|
-
toPosix,
|
|
72
|
-
validatePaperProvisioningAuthority,
|
|
73
|
-
writePaperReceipt,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
paperConfig,
|
|
4
|
-
gitValue,
|
|
5
|
-
PAPER_PATHS,
|
|
6
|
-
parsePaperVersion,
|
|
7
|
-
resolvePaperRepository,
|
|
8
|
-
} from "../paper-repository.js";
|
|
9
|
-
import {
|
|
10
|
-
PAPER_BUILD_PLAN_CONTRACT,
|
|
11
|
-
GIT_SHA_PATTERN,
|
|
12
|
-
PAPER_ALPHA_PLAN_CONTRACT,
|
|
13
|
-
PAPER_RESUME_PLAN_CONTRACT,
|
|
14
|
-
} from "./identity.js";
|
|
15
|
-
import { collectPaperStatus } from "./status.js";
|
|
16
|
-
export function createPaperBuildPlan({
|
|
17
|
-
cwd = process.cwd(),
|
|
18
|
-
sourceSha = "",
|
|
19
|
-
pullToolchain = true,
|
|
20
|
-
} = {}) {
|
|
21
|
-
const resolvedCwd = path.resolve(cwd);
|
|
22
|
-
const configResult = paperConfig(resolvedCwd);
|
|
23
|
-
if (configResult.error) throw new Error(configResult.error);
|
|
24
|
-
const resolvedSha = sourceSha || gitValue(resolvedCwd, ["rev-parse", "HEAD"]);
|
|
25
|
-
return {
|
|
26
|
-
schemaVersion: 1,
|
|
27
|
-
contract: PAPER_BUILD_PLAN_CONTRACT,
|
|
28
|
-
ok: GIT_SHA_PATTERN.test(resolvedSha),
|
|
29
|
-
cwd: resolvedCwd,
|
|
30
|
-
dryRun: true,
|
|
31
|
-
sourceSha: resolvedSha,
|
|
32
|
-
toolchain: configResult.loaded.config.publication.toolchain,
|
|
33
|
-
pullToolchain,
|
|
34
|
-
output: PAPER_PATHS.reproducibilityReceipt,
|
|
35
|
-
promotion: "first-byte-identical-clean-build",
|
|
36
|
-
delegatesTo: "buildchain publication-artifact reproducibility --promote",
|
|
37
|
-
nextActions: [
|
|
38
|
-
{
|
|
39
|
-
id: "execute-build",
|
|
40
|
-
command: "buildchain paper build --execute --json",
|
|
41
|
-
description:
|
|
42
|
-
"Run two independent clean builds and promote only byte-identical qualifying outputs.",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export function resolvePaperChannelRef(cwd, ref) {
|
|
48
|
-
const candidates = [
|
|
49
|
-
{
|
|
50
|
-
observedRef: `refs/remotes/origin/${ref}`,
|
|
51
|
-
observation: "origin-tracking-ref",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
observedRef: `refs/heads/${ref}`,
|
|
55
|
-
observation: "local-branch-ref",
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
for (const candidate of candidates) {
|
|
59
|
-
const sha = gitValue(cwd, [
|
|
60
|
-
"rev-parse",
|
|
61
|
-
"--verify",
|
|
62
|
-
`${candidate.observedRef}^{commit}`,
|
|
63
|
-
]);
|
|
64
|
-
if (GIT_SHA_PATTERN.test(sha)) {
|
|
65
|
-
return {
|
|
66
|
-
sha,
|
|
67
|
-
...candidate,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
sha: "",
|
|
73
|
-
observedRef: "",
|
|
74
|
-
observation: "unresolved",
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export function createPaperAlphaPlan({
|
|
78
|
-
cwd = process.cwd(),
|
|
79
|
-
sourceRef = "",
|
|
80
|
-
targetRef = "",
|
|
81
|
-
} = {}) {
|
|
82
|
-
const resolvedCwd = path.resolve(cwd);
|
|
83
|
-
const configResult = paperConfig(resolvedCwd);
|
|
84
|
-
if (configResult.error) throw new Error(configResult.error);
|
|
85
|
-
const publication = configResult.loaded.config.publication;
|
|
86
|
-
const parsed = parsePaperVersion(publication.version);
|
|
87
|
-
const line = `v${parsed.major}.${parsed.minor}`;
|
|
88
|
-
const source = sourceRef || `dev/v${parsed.major}/${line}`;
|
|
89
|
-
const target = targetRef || `alpha/v${parsed.major}/${line}`;
|
|
90
|
-
const repository = resolvePaperRepository(resolvedCwd);
|
|
91
|
-
const sourceObservation = resolvePaperChannelRef(resolvedCwd, source);
|
|
92
|
-
const targetObservation = resolvePaperChannelRef(resolvedCwd, target);
|
|
93
|
-
const currentBranch = gitValue(resolvedCwd, ["branch", "--show-current"]);
|
|
94
|
-
return {
|
|
95
|
-
schemaVersion: 1,
|
|
96
|
-
contract: PAPER_ALPHA_PLAN_CONTRACT,
|
|
97
|
-
ok: Boolean(repository && source && target && source !== target),
|
|
98
|
-
cwd: resolvedCwd,
|
|
99
|
-
dryRun: true,
|
|
100
|
-
repository,
|
|
101
|
-
package: configResult.loaded.config.publish?.package || "",
|
|
102
|
-
publicationVersion: parsed.version,
|
|
103
|
-
channel: "alpha",
|
|
104
|
-
source: {
|
|
105
|
-
ref: source,
|
|
106
|
-
...sourceObservation,
|
|
107
|
-
},
|
|
108
|
-
target: {
|
|
109
|
-
ref: target,
|
|
110
|
-
...targetObservation,
|
|
111
|
-
},
|
|
112
|
-
currentBranch,
|
|
113
|
-
mutation: {
|
|
114
|
-
kind: "github-protected-channel-pr",
|
|
115
|
-
directPublish: false,
|
|
116
|
-
directMerge: false,
|
|
117
|
-
command: `gh pr create --repo ${repository || "<owner/repo>"} --base ${target} --head ${source}`,
|
|
118
|
-
},
|
|
119
|
-
gates: [
|
|
120
|
-
"source is the protected dev channel for the configured semver line",
|
|
121
|
-
"target is the protected alpha channel",
|
|
122
|
-
"the paper release workflow seals exact bytes and uses npm OIDC",
|
|
123
|
-
"this command opens a PR but never merges it or publishes directly",
|
|
124
|
-
],
|
|
125
|
-
nextActions: [
|
|
126
|
-
{
|
|
127
|
-
id: "open-alpha-pr",
|
|
128
|
-
command: "buildchain paper alpha --execute --json",
|
|
129
|
-
description: "Open or reuse the protected dev-to-alpha publication PR.",
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
export function createPaperResumePlan({
|
|
135
|
-
cwd = process.cwd(),
|
|
136
|
-
runtimeRef = "",
|
|
137
|
-
} = {}) {
|
|
138
|
-
const resolvedCwd = path.resolve(cwd);
|
|
139
|
-
const status = collectPaperStatus({ cwd: resolvedCwd });
|
|
140
|
-
const transaction = status.transaction;
|
|
141
|
-
if (!transaction) {
|
|
142
|
-
return {
|
|
143
|
-
schemaVersion: 1,
|
|
144
|
-
contract: PAPER_RESUME_PLAN_CONTRACT,
|
|
145
|
-
ok: false,
|
|
146
|
-
cwd: resolvedCwd,
|
|
147
|
-
dryRun: true,
|
|
148
|
-
resumable: false,
|
|
149
|
-
reason: "no-release-transaction",
|
|
150
|
-
transaction: null,
|
|
151
|
-
nextActions: [
|
|
152
|
-
{
|
|
153
|
-
id: "start-alpha",
|
|
154
|
-
command: "buildchain paper alpha --json",
|
|
155
|
-
description:
|
|
156
|
-
"No transaction exists; plan the protected Alpha publication first.",
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (
|
|
162
|
-
["alpha-complete", "release-complete"].includes(
|
|
163
|
-
transaction.publicationState,
|
|
164
|
-
)
|
|
165
|
-
) {
|
|
166
|
-
return {
|
|
167
|
-
schemaVersion: 1,
|
|
168
|
-
contract: PAPER_RESUME_PLAN_CONTRACT,
|
|
169
|
-
ok: true,
|
|
170
|
-
cwd: resolvedCwd,
|
|
171
|
-
dryRun: true,
|
|
172
|
-
resumable: false,
|
|
173
|
-
reason: "transaction-complete",
|
|
174
|
-
transaction,
|
|
175
|
-
nextActions: [],
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
const targetRef = transaction.targetRef;
|
|
179
|
-
const command = [
|
|
180
|
-
"gh workflow run .github/workflows/public-release-paper.yml",
|
|
181
|
-
targetRef ? `--ref ${targetRef}` : "",
|
|
182
|
-
runtimeRef ? `-f runtime-ref=${runtimeRef}` : "",
|
|
183
|
-
]
|
|
184
|
-
.filter(Boolean)
|
|
185
|
-
.join(" ");
|
|
186
|
-
return {
|
|
187
|
-
schemaVersion: 1,
|
|
188
|
-
contract: PAPER_RESUME_PLAN_CONTRACT,
|
|
189
|
-
ok: Boolean(targetRef),
|
|
190
|
-
cwd: resolvedCwd,
|
|
191
|
-
dryRun: true,
|
|
192
|
-
resumable: Boolean(targetRef),
|
|
193
|
-
reason: targetRef
|
|
194
|
-
? "rerun-sealed-paper-release"
|
|
195
|
-
: "transaction-target-ref-missing",
|
|
196
|
-
transaction,
|
|
197
|
-
mutation: {
|
|
198
|
-
kind: "github-workflow-dispatch",
|
|
199
|
-
directPublish: false,
|
|
200
|
-
command,
|
|
201
|
-
},
|
|
202
|
-
nextActions: targetRef
|
|
203
|
-
? [
|
|
204
|
-
{
|
|
205
|
-
id: "dispatch-resume",
|
|
206
|
-
command: "buildchain paper resume --execute --json",
|
|
207
|
-
description:
|
|
208
|
-
"Dispatch the thin repository workflow against the exact transaction target ref.",
|
|
209
|
-
},
|
|
210
|
-
]
|
|
211
|
-
: [],
|
|
212
|
-
};
|
|
213
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { PAPER_PATHS, sha256Text, stableJson } from "../paper-repository.js";
|
|
2
|
-
import { PAPER_AGENT_ENTRY_CONTRACT } from "../paper-agent-entry.js";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import {
|
|
5
|
-
PAPER_PROVISIONING_CONTRACT,
|
|
6
|
-
NPM_REGISTRY,
|
|
7
|
-
DEFAULT_BOOTSTRAP_VERSION,
|
|
8
|
-
} from "./identity.js";
|
|
9
|
-
export function paperProvisioningPolicy() {
|
|
10
|
-
return {
|
|
11
|
-
repositoryActions: {
|
|
12
|
-
defaultWorkflowPermissions: "read",
|
|
13
|
-
canApprovePullRequestReviews: false,
|
|
14
|
-
},
|
|
15
|
-
generatedWrites: {
|
|
16
|
-
preferredAuthority: "github-app",
|
|
17
|
-
compatibilityAuthority: "narrow-token",
|
|
18
|
-
githubTokenFallback: false,
|
|
19
|
-
permissions: ["checks:write", "contents:write", "pull-requests:write"],
|
|
20
|
-
tokenPersistence: "runtime-only",
|
|
21
|
-
},
|
|
22
|
-
release: {
|
|
23
|
-
protectedReviewRequired: true,
|
|
24
|
-
versionState: "not-required",
|
|
25
|
-
identityOnlyPullRequests: false,
|
|
26
|
-
manualVersionStateRepairPullRequests: false,
|
|
27
|
-
},
|
|
28
|
-
roles: {
|
|
29
|
-
actor: "repository-development-role",
|
|
30
|
-
pusher: "repository-development-role",
|
|
31
|
-
reviewer: "independent-review-role",
|
|
32
|
-
generatedWriteAuthority: "github-app-or-narrow-token",
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function createPaperProvisioningAuthority({
|
|
37
|
-
repository,
|
|
38
|
-
packageName,
|
|
39
|
-
buildchainVersion,
|
|
40
|
-
buildchainSha,
|
|
41
|
-
contractLock,
|
|
42
|
-
buildWorkflow,
|
|
43
|
-
verifyWorkflow,
|
|
44
|
-
releaseWorkflow,
|
|
45
|
-
agentEntry,
|
|
46
|
-
agentInstructions,
|
|
47
|
-
environment = "",
|
|
48
|
-
}) {
|
|
49
|
-
const policy = paperProvisioningPolicy();
|
|
50
|
-
const payload = {
|
|
51
|
-
schemaVersion: 1,
|
|
52
|
-
contract: PAPER_PROVISIONING_CONTRACT,
|
|
53
|
-
repository,
|
|
54
|
-
package: {
|
|
55
|
-
name: packageName,
|
|
56
|
-
registry: NPM_REGISTRY,
|
|
57
|
-
bootstrapVersion: DEFAULT_BOOTSTRAP_VERSION,
|
|
58
|
-
},
|
|
59
|
-
runtime: {
|
|
60
|
-
repository: "kungfu-systems/buildchain",
|
|
61
|
-
version: buildchainVersion,
|
|
62
|
-
ref: buildchainSha,
|
|
63
|
-
resolvedSha: buildchainSha,
|
|
64
|
-
},
|
|
65
|
-
workflows: {
|
|
66
|
-
build: {
|
|
67
|
-
path: PAPER_PATHS.buildWorkflow,
|
|
68
|
-
sourceDigest: sha256Text(buildWorkflow),
|
|
69
|
-
reusablePath: ".github/workflows/public-build-publication.yml",
|
|
70
|
-
reusableRef: buildchainSha,
|
|
71
|
-
},
|
|
72
|
-
verify: {
|
|
73
|
-
path: PAPER_PATHS.verifyWorkflow,
|
|
74
|
-
sourceDigest: sha256Text(verifyWorkflow),
|
|
75
|
-
reusablePath: ".github/workflows/public-build-check.yml",
|
|
76
|
-
reusableRef: buildchainSha,
|
|
77
|
-
},
|
|
78
|
-
release: {
|
|
79
|
-
path: PAPER_PATHS.releaseWorkflow,
|
|
80
|
-
sourceDigest: sha256Text(releaseWorkflow),
|
|
81
|
-
reusablePath: ".github/workflows/public-release-paper.yml",
|
|
82
|
-
reusableRef: buildchainSha,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
agentEntry: {
|
|
86
|
-
contract: PAPER_AGENT_ENTRY_CONTRACT,
|
|
87
|
-
policyPath: PAPER_PATHS.agentEntry,
|
|
88
|
-
policyDigest: sha256Text(agentEntry),
|
|
89
|
-
instructionsPath: PAPER_PATHS.agentInstructions,
|
|
90
|
-
instructionsDigest: sha256Text(agentInstructions),
|
|
91
|
-
},
|
|
92
|
-
admission: {
|
|
93
|
-
contractLockPath: PAPER_PATHS.contractLock,
|
|
94
|
-
contractLockDigest: sha256Text(contractLock),
|
|
95
|
-
acceptedRef: buildchainSha,
|
|
96
|
-
acceptedSha: buildchainSha,
|
|
97
|
-
},
|
|
98
|
-
trustedPublisher: {
|
|
99
|
-
type: "github",
|
|
100
|
-
repository,
|
|
101
|
-
workflow: path.posix.basename(PAPER_PATHS.releaseWorkflow),
|
|
102
|
-
environment,
|
|
103
|
-
},
|
|
104
|
-
policy: {
|
|
105
|
-
...policy,
|
|
106
|
-
policyDigest: sha256Text(stableJson(policy)),
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
return {
|
|
110
|
-
...payload,
|
|
111
|
-
authorityDigest: sha256Text(stableJson(payload)),
|
|
112
|
-
};
|
|
113
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { appendNextDevelopmentToml } from "../../release/next-development-projection.js";
|
|
2
|
-
import {
|
|
3
|
-
DEFAULT_TOOLCHAIN_IMAGE,
|
|
4
|
-
DEFAULT_TOOLCHAIN_DIGEST,
|
|
5
|
-
DEFAULT_TOOLCHAIN_COMMAND,
|
|
6
|
-
} from "./identity.js";
|
|
7
|
-
export function tomlString(value) {
|
|
8
|
-
return JSON.stringify(String(value || ""));
|
|
9
|
-
}
|
|
10
|
-
export function joinUrl(base, suffix = "") {
|
|
11
|
-
const normalizedBase = String(base || "")
|
|
12
|
-
.trim()
|
|
13
|
-
.replace(/\/+$/, "");
|
|
14
|
-
const normalizedSuffix = String(suffix || "")
|
|
15
|
-
.trim()
|
|
16
|
-
.replace(/^\/+|\/+$/g, "");
|
|
17
|
-
if (!normalizedBase) return "";
|
|
18
|
-
return normalizedSuffix
|
|
19
|
-
? `${normalizedBase}/${normalizedSuffix}/`
|
|
20
|
-
: `${normalizedBase}/`;
|
|
21
|
-
}
|
|
22
|
-
export function scaffoldConfig({
|
|
23
|
-
name,
|
|
24
|
-
title,
|
|
25
|
-
packageName,
|
|
26
|
-
version,
|
|
27
|
-
siteBaseUrl,
|
|
28
|
-
}) {
|
|
29
|
-
const archiveId = name.replace(/^paper-/, "");
|
|
30
|
-
const canonicalUrl = joinUrl(siteBaseUrl, archiveId);
|
|
31
|
-
const archive = canonicalUrl
|
|
32
|
-
? `
|
|
33
|
-
[publication.archive]
|
|
34
|
-
id = ${tomlString(archiveId)}
|
|
35
|
-
canonical_url = ${tomlString(canonicalUrl)}
|
|
36
|
-
latest_url = ${tomlString(joinUrl(canonicalUrl, "latest"))}
|
|
37
|
-
latest_evidence_url = ${tomlString(`${joinUrl(canonicalUrl, "latest")}buildchain.release.json`)}
|
|
38
|
-
immutable_base_url = ${tomlString(joinUrl(siteBaseUrl, "archive").replace(/\/$/, ""))}
|
|
39
|
-
registry_path = ".buildchain/publication/publication-registry.json"
|
|
40
|
-
`
|
|
41
|
-
: "";
|
|
42
|
-
return appendNextDevelopmentToml(`schema = 1
|
|
43
|
-
|
|
44
|
-
[project]
|
|
45
|
-
type = "publication-artifact"
|
|
46
|
-
name = ${tomlString(name)}
|
|
47
|
-
|
|
48
|
-
[publication]
|
|
49
|
-
kind = "paper"
|
|
50
|
-
title = ${tomlString(title)}
|
|
51
|
-
version = ${tomlString(version)}
|
|
52
|
-
primary_artifact = "_build/main.pdf"
|
|
53
|
-
artifact_paths = ["_build/main.pdf"]
|
|
54
|
-
metadata_paths = ["README.md", "docs/MAP.md"]
|
|
55
|
-
source_paths = ["paper", "README.md", "LICENSE", "Makefile"]
|
|
56
|
-
site_consumers = ${siteBaseUrl ? `[${tomlString(siteBaseUrl)}]` : "[]"}
|
|
57
|
-
manifest_path = ".buildchain/publication/publication-artifact.json"
|
|
58
|
-
source_bundle_path = ".buildchain/publication/source.tar.gz"
|
|
59
|
-
${archive}
|
|
60
|
-
[publication.toolchain]
|
|
61
|
-
type = "latex-docker"
|
|
62
|
-
image = "${DEFAULT_TOOLCHAIN_IMAGE}"
|
|
63
|
-
digest = "${DEFAULT_TOOLCHAIN_DIGEST}"
|
|
64
|
-
command = "${DEFAULT_TOOLCHAIN_COMMAND}"
|
|
65
|
-
|
|
66
|
-
[publish]
|
|
67
|
-
kind = "npm-paper-package"
|
|
68
|
-
package = ${tomlString(packageName)}
|
|
69
|
-
auth = "trusted-publishing"
|
|
70
|
-
|
|
71
|
-
[lifecycle.build]
|
|
72
|
-
command = "make pdf"
|
|
73
|
-
|
|
74
|
-
[lifecycle.verify]
|
|
75
|
-
command = "make check"
|
|
76
|
-
`);
|
|
77
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { nextDevelopmentWorkflowHeader } from "../../release/next-development-projection.js";
|
|
2
|
-
export function scaffoldBuildWorkflow(
|
|
3
|
-
entryRef,
|
|
4
|
-
{ artifactName = "paper-publication" } = {},
|
|
5
|
-
) {
|
|
6
|
-
return `${nextDevelopmentWorkflowHeader()}name: Build
|
|
7
|
-
|
|
8
|
-
on:
|
|
9
|
-
workflow_dispatch:
|
|
10
|
-
inputs:
|
|
11
|
-
runtime-ref:
|
|
12
|
-
description: Transient execution runtime; empty selects the consumer lock.
|
|
13
|
-
required: false
|
|
14
|
-
default: ""
|
|
15
|
-
pull_request:
|
|
16
|
-
push:
|
|
17
|
-
branches:
|
|
18
|
-
- "dev/**"
|
|
19
|
-
- "alpha/**"
|
|
20
|
-
- "release/**"
|
|
21
|
-
|
|
22
|
-
permissions:
|
|
23
|
-
contents: read
|
|
24
|
-
issues: write
|
|
25
|
-
|
|
26
|
-
jobs:
|
|
27
|
-
publication:
|
|
28
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-build-publication.yml@${entryRef}
|
|
29
|
-
with:
|
|
30
|
-
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
31
|
-
contract-lock: .buildchain/contract-lock.json
|
|
32
|
-
toolchain-type: config
|
|
33
|
-
verify-command: make check
|
|
34
|
-
artifact-name: ${JSON.stringify(artifactName)}
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
export function scaffoldVerifyWorkflow(entryRef) {
|
|
38
|
-
return `${nextDevelopmentWorkflowHeader()}name: Verify
|
|
39
|
-
|
|
40
|
-
on:
|
|
41
|
-
pull_request:
|
|
42
|
-
push:
|
|
43
|
-
branches:
|
|
44
|
-
- "dev/v*/v*"
|
|
45
|
-
- "alpha/v*/v*"
|
|
46
|
-
- "release/v*/v*"
|
|
47
|
-
workflow_dispatch:
|
|
48
|
-
inputs:
|
|
49
|
-
runtime-ref:
|
|
50
|
-
description: Transient execution runtime; empty selects the consumer lock.
|
|
51
|
-
required: false
|
|
52
|
-
default: ""
|
|
53
|
-
|
|
54
|
-
permissions:
|
|
55
|
-
actions: read
|
|
56
|
-
contents: read
|
|
57
|
-
pull-requests: read
|
|
58
|
-
|
|
59
|
-
jobs:
|
|
60
|
-
check:
|
|
61
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-build-check.yml@${entryRef}
|
|
62
|
-
with:
|
|
63
|
-
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
64
|
-
require-version-state: true
|
|
65
|
-
upload-artifacts: true
|
|
66
|
-
`;
|
|
67
|
-
}
|
|
68
|
-
export function scaffoldReleaseWorkflow(
|
|
69
|
-
entryRef,
|
|
70
|
-
{ artifactPaths = "_build/main.pdf", releasePassportProductName = "" } = {},
|
|
71
|
-
) {
|
|
72
|
-
const passportInput = releasePassportProductName
|
|
73
|
-
? ` release-passport-product-name: ${JSON.stringify(releasePassportProductName)}\n`
|
|
74
|
-
: "";
|
|
75
|
-
return `${nextDevelopmentWorkflowHeader()}name: Paper Release
|
|
76
|
-
|
|
77
|
-
on:
|
|
78
|
-
workflow_dispatch:
|
|
79
|
-
inputs:
|
|
80
|
-
runtime-ref:
|
|
81
|
-
description: Transient execution runtime; empty selects the consumer lock.
|
|
82
|
-
required: false
|
|
83
|
-
default: ""
|
|
84
|
-
push:
|
|
85
|
-
branches:
|
|
86
|
-
- "alpha/**"
|
|
87
|
-
- "release/**"
|
|
88
|
-
|
|
89
|
-
permissions:
|
|
90
|
-
contents: read
|
|
91
|
-
|
|
92
|
-
jobs:
|
|
93
|
-
paper-release:
|
|
94
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-paper.yml@${entryRef}
|
|
95
|
-
permissions:
|
|
96
|
-
actions: read
|
|
97
|
-
checks: write
|
|
98
|
-
contents: read
|
|
99
|
-
id-token: write
|
|
100
|
-
issues: write
|
|
101
|
-
pull-requests: write
|
|
102
|
-
with:
|
|
103
|
-
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
104
|
-
contract-lock: .buildchain/contract-lock.json
|
|
105
|
-
publisher-workflow-path: .github/workflows/public-release-paper.yml
|
|
106
|
-
toolchain-type: config
|
|
107
|
-
verify-command: make check
|
|
108
|
-
artifact-paths: ${JSON.stringify(artifactPaths)}
|
|
109
|
-
${passportInput} secrets:
|
|
110
|
-
KUNGFU_GOVERNANCE_AUDITOR_APP_PRIVATE_KEY: \${{ secrets.KUNGFU_GOVERNANCE_AUDITOR_APP_PRIVATE_KEY }}
|
|
111
|
-
BUILDCHAIN_GENERATED_WRITE_APP_CLIENT_ID: \${{ secrets.BUILDCHAIN_GENERATED_WRITE_APP_CLIENT_ID }}
|
|
112
|
-
BUILDCHAIN_GENERATED_WRITE_APP_PRIVATE_KEY: \${{ secrets.BUILDCHAIN_GENERATED_WRITE_APP_PRIVATE_KEY }}
|
|
113
|
-
BUILDCHAIN_GENERATED_WRITE_TOKEN: \${{ secrets.BUILDCHAIN_GENERATED_WRITE_TOKEN }}
|
|
114
|
-
BUILDCHAIN_PROMOTION_TOKEN: \${{ secrets.BUILDCHAIN_PROMOTION_TOKEN }}
|
|
115
|
-
`;
|
|
116
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { BUILDCHAIN_PACKAGE_NAME } from "./identity.js";
|
|
2
|
-
export function paperPnpmWorkspace(current, buildchainVersion) {
|
|
3
|
-
const entry = `${BUILDCHAIN_PACKAGE_NAME}@${buildchainVersion}`;
|
|
4
|
-
const source = String(current || "");
|
|
5
|
-
const lines = source ? source.replace(/\r\n/g, "\n").split("\n") : [];
|
|
6
|
-
if (lines.at(-1) === "") lines.pop();
|
|
7
|
-
const keyLines = lines
|
|
8
|
-
.map((line, index) =>
|
|
9
|
-
/^minimumReleaseAgeExclude:\s*(?:#.*)?$/.test(line) ? index : -1,
|
|
10
|
-
)
|
|
11
|
-
.filter((index) => index >= 0);
|
|
12
|
-
const unsupportedKey = lines.some(
|
|
13
|
-
(line) =>
|
|
14
|
-
/^minimumReleaseAgeExclude\s*:/.test(line) &&
|
|
15
|
-
!/^minimumReleaseAgeExclude:\s*(?:#.*)?$/.test(line),
|
|
16
|
-
);
|
|
17
|
-
if (unsupportedKey || keyLines.length > 1) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
"paper migration requires minimumReleaseAgeExclude to be one top-level block sequence",
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
if (keyLines.length === 0) {
|
|
23
|
-
const prefix = lines.length > 0 ? [...lines, ""] : [];
|
|
24
|
-
return `${[...prefix, "minimumReleaseAgeExclude:", ` - '${entry}'`].join(
|
|
25
|
-
"\n",
|
|
26
|
-
)}\n`;
|
|
27
|
-
}
|
|
28
|
-
const keyIndex = keyLines[0];
|
|
29
|
-
let blockEnd = lines.length;
|
|
30
|
-
for (let index = keyIndex + 1; index < lines.length; index += 1) {
|
|
31
|
-
if (/^[^\s#]/.test(lines[index])) {
|
|
32
|
-
blockEnd = index;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
const retained = [];
|
|
37
|
-
for (const line of lines.slice(keyIndex + 1, blockEnd)) {
|
|
38
|
-
if (!line.trim() || /^\s*#/.test(line)) {
|
|
39
|
-
retained.push(line);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
const item = line.match(/^\s*-\s+(.+?)\s*(?:#.*)?$/);
|
|
43
|
-
if (!item) {
|
|
44
|
-
throw new Error(
|
|
45
|
-
"paper migration requires minimumReleaseAgeExclude to contain scalar package entries",
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
const value = item[1]
|
|
49
|
-
.trim()
|
|
50
|
-
.replace(/^'(.*)'$/, "$1")
|
|
51
|
-
.replace(/^"(.*)"$/, "$1");
|
|
52
|
-
if (!value.startsWith(`${BUILDCHAIN_PACKAGE_NAME}@`)) retained.push(line);
|
|
53
|
-
}
|
|
54
|
-
return `${[
|
|
55
|
-
...lines.slice(0, keyIndex + 1),
|
|
56
|
-
...retained,
|
|
57
|
-
` - '${entry}'`,
|
|
58
|
-
...lines.slice(blockEnd),
|
|
59
|
-
].join("\n")}\n`;
|
|
60
|
-
}
|