@kungfu-tech/buildchain 4.1.0-alpha.0 → 4.1.0-alpha.2
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 +30 -41
- package/CONTRIBUTING.md +6 -7
- package/architecture/action-taxonomy.json +5 -21
- package/architecture/agent-change-map.md +74 -56
- package/architecture/build-orchestration.json +8 -1
- package/architecture/ci-lane-change-budget.json +179 -69
- package/architecture/floating-consumer-policy.json +7 -17
- package/architecture/internal-capabilities.json +58 -72
- package/architecture/maintainability-debt.json +138 -52
- package/architecture/maintainability-policy.json +6 -15
- package/architecture/promotion-job-topology.json +39 -20
- package/architecture/release-topology.json +26 -37
- package/architecture/runtime-entry.json +26 -0
- package/architecture/runtime-resume-lineage.json +23 -0
- package/architecture/stage-capsule-qualification.json +2 -2
- package/architecture/universal-workflow-bootstrap.json +10 -25
- package/architecture/universal-workflow-capability-policy.json +61 -0
- package/architecture/universal-workflow-fault-campaign.json +18 -24
- package/architecture/workflow-taxonomy.json +0 -11
- package/contracts/fixtures/{v4-runtime-ref-resume-authority-v1 → runtime-resume-lineage-v2}/scenario.json +2 -3
- package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +2 -2
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/contracts/promotion-invocation-v1.schema.json +0 -44
- package/contracts/promotion-request-v1.schema.json +0 -39
- package/contracts/runtime-resume-lineage-v2.schema.json +182 -0
- package/dist/site/buildchain-contract.json +472 -361
- package/dist/site/buildchain-site.json +99 -99
- package/dist/site/capability-registry.json +3 -3
- package/dist/site/cli-registry.json +4 -4
- package/dist/site/controller-registry.json +94 -78
- package/dist/site/kfd-claims.json +224 -343
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +15 -15
- package/dist/site/node-api-registry.json +239 -354
- package/dist/site/page-registry.json +80 -80
- package/dist/site/public-surface-audit.json +203 -254
- package/dist/site/publication-authority-registry.json +1 -24
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +1 -1
- package/dist/site/site-manifest.json +19 -19
- package/dist/site/workflow-registry.json +197 -357
- package/docs/MAP.md +3 -3
- package/docs/auditable-demo.md +4 -4
- package/docs/cli-reference.md +2 -2
- package/docs/code-organization.md +5 -4
- package/docs/controller-evidence.md +2 -2
- package/docs/dev-alpha-candidate-patrol.md +5 -5
- package/docs/dev-delivery-warrant.md +14 -24
- package/docs/engineering-housekeeper.md +3 -3
- package/docs/github-artifact-attestation.md +9 -12
- package/docs/github-governance-authority.md +4 -4
- package/docs/node-api-reference.md +153 -167
- package/docs/publication-artifacts.md +3 -4
- package/docs/publication-authority.md +2 -2
- package/docs/release-candidate.md +21 -27
- package/docs/release-governance.md +10 -10
- package/docs/release-promotion-request.md +11 -18
- package/docs/release-propagation.md +5 -6
- package/docs/release-tail-provider-plane.md +2 -3
- package/docs/reusable-build-surface.md +13 -7
- package/docs/runtime-entry.md +122 -0
- package/docs/runtime-train-validation.md +30 -41
- package/docs/v4-publication-rehearsal.md +5 -5
- package/docs/v4-stage-capsule.md +9 -10
- package/docs/web-surface-deployments.md +16 -20
- package/docs/workflow-catalog.md +0 -1
- package/package.json +6 -6
- package/packages/core/adoption/commands/init-repo.mjs +2 -2
- package/packages/core/adoption/cross-platform-adopter-qualification.js +2 -13
- package/packages/core/adoption/qualification/actions.js +3 -5
- package/packages/core/adoption/qualification/admission.js +2 -3
- package/packages/core/build/artifact/attestation.js +0 -1
- package/packages/core/build/artifact/contracts.js +1 -4
- package/packages/core/build/artifact/store.js +6 -5
- package/packages/core/build/artifact-signing.js +4 -10
- package/packages/core/build/binary/actions.js +15 -9
- package/packages/core/build/binary-publication-dispatch.js +2 -6
- package/packages/core/build/demo/action-context.js +2 -11
- package/packages/core/build/demo/binary-action.js +8 -10
- package/packages/core/build/gate/controller.js +0 -2
- package/packages/core/build/github-attestation/action.js +2 -7
- package/packages/core/build/github-attestation/admission.js +0 -8
- package/packages/core/build/github-attestation/transaction.js +1 -2
- package/packages/core/build/lifecycle/stage-action.js +2 -0
- package/packages/core/build/lifecycle/stage.js +6 -3
- package/packages/core/build/macos-credential-island/dmg-assembly.js +0 -2
- package/packages/core/build/macos-credential-island/lib.js +2 -6
- package/packages/core/build/plan/action-context.js +0 -7
- package/packages/core/build/plan/action.js +7 -11
- package/packages/core/build/plan/admission.js +6 -73
- package/packages/core/build/plan/configuration.js +1 -1
- package/packages/core/build/plan/environment.js +1 -1
- package/packages/core/build/plan/identity.js +1 -5
- package/packages/core/build/plan/resolve.js +7 -1
- package/packages/core/build/recovery/checkpoint.js +158 -0
- package/packages/core/build/recovery/transaction.js +51 -0
- package/packages/core/build/signing/authority-actions.js +2 -11
- package/packages/core/build/signing/control.js +0 -5
- package/packages/core/build/signing/controller-transaction.js +0 -1
- package/packages/core/build/signing/delegation.js +2 -4
- package/packages/core/build/signing/dispatch.js +10 -56
- package/packages/core/build/signing/intake.js +0 -4
- package/packages/core/build/signing/prepare.js +1 -1
- package/packages/core/build/signing/request.js +3 -8
- package/packages/core/build/source/checkout-action.js +6 -10
- package/packages/core/build/source/controller.js +1 -4
- package/packages/core/build/source/lifecycle.js +3 -13
- package/packages/core/build/stage-capsule/actions.js +3 -13
- package/packages/core/build/stage-capsule/campaign/resume.js +10 -5
- package/packages/core/build/stage-capsule/rehearsal/verify.js +3 -4
- package/packages/core/build/stage-capsule-resume-planner.js +0 -1
- package/packages/core/build/summary/aggregation.js +5 -5
- package/packages/core/build/summary/finalization.js +1 -1
- package/packages/core/build/verification/actions.js +3 -12
- package/packages/core/build/verification/runner.js +22 -20
- package/packages/core/consumer/floating-consumer-evidence.js +3 -21
- package/packages/core/consumer/floating-consumer-policy.js +2 -93
- package/packages/core/consumer/floating-consumer-release-passport.js +1 -34
- package/packages/core/consumer/policy-admission.js +1 -3
- package/packages/core/contracts/buildchain-contract.js +12 -146
- package/packages/core/contracts/workflow-yaml-contract.js +11 -1
- package/packages/core/dev-delivery/candidate/admission.js +3 -4
- package/packages/core/dev-delivery/candidate/coordinates.js +0 -8
- package/packages/core/dev-delivery/commands/dev-delivery-request.sh +5 -13
- package/packages/core/dev-delivery/commands/dev-delivery-source-proof-reuse.mjs +0 -3
- package/packages/core/dev-delivery/dev-delivery-contract-surface.js +4 -52
- package/packages/core/dev-delivery/dev-delivery-execution-transfer.js +2 -15
- package/packages/core/dev-delivery/native/action-context.js +4 -32
- package/packages/core/dev-delivery/native/provider-boundary.js +0 -2
- package/packages/core/dev-delivery/native/transactions.js +1 -2
- package/packages/core/dev-delivery/queue/reconciliation-action.js +6 -10
- package/packages/core/dev-delivery/source-proof/predicates.js +0 -6
- package/packages/core/dev-delivery/source-proof/reuse.js +0 -2
- package/packages/core/dev-delivery/source-proof/seal.js +0 -2
- package/packages/core/governance/alpha-candidate/action.js +1 -10
- package/packages/core/governance/audit/actions.js +1 -3
- package/packages/core/governance/audit/collection.js +1 -3
- package/packages/core/governance/audit/identity.js +3 -31
- package/packages/core/governance/audit/transactions.js +2 -4
- package/packages/core/governance/buildchain-publication-authority.js +0 -1
- package/packages/core/governance/commands/audit-github-governance.mjs +3 -2
- package/packages/core/governance/github-governance-authority.js +0 -5
- package/packages/core/governance/receipt-admission.js +0 -15
- package/packages/core/index.js +1 -1
- package/packages/core/observability/controller/identity.js +4 -5
- package/packages/core/observability/controller-evidence.js +5 -10
- package/packages/core/paper/commands/paper.mjs +6 -6
- package/packages/core/paper/operations/plans.js +2 -2
- package/packages/core/paper/operations/provisioning-validation.js +1 -1
- package/packages/core/paper/operations/scaffold-workflows.js +29 -12
- package/packages/core/paper/operations/scaffold.js +97 -69
- package/packages/core/paper/paper-agent-entry.js +0 -11
- package/packages/core/paper/paper-runtime-channels.js +21 -66
- package/packages/core/paper/paper-scaffold-content.js +1 -1
- package/packages/core/paper/paper.js +9 -5
- package/packages/core/paper/publication/candidate.js +0 -9
- package/packages/core/paper/publication-controller.js +2 -4
- package/packages/core/providers/github/artifact-attestation.js +1 -1
- package/packages/core/publication/authority/actions.js +9 -8
- package/packages/core/publication/authority/admission.js +0 -11
- package/packages/core/publication/authority/assembly.js +2 -7
- package/packages/core/publication/authority/control-plane.js +2 -2
- package/packages/core/publication/authority/governance.js +2 -9
- package/packages/core/publication/authority/request.js +7 -2
- package/packages/core/publication/authority/verification.js +3 -18
- package/packages/core/publication/binary/action.js +5 -7
- package/packages/core/publication/candidate/qualification-action.js +1 -6
- package/packages/core/publication/candidate/stage-capsules.js +1 -1
- package/packages/core/publication/npm/preview-action.js +9 -15
- package/packages/core/publication/oci/preview-actions.js +1 -10
- package/packages/core/publication/publication-artifact-candidate.js +2 -2
- package/packages/core/publication/publication-authority.js +2 -2
- package/packages/core/publication/publication-rehearsal-projection.js +3 -3
- package/packages/core/publication/settlement/actions.js +2 -11
- package/packages/core/release/binary/coordinates-action.js +0 -13
- package/packages/core/release/binary/coordinates.js +2 -19
- package/packages/core/release/commands/promotion-channel-router.mjs +12 -56
- package/packages/core/release/commands/resume-from-candidate-run.mjs +2 -3
- package/packages/core/release/dev-alpha-active-release-train.js +0 -5
- package/packages/core/release/line/action.js +2 -13
- package/packages/core/release/next-development/actions.js +2 -5
- package/packages/core/release/passport/consumer-validation.js +1 -28
- package/packages/core/release/promote-candidate/development-source.js +7 -8
- package/packages/core/release/promotion/actions.js +7 -38
- package/packages/core/release/promotion/admission.js +3 -50
- package/packages/core/release/promotion/candidate.js +2 -4
- package/packages/core/release/promotion/channel.js +13 -101
- package/packages/core/release/promotion/qualification-action.js +2 -13
- package/packages/core/release/promotion/routing.js +16 -81
- package/packages/core/release/promotion/selection.js +1 -9
- package/packages/core/release/promotion-request.js +1 -40
- package/packages/core/release/qualification/actions.js +0 -8
- package/packages/core/release/qualification/public-build.js +1 -1
- package/packages/core/release/recovery/candidate.js +15 -21
- package/packages/core/release/recovery/capsules.js +2 -10
- package/packages/core/release/recovery/lineage.js +305 -0
- package/packages/core/release/recovery/provenance.js +1 -2
- package/packages/core/release/recovery/publication.js +4 -14
- package/packages/core/release/recovery/readback.js +19 -32
- package/packages/core/release/recovery/runtime.js +4 -95
- package/packages/core/release/release-candidate-recovery.js +4 -9
- package/packages/core/release/release-candidate.js +2 -5
- package/packages/core/release/reseal/actions.js +3 -22
- package/packages/core/release/reseal/admission.js +0 -2
- package/packages/core/release/reseal/finalize-platform.js +0 -2
- package/packages/core/release/tail-reseal-github.js +1 -2
- package/packages/core/release/tail-reseal-receipt.js +0 -1
- package/packages/core/release/tail-reseal.js +2 -20
- package/packages/core/release/version-state.js +16 -13
- package/packages/core/runtime/buildchain-domain.wasm +0 -0
- package/packages/core/runtime/checkout-identity.js +0 -13
- package/packages/core/runtime/domain-wasm-artifact.js +2 -2
- package/packages/core/runtime/entry/actions.js +121 -0
- package/packages/core/runtime/entry/activation.js +86 -0
- package/packages/core/runtime/entry/github.js +55 -0
- package/packages/core/runtime/entry/recovery.js +37 -0
- package/packages/core/runtime/entry/selection.js +110 -0
- package/packages/core/web/controller.js +1 -1
- package/packages/core/web/publication-admission-action.js +1 -8
- package/packages/core/web/web-surface-publication-candidate.js +2 -5
- package/packages/core/workflow/admission/actions.js +6 -26
- package/packages/core/workflow/admission/recovery.js +3 -43
- package/packages/core/workflow/admission/transactions.js +8 -24
- package/packages/core/workflow/commands/buildchain-cli-help.mjs +1 -1
- package/packages/core/workflow/commands/universal-workflow-engine.mjs +2 -7
- package/packages/core/workflow/dogfood/actions.js +0 -17
- package/packages/core/workflow/engine/action.js +0 -5
- package/packages/core/workflow/engine/conformance.js +1 -1
- package/packages/core/workflow/engine/execution.js +2 -6
- package/packages/core/workflow/engine/identity.js +1 -6
- package/packages/core/workflow/engine/release-environment.js +11 -35
- package/packages/core/workflow/engine/release-promotion.js +2 -2
- package/packages/core/workflow/settlement/actions.js +0 -12
- package/packages/core/workflow/universal-self-dogfood.js +2 -16
- package/packages/core/workflow/universal-workflow-bootstrap.js +16 -241
- package/packages/core/workflow/workflow-taxonomy.mjs +2 -2
- package/scripts/check-dev-delivery-actions.mjs +17 -8
- package/scripts/check-floating-consumer-policy-contract.mjs +6 -6
- package/scripts/check-inventory.mjs +1 -10
- package/scripts/check-public-dogfood-contract.mjs +34 -21
- package/scripts/check-release-topology.mjs +2 -6
- package/scripts/check-runtime-entry.mjs +133 -0
- package/scripts/check-universal-workflow-bootstrap.mjs +45 -281
- package/scripts/check-workflows.sh +0 -7
- package/scripts/generate-bootstrap-admission.mjs +1 -1
- package/scripts/generate-channel-promotion-workflow.mjs +4 -4
- package/scripts/inventory/binary.mjs +4 -4
- package/scripts/inventory/promotion.mjs +5 -3
- package/scripts/runtime-source-boundaries.mjs +70 -0
- package/scripts/site-capability-metadata.mjs +2 -2
- package/scripts/workflow-action-graph.mjs +5 -18
- package/scripts/workflow-self-reference.mjs +20 -0
- package/templates/native-dev-delivery.yml +4 -4
- package/templates/universal-buildchain-bootstrap.yml +12 -2
- package/architecture/runtime-ref-resume-authority.json +0 -64
- package/architecture/universal-workflow-train-admission.json +0 -76
- package/contracts/v4-runtime-ref-resume-authority-v1.schema.json +0 -235
- package/docs/v4-runtime-ref-resume-authority.md +0 -69
- package/packages/core/consumer/channel-selection.js +0 -211
- package/packages/core/consumer/commands/buildchain-channel-router.mjs +0 -81
- package/packages/core/consumer/invocation-selector.js +0 -4
- package/packages/core/consumer/runtime-ref-resume-authority.js +0 -621
- package/packages/core/consumer/workflow-definition-authority.js +0 -64
- package/packages/core/contracts/runtime-contract-action.js +0 -48
- package/packages/core/release/commands/promotion-identity-resolver.mjs +0 -77
- package/packages/core/release/commands/verify-promotion-router-binding.sh +0 -36
- package/packages/core/release/promotion/identities.js +0 -56
- package/packages/core/release/runtime-override-authorization.js +0 -242
- package/packages/core/runtime/commands/runtime-ref-core.mjs +0 -171
- package/packages/core/runtime/provider-closure.js +0 -60
- package/packages/core/runtime/runtime-selection-action.js +0 -34
- package/packages/core/runtime/runtime-selection.js +0 -136
- package/packages/core/runtime/workflow-runtime.js +0 -11
- package/packages/core/workflow/admission/review.js +0 -188
- package/packages/core/workflow/commands/universal-workflow-backflow.mjs +0 -26
- package/packages/core/workflow/installation.js +0 -33
- package/packages/core/workflow/settlement/backflow.js +0 -187
- package/scripts/generate-bootstrap-recovery.mjs +0 -94
- package/templates/bootstrap-recovery/actions/build/source/admit/action.yml +0 -17
- package/templates/bootstrap-recovery/actions/build/source/admit/dist/index.js +0 -63
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/action.yml +0 -18
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/dist/index.js +0 -63
- package/templates/bootstrap-recovery/actions/runtime/environment/prepare/action.yml +0 -21
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/action.yml +0 -27
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/dist/index.js +0 -64
- package/templates/bootstrap-recovery/actions/workflow/admission/review/action.yml +0 -15
- package/templates/bootstrap-recovery/actions/workflow/admission/review/dist/index.js +0 -65
- package/templates/bootstrap-recovery/actions/workflow/recovery/admit/action.yml +0 -47
- package/templates/bootstrap-recovery/actions/workflow/recovery/execute/action.yml +0 -48
- package/templates/bootstrap-recovery/actions/workflow/recovery/settle/action.yml +0 -54
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/action.yml +0 -17
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/dist/index.js +0 -65
- package/templates/bootstrap-recovery/manifest.json +0 -68
- package/templates/bootstrap-recovery/package.json +0 -9
- package/templates/universal-buildchain-bootstrap-recovery.yml +0 -115
|
@@ -42,7 +42,7 @@ function usage() {
|
|
|
42
42
|
buildchain paper alpha [--cwd <dir>] [--source-ref <ref>] [--target-ref <ref>]
|
|
43
43
|
[--execute] [--json]
|
|
44
44
|
buildchain paper status [--cwd <dir>] [--json]
|
|
45
|
-
buildchain paper resume [--cwd <dir>] [--
|
|
45
|
+
buildchain paper resume [--cwd <dir>] [--runtime-ref <ref>]
|
|
46
46
|
[--execute] [--json]
|
|
47
47
|
|
|
48
48
|
Safety:
|
|
@@ -389,7 +389,7 @@ function executeAlphaPlan(plan) {
|
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
function executeResumePlan(plan,
|
|
392
|
+
function executeResumePlan(plan, runtimeRef) {
|
|
393
393
|
if (!plan.resumable || !plan.transaction?.targetRef) {
|
|
394
394
|
return {
|
|
395
395
|
...plan,
|
|
@@ -404,8 +404,8 @@ function executeResumePlan(plan, buildchainRef) {
|
|
|
404
404
|
"--ref",
|
|
405
405
|
plan.transaction.targetRef,
|
|
406
406
|
];
|
|
407
|
-
if (
|
|
408
|
-
args.push("-f", `
|
|
407
|
+
if (runtimeRef) {
|
|
408
|
+
args.push("-f", `runtime-ref=${runtimeRef}`);
|
|
409
409
|
}
|
|
410
410
|
const dispatched = commandResult("gh", args, { cwd: plan.cwd });
|
|
411
411
|
if (!dispatched.ok) {
|
|
@@ -569,10 +569,10 @@ export async function runPaperCli(
|
|
|
569
569
|
? executeAlphaPlan(plan)
|
|
570
570
|
: plan;
|
|
571
571
|
} else if (command === "resume") {
|
|
572
|
-
const runtimeRef = readFlag(effectiveArgs, "
|
|
572
|
+
const runtimeRef = readFlag(effectiveArgs, "runtime-ref", "");
|
|
573
573
|
const plan = createPaperResumePlan({
|
|
574
574
|
cwd,
|
|
575
|
-
|
|
575
|
+
runtimeRef,
|
|
576
576
|
});
|
|
577
577
|
result = hasFlag(effectiveArgs, "execute")
|
|
578
578
|
? executeResumePlan(plan, runtimeRef)
|
|
@@ -133,7 +133,7 @@ export function createPaperAlphaPlan({
|
|
|
133
133
|
}
|
|
134
134
|
export function createPaperResumePlan({
|
|
135
135
|
cwd = process.cwd(),
|
|
136
|
-
|
|
136
|
+
runtimeRef = "",
|
|
137
137
|
} = {}) {
|
|
138
138
|
const resolvedCwd = path.resolve(cwd);
|
|
139
139
|
const status = collectPaperStatus({ cwd: resolvedCwd });
|
|
@@ -179,7 +179,7 @@ export function createPaperResumePlan({
|
|
|
179
179
|
const command = [
|
|
180
180
|
"gh workflow run .github/workflows/public-release-paper.yml",
|
|
181
181
|
targetRef ? `--ref ${targetRef}` : "",
|
|
182
|
-
|
|
182
|
+
runtimeRef ? `-f runtime-ref=${runtimeRef}` : "",
|
|
183
183
|
]
|
|
184
184
|
.filter(Boolean)
|
|
185
185
|
.join(" ");
|
|
@@ -51,7 +51,7 @@ export function validatePaperProvisioningAuthority(cwd) {
|
|
|
51
51
|
}
|
|
52
52
|
if (
|
|
53
53
|
!GIT_SHA_PATTERN.test(String(value.runtime?.resolvedSha || "")) ||
|
|
54
|
-
|
|
54
|
+
!floating ||
|
|
55
55
|
value.admission?.acceptedRef !== value.runtime?.ref ||
|
|
56
56
|
value.admission?.acceptedSha !== value.runtime?.resolvedSha
|
|
57
57
|
) {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { nextDevelopmentWorkflowHeader } from "../../release/next-development-projection.js";
|
|
2
2
|
export function scaffoldBuildWorkflow(
|
|
3
|
-
|
|
3
|
+
entryRef,
|
|
4
4
|
{ artifactName = "paper-publication" } = {},
|
|
5
5
|
) {
|
|
6
6
|
return `${nextDevelopmentWorkflowHeader()}name: Build
|
|
7
7
|
|
|
8
8
|
on:
|
|
9
9
|
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
runtime-ref:
|
|
12
|
+
description: Transient execution runtime; empty selects the consumer lock.
|
|
13
|
+
required: false
|
|
14
|
+
default: ""
|
|
10
15
|
pull_request:
|
|
11
16
|
push:
|
|
12
17
|
branches:
|
|
@@ -20,16 +25,16 @@ permissions:
|
|
|
20
25
|
|
|
21
26
|
jobs:
|
|
22
27
|
publication:
|
|
23
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-build-publication.yml@${
|
|
28
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-build-publication.yml@${entryRef}
|
|
24
29
|
with:
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
31
|
+
contract-lock: .buildchain/contract-lock.json
|
|
27
32
|
toolchain-type: config
|
|
28
33
|
verify-command: make check
|
|
29
34
|
artifact-name: ${JSON.stringify(artifactName)}
|
|
30
35
|
`;
|
|
31
36
|
}
|
|
32
|
-
export function scaffoldVerifyWorkflow(
|
|
37
|
+
export function scaffoldVerifyWorkflow(entryRef) {
|
|
33
38
|
return `${nextDevelopmentWorkflowHeader()}name: Verify
|
|
34
39
|
|
|
35
40
|
on:
|
|
@@ -40,21 +45,28 @@ on:
|
|
|
40
45
|
- "alpha/v*/v*"
|
|
41
46
|
- "release/v*/v*"
|
|
42
47
|
workflow_dispatch:
|
|
48
|
+
inputs:
|
|
49
|
+
runtime-ref:
|
|
50
|
+
description: Transient execution runtime; empty selects the consumer lock.
|
|
51
|
+
required: false
|
|
52
|
+
default: ""
|
|
43
53
|
|
|
44
54
|
permissions:
|
|
45
|
-
|
|
55
|
+
actions: read
|
|
56
|
+
contents: read
|
|
57
|
+
pull-requests: read
|
|
46
58
|
|
|
47
59
|
jobs:
|
|
48
60
|
check:
|
|
49
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-build-check.yml@${
|
|
61
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-build-check.yml@${entryRef}
|
|
50
62
|
with:
|
|
51
|
-
|
|
63
|
+
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
52
64
|
require-version-state: true
|
|
53
65
|
upload-artifacts: true
|
|
54
66
|
`;
|
|
55
67
|
}
|
|
56
68
|
export function scaffoldReleaseWorkflow(
|
|
57
|
-
|
|
69
|
+
entryRef,
|
|
58
70
|
{ artifactPaths = "_build/main.pdf", releasePassportProductName = "" } = {},
|
|
59
71
|
) {
|
|
60
72
|
const passportInput = releasePassportProductName
|
|
@@ -64,6 +76,11 @@ export function scaffoldReleaseWorkflow(
|
|
|
64
76
|
|
|
65
77
|
on:
|
|
66
78
|
workflow_dispatch:
|
|
79
|
+
inputs:
|
|
80
|
+
runtime-ref:
|
|
81
|
+
description: Transient execution runtime; empty selects the consumer lock.
|
|
82
|
+
required: false
|
|
83
|
+
default: ""
|
|
67
84
|
push:
|
|
68
85
|
branches:
|
|
69
86
|
- "alpha/**"
|
|
@@ -74,7 +91,7 @@ permissions:
|
|
|
74
91
|
|
|
75
92
|
jobs:
|
|
76
93
|
paper-release:
|
|
77
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-paper.yml@${
|
|
94
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-paper.yml@${entryRef}
|
|
78
95
|
permissions:
|
|
79
96
|
actions: read
|
|
80
97
|
checks: write
|
|
@@ -83,8 +100,8 @@ jobs:
|
|
|
83
100
|
issues: write
|
|
84
101
|
pull-requests: write
|
|
85
102
|
with:
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
104
|
+
contract-lock: .buildchain/contract-lock.json
|
|
88
105
|
publisher-workflow-path: .github/workflows/public-release-paper.yml
|
|
89
106
|
toolchain-type: config
|
|
90
107
|
verify-command: make check
|
|
@@ -77,17 +77,14 @@ export function scaffoldFiles({
|
|
|
77
77
|
acceptedAt,
|
|
78
78
|
});
|
|
79
79
|
const contractLockText = jsonText(contractLock);
|
|
80
|
-
const buildWorkflow = scaffoldBuildWorkflow(
|
|
80
|
+
const buildWorkflow = scaffoldBuildWorkflow("v4-alpha", {
|
|
81
81
|
artifactName: name,
|
|
82
82
|
});
|
|
83
|
-
const releaseWorkflow = scaffoldReleaseWorkflow(
|
|
83
|
+
const releaseWorkflow = scaffoldReleaseWorkflow("v4-alpha", {
|
|
84
84
|
artifactPaths: "_build/main.pdf",
|
|
85
85
|
releasePassportProductName: title,
|
|
86
86
|
});
|
|
87
|
-
const verifyWorkflow = scaffoldVerifyWorkflow(
|
|
88
|
-
buildchainSha,
|
|
89
|
-
buildchainVersion,
|
|
90
|
-
);
|
|
87
|
+
const verifyWorkflow = scaffoldVerifyWorkflow("v4-alpha");
|
|
91
88
|
const agentEntry = paperAgentEntryFiles({
|
|
92
89
|
cwd,
|
|
93
90
|
buildchainVersion,
|
|
@@ -109,7 +106,7 @@ export function scaffoldFiles({
|
|
|
109
106
|
agentInstructions: agentEntry.get(PAPER_PATHS.agentInstructions),
|
|
110
107
|
});
|
|
111
108
|
const licenseText = runtimeLicenseText(buildchainRoot);
|
|
112
|
-
|
|
109
|
+
const files = new Map([
|
|
113
110
|
[
|
|
114
111
|
PAPER_PATHS.config,
|
|
115
112
|
scaffoldConfig({
|
|
@@ -155,6 +152,15 @@ export function scaffoldFiles({
|
|
|
155
152
|
"node_modules/\n_build/\n.buildchain/publication/\n.buildchain/release-state/\n.buildchain/release-evidence/\n.buildchain/paper/npm-bootstrap.json\n.buildchain/paper/npm-trust.json\n",
|
|
156
153
|
],
|
|
157
154
|
]);
|
|
155
|
+
return finalizePaperEntryFiles({
|
|
156
|
+
files,
|
|
157
|
+
cwd,
|
|
158
|
+
buildchainRoot,
|
|
159
|
+
buildchainVersion,
|
|
160
|
+
buildchainSha,
|
|
161
|
+
contractLock,
|
|
162
|
+
provisioningAuthority,
|
|
163
|
+
});
|
|
158
164
|
}
|
|
159
165
|
export function migrationFiles({
|
|
160
166
|
cwd,
|
|
@@ -207,17 +213,14 @@ export function migrationFiles({
|
|
|
207
213
|
runtimeSha,
|
|
208
214
|
});
|
|
209
215
|
const contractLockText = jsonText(contractLock);
|
|
210
|
-
const buildWorkflow = scaffoldBuildWorkflow(
|
|
216
|
+
const buildWorkflow = scaffoldBuildWorkflow("v4-alpha", {
|
|
211
217
|
artifactName: config.project.name,
|
|
212
218
|
});
|
|
213
|
-
const releaseWorkflow = scaffoldReleaseWorkflow(
|
|
219
|
+
const releaseWorkflow = scaffoldReleaseWorkflow("v4-alpha", {
|
|
214
220
|
artifactPaths: config.publication.artifactPaths.join(","),
|
|
215
221
|
releasePassportProductName: config.publication.title,
|
|
216
222
|
});
|
|
217
|
-
const verifyWorkflow = scaffoldVerifyWorkflow(
|
|
218
|
-
runtimeSha,
|
|
219
|
-
runtimeIdentity.version,
|
|
220
|
-
);
|
|
223
|
+
const verifyWorkflow = scaffoldVerifyWorkflow("v4-alpha");
|
|
221
224
|
const agentEntry = paperAgentEntryFiles({
|
|
222
225
|
cwd,
|
|
223
226
|
buildchainVersion: runtimeIdentity.version,
|
|
@@ -275,62 +278,17 @@ export function migrationFiles({
|
|
|
275
278
|
),
|
|
276
279
|
],
|
|
277
280
|
]);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
for (const channel of Object.values(channelPlan.channels))
|
|
290
|
-
files.set(channel.lockPath, channel.content);
|
|
291
|
-
for (const workflowPath of [
|
|
292
|
-
PAPER_PATHS.buildWorkflow,
|
|
293
|
-
PAPER_PATHS.verifyWorkflow,
|
|
294
|
-
]) {
|
|
295
|
-
files.set(
|
|
296
|
-
workflowPath,
|
|
297
|
-
files
|
|
298
|
-
.get(workflowPath)
|
|
299
|
-
.replaceAll(runtimeSha, "v4-alpha")
|
|
300
|
-
.replaceAll(
|
|
301
|
-
".buildchain/contract-lock.json",
|
|
302
|
-
".buildchain/alpha-contract-lock.json",
|
|
303
|
-
),
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
const releaseStart = releaseWorkflow.indexOf(" paper-release:\n");
|
|
307
|
-
const releaseJob = releaseWorkflow.slice(releaseStart);
|
|
308
|
-
const alphaJob = releaseJob
|
|
309
|
-
.replace(
|
|
310
|
-
" paper-release:\n",
|
|
311
|
-
" paper-release-alpha:\n if: ${{ startsWith(github.ref_name, 'alpha/') }}\n",
|
|
312
|
-
)
|
|
313
|
-
.replaceAll(runtimeSha, "v4-alpha")
|
|
314
|
-
.replaceAll(
|
|
315
|
-
".buildchain/contract-lock.json",
|
|
316
|
-
".buildchain/alpha-contract-lock.json",
|
|
317
|
-
);
|
|
318
|
-
const stableJob = releaseJob
|
|
319
|
-
.replace(
|
|
320
|
-
" paper-release:\n",
|
|
321
|
-
" paper-release:\n if: ${{ startsWith(github.ref_name, 'release/') }}\n",
|
|
322
|
-
)
|
|
323
|
-
.replaceAll(runtimeSha, "v4");
|
|
324
|
-
files.set(
|
|
325
|
-
PAPER_PATHS.releaseWorkflow,
|
|
326
|
-
`${releaseWorkflow.slice(0, releaseStart)}${alphaJob}\n${stableJob}`,
|
|
327
|
-
);
|
|
328
|
-
files.set(
|
|
329
|
-
PAPER_PATHS.provisioningAuthority,
|
|
330
|
-
jsonText(bindPaperAuthority(provisioningAuthority, channelPlan, files)),
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
return files;
|
|
281
|
+
return finalizePaperEntryFiles({
|
|
282
|
+
files,
|
|
283
|
+
cwd,
|
|
284
|
+
buildchainRoot,
|
|
285
|
+
buildchainVersion: runtimeIdentity.version,
|
|
286
|
+
buildchainSha: runtimeSha,
|
|
287
|
+
contractLock,
|
|
288
|
+
provisioningAuthority,
|
|
289
|
+
stableBuildchainRoot,
|
|
290
|
+
alphaBuildchainRoot,
|
|
291
|
+
});
|
|
334
292
|
}
|
|
335
293
|
export const {
|
|
336
294
|
planPaperMigration,
|
|
@@ -368,3 +326,73 @@ function migrationContractLock({
|
|
|
368
326
|
),
|
|
369
327
|
});
|
|
370
328
|
}
|
|
329
|
+
|
|
330
|
+
function finalizePaperEntryFiles({
|
|
331
|
+
files,
|
|
332
|
+
cwd,
|
|
333
|
+
buildchainRoot,
|
|
334
|
+
buildchainVersion,
|
|
335
|
+
buildchainSha,
|
|
336
|
+
contractLock,
|
|
337
|
+
provisioningAuthority,
|
|
338
|
+
stableBuildchainRoot,
|
|
339
|
+
alphaBuildchainRoot,
|
|
340
|
+
}) {
|
|
341
|
+
if (!buildchainVersion.startsWith("4."))
|
|
342
|
+
throw new Error("Paper provisioning requires a Buildchain v4 runtime");
|
|
343
|
+
const channelPlan = paperChannels({
|
|
344
|
+
cwd,
|
|
345
|
+
buildchainRoot,
|
|
346
|
+
buildchainVersion: buildchainVersion,
|
|
347
|
+
buildchainSha: buildchainSha,
|
|
348
|
+
contractWorld: runtimeContractWorld(buildchainRoot),
|
|
349
|
+
acceptedAt: contractLock.buildchain.acceptedAt,
|
|
350
|
+
stableBuildchainRoot,
|
|
351
|
+
alphaBuildchainRoot,
|
|
352
|
+
});
|
|
353
|
+
for (const channel of Object.values(channelPlan.channels))
|
|
354
|
+
files.set(channel.lockPath, channel.content);
|
|
355
|
+
for (const workflowPath of [
|
|
356
|
+
PAPER_PATHS.buildWorkflow,
|
|
357
|
+
PAPER_PATHS.verifyWorkflow,
|
|
358
|
+
]) {
|
|
359
|
+
files.set(
|
|
360
|
+
workflowPath,
|
|
361
|
+
files
|
|
362
|
+
.get(workflowPath)
|
|
363
|
+
|
|
364
|
+
.replaceAll(
|
|
365
|
+
".buildchain/contract-lock.json",
|
|
366
|
+
".buildchain/alpha-contract-lock.json",
|
|
367
|
+
),
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
const releaseWorkflow = files.get(PAPER_PATHS.releaseWorkflow);
|
|
371
|
+
const releaseStart = releaseWorkflow.indexOf(" paper-release:\n");
|
|
372
|
+
const releaseJob = releaseWorkflow.slice(releaseStart);
|
|
373
|
+
const alphaJob = releaseJob
|
|
374
|
+
.replace(
|
|
375
|
+
" paper-release:\n",
|
|
376
|
+
" paper-release-alpha:\n if: ${{ startsWith(github.ref_name, 'alpha/') }}\n",
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
.replaceAll(
|
|
380
|
+
".buildchain/contract-lock.json",
|
|
381
|
+
".buildchain/alpha-contract-lock.json",
|
|
382
|
+
);
|
|
383
|
+
const stableJob = releaseJob
|
|
384
|
+
.replace(
|
|
385
|
+
" paper-release:\n",
|
|
386
|
+
" paper-release:\n if: ${{ startsWith(github.ref_name, 'release/') }}\n",
|
|
387
|
+
)
|
|
388
|
+
.replaceAll("@v4-alpha", "@v4");
|
|
389
|
+
files.set(
|
|
390
|
+
PAPER_PATHS.releaseWorkflow,
|
|
391
|
+
`${releaseWorkflow.slice(0, releaseStart)}${alphaJob}\n${stableJob}`,
|
|
392
|
+
);
|
|
393
|
+
files.set(
|
|
394
|
+
PAPER_PATHS.provisioningAuthority,
|
|
395
|
+
jsonText(bindPaperAuthority(provisioningAuthority, channelPlan, files)),
|
|
396
|
+
);
|
|
397
|
+
return files;
|
|
398
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { paperRuntimeSourceMatches } from "./paper-runtime-channels.js";
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
PAPER_PATHS,
|
|
@@ -281,14 +280,11 @@ export function collectPaperAgentEntry({
|
|
|
281
280
|
buildchainSha = "",
|
|
282
281
|
mode = "contract",
|
|
283
282
|
env = process.env,
|
|
284
|
-
runtimeAdmission,
|
|
285
283
|
} = {}) {
|
|
286
284
|
const resolvedCwd = path.resolve(cwd);
|
|
287
285
|
const developmentRef = paperDevelopmentRef(resolvedCwd);
|
|
288
286
|
const source = readJson(path.resolve(resolvedCwd, PAPER_PATHS.agentEntry));
|
|
289
287
|
const entry = source.value || {};
|
|
290
|
-
const effectiveBuildchainSha =
|
|
291
|
-
buildchainSha || String(entry.runtime?.sourceSha || "");
|
|
292
288
|
const packageJson =
|
|
293
289
|
readJson(path.resolve(resolvedCwd, "package.json")).value || {};
|
|
294
290
|
const pinPath = path.resolve(resolvedCwd, PAPER_PATHS.versionPin);
|
|
@@ -334,13 +330,6 @@ export function collectPaperAgentEntry({
|
|
|
334
330
|
"The agent-entry contract, version pin, and exact Buildchain dependency agree.",
|
|
335
331
|
"buildchain paper migrate --write --json && pnpm install --lockfile-only",
|
|
336
332
|
),
|
|
337
|
-
workCheck(
|
|
338
|
-
"agent-entry.runtime-source",
|
|
339
|
-
GIT_SHA_PATTERN.test(effectiveBuildchainSha) &&
|
|
340
|
-
paperRuntimeSourceMatches(entry.runtime, effectiveBuildchainSha, mode, runtimeAdmission),
|
|
341
|
-
"The executing Buildchain source is pinned locally or admitted by its v4 channel contract in CI.",
|
|
342
|
-
"buildchain paper migrate --write --json",
|
|
343
|
-
),
|
|
344
333
|
workCheck(
|
|
345
334
|
"agent-entry.development-ref",
|
|
346
335
|
entry.repository?.developmentRef === developmentRef &&
|
|
@@ -3,7 +3,6 @@ import path from "node:path";
|
|
|
3
3
|
import {
|
|
4
4
|
createBuildchainContractLock,
|
|
5
5
|
createBuildchainContractWorld,
|
|
6
|
-
finalizeBuildchainContractWorld,
|
|
7
6
|
readBuildchainContractWorld,
|
|
8
7
|
} from "../contracts/buildchain-contract.js";
|
|
9
8
|
import {
|
|
@@ -94,12 +93,10 @@ function workflowErrors(cwd, authority, workflow) {
|
|
|
94
93
|
return ["paper workflow authority is incomplete"];
|
|
95
94
|
if (!fileDigestMatches(cwd, workflow.path, workflow.sourceDigest))
|
|
96
95
|
return [`paper workflow source digest mismatch: ${workflow.path}`];
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
? workflow.reusablePath === ".github/workflows/public-release-paper.yml"
|
|
96
|
+
const refs =
|
|
97
|
+
workflow.reusablePath === ".github/workflows/public-release-paper.yml"
|
|
100
98
|
? ["v4-alpha", "v4"]
|
|
101
|
-
: ["v4-alpha"]
|
|
102
|
-
: [authority.runtime.resolvedSha];
|
|
99
|
+
: ["v4-alpha"];
|
|
103
100
|
const text = fs.readFileSync(path.resolve(cwd, workflow.path), "utf8");
|
|
104
101
|
const errors = [];
|
|
105
102
|
if (
|
|
@@ -113,13 +110,11 @@ function workflowErrors(cwd, authority, workflow) {
|
|
|
113
110
|
errors.push(
|
|
114
111
|
`paper workflow reusable source is not exact: ${workflow.path}`,
|
|
115
112
|
);
|
|
113
|
+
if (/^\s*buildchain-ref:/mu.test(text))
|
|
114
|
+
errors.push(
|
|
115
|
+
`paper workflow has a retired runtime selector: ${workflow.path}`,
|
|
116
|
+
);
|
|
116
117
|
if (
|
|
117
|
-
(floating || workflow.reusablePath !== ".github/workflows/public-build-check.yml") &&
|
|
118
|
-
refs.some((ref) => !text.includes(`buildchain-ref: ${ref}\n`))
|
|
119
|
-
)
|
|
120
|
-
errors.push(`paper workflow runtime input is not exact: ${workflow.path}`);
|
|
121
|
-
if (
|
|
122
|
-
floating &&
|
|
123
118
|
[
|
|
124
119
|
...text.matchAll(/uses:\s*kungfu-systems\/buildchain\/[^\s@]+@([^\s]+)/g),
|
|
125
120
|
].some((match) => !refs.includes(match[1]))
|
|
@@ -161,7 +156,7 @@ export function paperProvisioningWorkflowErrors(cwd, authority) {
|
|
|
161
156
|
)
|
|
162
157
|
)
|
|
163
158
|
errors.push("paper contract lock bytes differ from provisioning authority");
|
|
164
|
-
|
|
159
|
+
{
|
|
165
160
|
for (const [ref, lockPath] of [
|
|
166
161
|
["v4", ".buildchain/contract-lock.json"],
|
|
167
162
|
["v4-alpha", PAPER_ALPHA_LOCK],
|
|
@@ -175,24 +170,19 @@ export function paperProvisioningWorkflowErrors(cwd, authority) {
|
|
|
175
170
|
return errors;
|
|
176
171
|
}
|
|
177
172
|
|
|
178
|
-
export function paperRuntimeSourceMatches(runtime, sha, mode, admission) {
|
|
179
|
-
return (
|
|
180
|
-
runtime?.sourceSha === sha ||
|
|
181
|
-
(mode === "ci" &&
|
|
182
|
-
/^4\./.test(runtime?.version || "") &&
|
|
183
|
-
([runtime?.channels?.v4, runtime?.channels?.["v4-alpha"]].includes(sha) ||
|
|
184
|
-
(admission?.compatible === true &&
|
|
185
|
-
admission.sha === sha &&
|
|
186
|
-
/^v4(?:-alpha)?$/.test(admission.ref))))
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
173
|
export function selectPaperRuntime(runtime, authority) {
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
|
|
174
|
+
const preferredRef =
|
|
175
|
+
authority?.runtime?.ref ||
|
|
176
|
+
(runtime.version.includes("-") ? "v4-alpha" : "v4");
|
|
177
|
+
const channels = authority?.admission?.channels || {};
|
|
178
|
+
const preferred = channels[preferredRef];
|
|
179
|
+
const channel =
|
|
180
|
+
preferred?.resolvedSha === runtime.resolvedSha
|
|
181
|
+
? preferred
|
|
182
|
+
: Object.values(channels).find(
|
|
183
|
+
(entry) => entry.resolvedSha === runtime.resolvedSha,
|
|
184
|
+
);
|
|
185
|
+
const ref = channel?.ref || preferredRef;
|
|
196
186
|
return authority?.admission?.channels?.[ref] ? { ...runtime, ref } : runtime;
|
|
197
187
|
}
|
|
198
188
|
|
|
@@ -204,39 +194,6 @@ export function paperRuntimeLockPath(cwd, runtime, authority) {
|
|
|
204
194
|
);
|
|
205
195
|
}
|
|
206
196
|
|
|
207
|
-
function channelWorld(root, ref, current) {
|
|
208
|
-
if (current) return current;
|
|
209
|
-
const sha = gitValue(root, [
|
|
210
|
-
"rev-parse",
|
|
211
|
-
"--verify",
|
|
212
|
-
`refs/tags/${ref}^{commit}`,
|
|
213
|
-
]);
|
|
214
|
-
const text =
|
|
215
|
-
sha &&
|
|
216
|
-
gitValue(root, ["show", `${sha}:dist/site/buildchain-contract.json`]);
|
|
217
|
-
if (!/^[0-9a-f]{40}$/.test(sha) || !text) {
|
|
218
|
-
throw new Error(
|
|
219
|
-
`Paper migration needs the fetched ${ref} tag or an explicit ${ref === "v4" ? "stable" : "alpha"} Buildchain root`,
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
const published = JSON.parse(text);
|
|
223
|
-
if (!Array.isArray(published.compatibilityFacts)) {
|
|
224
|
-
throw new Error(`Paper ${ref} needs the current Buildchain contract format`);
|
|
225
|
-
}
|
|
226
|
-
const world = finalizeBuildchainContractWorld(published);
|
|
227
|
-
if (
|
|
228
|
-
published.contractDigest !== world.contractDigest ||
|
|
229
|
-
published.compatibilityDigest !== world.compatibilityDigest
|
|
230
|
-
) {
|
|
231
|
-
throw new Error(`Paper ${ref} contract digest mismatch`);
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
sha,
|
|
235
|
-
world,
|
|
236
|
-
acceptedAt: gitValue(root, ["show", "-s", "--format=%cI", sha]),
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
197
|
function explicitWorld(root, ref) {
|
|
241
198
|
const sha = gitValue(root, ["rev-parse", "HEAD"]);
|
|
242
199
|
if (!/^[0-9a-f]{40}$/.test(sha))
|
|
@@ -281,9 +238,7 @@ export function paperChannels({
|
|
|
281
238
|
["v4", ".buildchain/contract-lock.json", stableBuildchainRoot],
|
|
282
239
|
["v4-alpha", PAPER_ALPHA_LOCK, alphaBuildchainRoot],
|
|
283
240
|
]) {
|
|
284
|
-
const resolved = explicitRoot
|
|
285
|
-
? explicitWorld(explicitRoot, ref)
|
|
286
|
-
: channelWorld(buildchainRoot, ref, ref === selectedRef ? current : null);
|
|
241
|
+
const resolved = explicitRoot ? explicitWorld(explicitRoot, ref) : current;
|
|
287
242
|
if (resolved.world.majorLine !== "v4")
|
|
288
243
|
throw new Error(`Paper ${ref} contract must belong to v4`);
|
|
289
244
|
const existing = readJson(path.join(cwd, lockPath)).value;
|
|
@@ -181,7 +181,7 @@ function planPaperScaffold(
|
|
|
181
181
|
cwd = process.cwd(),
|
|
182
182
|
buildchainRoot = process.cwd(),
|
|
183
183
|
buildchainVersion = "",
|
|
184
|
-
buildchainRef = "
|
|
184
|
+
buildchainRef = "v4",
|
|
185
185
|
buildchainSha = "",
|
|
186
186
|
name = path.basename(path.resolve(cwd)),
|
|
187
187
|
title = "",
|
|
@@ -43,6 +43,15 @@ import {
|
|
|
43
43
|
paperPreflightPublicationChecks,
|
|
44
44
|
paperPreflightNextActions,
|
|
45
45
|
} from "./operations/preflight-checks.js";
|
|
46
|
+
export function collectPaperSourcePolicy({ cwd = process.cwd() } = {}) {
|
|
47
|
+
const agentEntry = collectPaperAgentEntry({ cwd, mode: "ci" });
|
|
48
|
+
const provisioning = validatePaperProvisioningAuthority(cwd);
|
|
49
|
+
const checks = [...agentEntry.checks, { id: "provisioning.authority", status: provisioning.valid ? "pass" : "fail", message: provisioning.errors.join("; ") }];
|
|
50
|
+
try { validateBuildchainConfig(cwd, { requireLifecycleStages: ["verify"] }); }
|
|
51
|
+
catch (error) { checks.push({ id: "config.publication", status: "fail", message: error.message }); }
|
|
52
|
+
return { ok: checks.every(check => check.status === "pass" || check.status === "skip"), checks };
|
|
53
|
+
}
|
|
54
|
+
|
|
46
55
|
export function collectPaperPreflight({
|
|
47
56
|
cwd = process.cwd(),
|
|
48
57
|
buildchainRoot = process.cwd(),
|
|
@@ -110,11 +119,6 @@ export function collectPaperPreflight({
|
|
|
110
119
|
cwd: resolvedCwd,
|
|
111
120
|
buildchainSha: runtime.resolvedSha,
|
|
112
121
|
mode: agentEntryMode,
|
|
113
|
-
runtimeAdmission: {
|
|
114
|
-
compatible: lockEvaluation.compatible,
|
|
115
|
-
sha: runtime.resolvedSha,
|
|
116
|
-
ref: runtime.ref,
|
|
117
|
-
},
|
|
118
122
|
});
|
|
119
123
|
const source = {
|
|
120
124
|
repositoryRoot: gitValue(resolvedCwd, ["rev-parse", "--show-toplevel"]),
|
|
@@ -32,15 +32,6 @@ export function verifyAdmittedCandidate({
|
|
|
32
32
|
})
|
|
33
33
|
.trim()
|
|
34
34
|
.toLowerCase();
|
|
35
|
-
const actualRuntimeSha = execFileSync(
|
|
36
|
-
"git",
|
|
37
|
-
["-C", runtimeRoot, "rev-parse", "HEAD"],
|
|
38
|
-
{ encoding: "utf8" },
|
|
39
|
-
)
|
|
40
|
-
.trim()
|
|
41
|
-
.toLowerCase();
|
|
42
|
-
if (actualRuntimeSha !== runtimeSha)
|
|
43
|
-
throw new Error("admitted paper runtime checkout mismatch");
|
|
44
35
|
const bundle = buildPublicationArtifactCandidate({
|
|
45
36
|
artifactRoot: root,
|
|
46
37
|
controllerRoot: path.join(workspace, ".buildchain/admitted/controller"),
|
|
@@ -9,14 +9,12 @@ import { requireValue } from "../runtime/action-process.mjs";
|
|
|
9
9
|
function requireCandidate(receipt, source, runtime) {
|
|
10
10
|
const result = validateControllerReceipt(receipt, {
|
|
11
11
|
expectedSourceSha: source.sha,
|
|
12
|
-
expectedRuntimeSha: runtime.sha,
|
|
13
12
|
});
|
|
14
13
|
requireValue(
|
|
15
14
|
result.qualifying &&
|
|
16
15
|
receipt.controller.id === "publication-artifact" &&
|
|
17
|
-
receipt.source.repository === source.repository
|
|
18
|
-
|
|
19
|
-
"Paper candidate controller must qualify for the exact source and runtime",
|
|
16
|
+
receipt.source.repository === source.repository,
|
|
17
|
+
"Paper candidate controller must qualify for the exact source",
|
|
20
18
|
);
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -12,7 +12,7 @@ export function verifyArtifactAttestationSigner(request, execute = command) {
|
|
|
12
12
|
"--signer-workflow",
|
|
13
13
|
"kungfu-systems/buildchain/.github/workflows/public-release-artifact-attestation.yml",
|
|
14
14
|
"--signer-digest",
|
|
15
|
-
request.
|
|
15
|
+
request.signerDigest,
|
|
16
16
|
"--source-digest",
|
|
17
17
|
request.sourceSha,
|
|
18
18
|
"--predicate-type",
|