@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
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { installationRoot } from "../runtime/installation-root.js";
|
|
2
|
-
import {
|
|
3
|
-
SOURCE_OWNED_PROMOTION,
|
|
4
|
-
verifyWorkflowDefinition,
|
|
5
|
-
} from "./workflow-definition-authority.js";
|
|
6
2
|
import crypto from "node:crypto";
|
|
7
3
|
import fs from "node:fs";
|
|
8
4
|
import path from "node:path";
|
|
@@ -33,15 +29,12 @@ const BUILDCHAIN_REPOSITORY = "kungfu-systems/buildchain";
|
|
|
33
29
|
const CHANNELS = Object.freeze({ v4: "stable", "v4-alpha": "alpha" });
|
|
34
30
|
const DEFAULT_STABLE_LOCK_PATH = ".buildchain/contract-lock.json";
|
|
35
31
|
const DEFAULT_ALPHA_LOCK_PATH = ".buildchain/alpha-contract-lock.json";
|
|
36
|
-
const TRANSIENT_ACTION =
|
|
37
|
-
/^\.\/\.buildchain\/(?:runtime|workflow-shell|attester-runtime|release-tail-runtime)\//u;
|
|
32
|
+
const TRANSIENT_ACTION = /^\.\/\.buildchain\/runtime\//u;
|
|
38
33
|
const SCANNER_PATHS = Object.freeze([
|
|
39
34
|
"architecture/floating-consumer-policy.json",
|
|
40
35
|
"contracts/v4-floating-consumer-policy-receipt-v1.schema.json",
|
|
41
36
|
"packages/core/contracts/buildchain-contract.js",
|
|
42
37
|
"packages/core/consumer/floating-consumer-policy.js",
|
|
43
|
-
"packages/core/consumer/workflow-definition-authority.js",
|
|
44
|
-
"packages/core/consumer/invocation-selector.js",
|
|
45
38
|
"packages/core/consumer/floating-consumer-evidence.js",
|
|
46
39
|
"packages/core/contracts/workflow-yaml-contract.js",
|
|
47
40
|
"packages/core/consumer/commands/consumer-policy.mjs",
|
|
@@ -259,11 +252,7 @@ function validateScanIdentity(
|
|
|
259
252
|
{ repository, sourceSha, runtimeSha, workflowSha },
|
|
260
253
|
failures,
|
|
261
254
|
) {
|
|
262
|
-
for (const [value, code] of [
|
|
263
|
-
[sourceSha, "caller-source-sha-invalid"],
|
|
264
|
-
[runtimeSha, "resolved-runtime-sha-invalid"],
|
|
265
|
-
[workflowSha, "resolved-workflow-sha-invalid"],
|
|
266
|
-
])
|
|
255
|
+
for (const [value, code] of [[sourceSha, "caller-source-sha-invalid"]])
|
|
267
256
|
if (!EXACT_SHA.test(value))
|
|
268
257
|
failures.push({ code, message: `${code} must bind an exact commit` });
|
|
269
258
|
if (!repository || !/^[^/]+\/[^/]+$/u.test(repository))
|
|
@@ -290,20 +279,6 @@ function classifyBuildchainUses(
|
|
|
290
279
|
) {
|
|
291
280
|
const uses = [];
|
|
292
281
|
for (const record of records) {
|
|
293
|
-
if (
|
|
294
|
-
record.uses === `./${SOURCE_OWNED_PROMOTION.workflow}` &&
|
|
295
|
-
repository === BUILDCHAIN_REPOSITORY
|
|
296
|
-
) {
|
|
297
|
-
uses.push({
|
|
298
|
-
...record,
|
|
299
|
-
repository,
|
|
300
|
-
path: SOURCE_OWNED_PROMOTION.workflow,
|
|
301
|
-
selector: record.uses,
|
|
302
|
-
channel,
|
|
303
|
-
selectorClass: "repository-local",
|
|
304
|
-
});
|
|
305
|
-
continue;
|
|
306
|
-
}
|
|
307
282
|
const parsed = coordinate(record.uses);
|
|
308
283
|
if (!parsed || parsed.repository !== BUILDCHAIN_REPOSITORY) continue;
|
|
309
284
|
const selectedChannel = CHANNELS[parsed.selector] || "";
|
|
@@ -390,45 +365,6 @@ function sourceScanRoot({
|
|
|
390
365
|
return sha256(stableJson(material));
|
|
391
366
|
}
|
|
392
367
|
|
|
393
|
-
function verifySelectedLock({
|
|
394
|
-
selected,
|
|
395
|
-
stable,
|
|
396
|
-
alpha,
|
|
397
|
-
workflowSha,
|
|
398
|
-
failures,
|
|
399
|
-
}) {
|
|
400
|
-
// Repository-local composition is qualified by exact definition identity, not
|
|
401
|
-
// compatibility with a previously published floating-channel API. Both consumer
|
|
402
|
-
// lock roots remain required evidence for the product's external dependencies.
|
|
403
|
-
if (selected?.selectorClass === "repository-local") return;
|
|
404
|
-
const selectedLock = selected?.channel === "alpha" ? alpha : stable;
|
|
405
|
-
if (!selected?.channel || !selectedLock) return;
|
|
406
|
-
const authorityRef = selected.selector;
|
|
407
|
-
try {
|
|
408
|
-
const compatibility = evaluateBuildchainContractLock({
|
|
409
|
-
lock: selectedLock,
|
|
410
|
-
current: createBuildchainContractWorld({ root: defaultRuntimeRoot() }),
|
|
411
|
-
runtimeRef: authorityRef,
|
|
412
|
-
runtimeSha: workflowSha,
|
|
413
|
-
runtimeClass: selected.channel,
|
|
414
|
-
workflowShellRef: authorityRef,
|
|
415
|
-
expectedChannel: selected.channel,
|
|
416
|
-
expectedMajor: "v4",
|
|
417
|
-
});
|
|
418
|
-
if (!compatibility.ok) {
|
|
419
|
-
failures.push({
|
|
420
|
-
code: "selected-lock-runtime-incompatible",
|
|
421
|
-
message: `${selected.channel} contract lock rejects resolved workflow shell ${workflowSha}: ${compatibility.reasons?.join("; ") || compatibility.status}`,
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
} catch (error) {
|
|
425
|
-
failures.push({
|
|
426
|
-
code: "selected-lock-contract-world-invalid",
|
|
427
|
-
message: `cannot evaluate ${selected.channel} contract lock against the resolved workflow shell: ${error.message}`,
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
368
|
export function scanFloatingConsumerPolicy({
|
|
433
369
|
root = process.cwd(),
|
|
434
370
|
invocationRoot = root,
|
|
@@ -510,32 +446,6 @@ export function scanFloatingConsumerPolicy({
|
|
|
510
446
|
sourcePath,
|
|
511
447
|
expectedInvocationChannel,
|
|
512
448
|
);
|
|
513
|
-
let definition;
|
|
514
|
-
if (selected?.selectorClass === "repository-local") {
|
|
515
|
-
try {
|
|
516
|
-
definition = verifyWorkflowDefinition({
|
|
517
|
-
root: resolvedInvocationRoot,
|
|
518
|
-
repository,
|
|
519
|
-
definitionRepository,
|
|
520
|
-
definitionSha,
|
|
521
|
-
workflowSha: normalizedWorkflowSha,
|
|
522
|
-
files: invocationScan.files,
|
|
523
|
-
});
|
|
524
|
-
} catch (error) {
|
|
525
|
-
failures.push({
|
|
526
|
-
code: "invocation-definition-invalid",
|
|
527
|
-
message: error.message,
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
verifySelectedLock({
|
|
532
|
-
selected,
|
|
533
|
-
stable,
|
|
534
|
-
alpha,
|
|
535
|
-
workflowSha: normalizedWorkflowSha,
|
|
536
|
-
failures,
|
|
537
|
-
});
|
|
538
|
-
|
|
539
449
|
const policyRoot = sha256(stableJson(policy));
|
|
540
450
|
const resolvedScannerRoot = scannerRoot || policyRoot;
|
|
541
451
|
if (!SHA256_ROOT.test(resolvedScannerRoot)) {
|
|
@@ -569,7 +479,6 @@ export function scanFloatingConsumerPolicy({
|
|
|
569
479
|
channel: selected?.channel || "",
|
|
570
480
|
resolvedWorkflowSha: normalizedWorkflowSha,
|
|
571
481
|
resolvedRuntimeSha: normalizedRuntimeSha,
|
|
572
|
-
...(definition ? { definition } : {}),
|
|
573
482
|
},
|
|
574
483
|
contractLocks: {
|
|
575
484
|
stable: { path: stableLockPath, root: contractLockRoots.stable },
|
|
@@ -4,10 +4,7 @@ import {
|
|
|
4
4
|
floatingConsumerDocumentRoot,
|
|
5
5
|
verifyFloatingConsumerPolicyCertification,
|
|
6
6
|
} from "./floating-consumer-evidence.js";
|
|
7
|
-
import {
|
|
8
|
-
verifyRuntimeAuthorizationReceipt,
|
|
9
|
-
verifyRuntimeResumeLineage,
|
|
10
|
-
} from "./runtime-ref-resume-authority.js";
|
|
7
|
+
import { verifyRuntimeResumeLineage } from "../release/recovery/lineage.js";
|
|
11
8
|
const SHA256_ROOT = /^sha256:[0-9a-f]{64}$/u;
|
|
12
9
|
export function isPromotionRouting(value = undefined) {
|
|
13
10
|
return [
|
|
@@ -180,17 +177,6 @@ export function normalizePromotionRouting(value = undefined) {
|
|
|
180
177
|
if (!String(field || "").trim())
|
|
181
178
|
throw new Error(`release.promotionRouting.${label} is required`);
|
|
182
179
|
}
|
|
183
|
-
for (const [label, sha] of [
|
|
184
|
-
["router.sha", value.router.sha],
|
|
185
|
-
["shell.sha", value.shell.sha],
|
|
186
|
-
["runtime.resolvedSha", value.runtime.resolvedSha],
|
|
187
|
-
]) {
|
|
188
|
-
if (!/^[0-9a-f]{40}$/i.test(String(sha))) {
|
|
189
|
-
throw new Error(
|
|
190
|
-
`release.promotionRouting.${label} must be a 40-character Git SHA`,
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
180
|
if (!/^sha256:[0-9a-f]{64}$/i.test(String(value.contractLock.digest))) {
|
|
195
181
|
throw new Error(
|
|
196
182
|
"release.promotionRouting.contractLock.digest must be a sha256 digest",
|
|
@@ -234,25 +220,11 @@ export function normalizeRuntimeResumeEvidence(value, expected = {}) {
|
|
|
234
220
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
235
221
|
throw new Error("domainRuntimeResumeEvidence must be a JSON object");
|
|
236
222
|
}
|
|
237
|
-
const authorizationVerification = verifyRuntimeAuthorizationReceipt({
|
|
238
|
-
receipt: value.authorization,
|
|
239
|
-
receiptRoot: value.authorizationRoot,
|
|
240
|
-
repository: expected.repository,
|
|
241
|
-
sourceSha: expected.sourceSha,
|
|
242
|
-
runtimeSha: expected.resumeRuntimeSha,
|
|
243
|
-
consumerPolicyReceiptRoot: expected.consumerPolicyReceiptRoot,
|
|
244
|
-
});
|
|
245
|
-
if (!authorizationVerification.ok) {
|
|
246
|
-
throw new Error(
|
|
247
|
-
`v4 runtime authorization invalid: ${authorizationVerification.failures.join(", ")}`,
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
223
|
const lineageVerification = verifyRuntimeResumeLineage({
|
|
251
224
|
lineage: value.lineage,
|
|
252
225
|
lineageRoot: value.lineageRoot,
|
|
253
226
|
repository: expected.repository,
|
|
254
227
|
sourceSha: expected.sourceSha,
|
|
255
|
-
resumeRuntimeSha: expected.resumeRuntimeSha,
|
|
256
228
|
consumerPolicyReceiptRoot: expected.consumerPolicyReceiptRoot,
|
|
257
229
|
});
|
|
258
230
|
if (!lineageVerification.ok) {
|
|
@@ -260,12 +232,7 @@ export function normalizeRuntimeResumeEvidence(value, expected = {}) {
|
|
|
260
232
|
`v4 runtime resume lineage invalid: ${lineageVerification.failures.join(", ")}`,
|
|
261
233
|
);
|
|
262
234
|
}
|
|
263
|
-
if (value.lineage?.authorizationRoot !== value.authorizationRoot) {
|
|
264
|
-
throw new Error("v4 runtime resume lineage authorization root mismatch");
|
|
265
|
-
}
|
|
266
235
|
return {
|
|
267
|
-
authorizationRoot: value.authorizationRoot,
|
|
268
|
-
authorization: structuredClone(value.authorization),
|
|
269
236
|
lineageRoot: value.lineageRoot,
|
|
270
237
|
lineage: structuredClone(value.lineage),
|
|
271
238
|
};
|
|
@@ -20,7 +20,6 @@ export function admitCheckedConsumerPolicy({
|
|
|
20
20
|
alphaLockPath = ".buildchain/alpha-contract-lock.json",
|
|
21
21
|
}) {
|
|
22
22
|
for (const [directory, expected] of [
|
|
23
|
-
[runtimeRoot, runtimeSha],
|
|
24
23
|
[consumerRoot, consumerSha],
|
|
25
24
|
]) {
|
|
26
25
|
if (
|
|
@@ -70,8 +69,7 @@ export function admitCheckedConsumerPolicyAction(core, env) {
|
|
|
70
69
|
core.getInput("directory", { required: true }),
|
|
71
70
|
),
|
|
72
71
|
runtimeSha:
|
|
73
|
-
|
|
74
|
-
core.getInput("workflow-sha", { required: true }),
|
|
72
|
+
env.BUILDCHAIN_RUNTIME_SHA,
|
|
75
73
|
workflowSha: core.getInput("workflow-sha", { required: true }),
|
|
76
74
|
consumerSha: core.getInput("source-sha") || env.GITHUB_SHA,
|
|
77
75
|
invocationRoot: core.getInput("invocation-directory")
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
+
import { parseReusableWorkflowInterface } from "./workflow-yaml-contract.js";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import {
|
|
@@ -100,6 +101,10 @@ function maybeFileDigest(root, relPath) {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
function surface(root, value) {
|
|
104
|
+
if (value.kind === "workflow" && fs.existsSync(path.join(root, value.path))) {
|
|
105
|
+
const contract = parseReusableWorkflowInterface(fs.readFileSync(path.join(root, value.path), "utf8"));
|
|
106
|
+
value = { ...value, requiredInputs: contract.inputs.filter(x => x.required).map(x => x.name), optionalInputs: contract.inputs.filter(x => !x.required).map(x => x.name), requiredOutputs: contract.outputs.map(x => typeof x === "string" ? x : x.name) };
|
|
107
|
+
}
|
|
103
108
|
const breakingModel = {
|
|
104
109
|
id: value.id,
|
|
105
110
|
kind: value.kind,
|
|
@@ -131,11 +136,6 @@ function declarativeAuditableDemoSurface(root, pkg, majorLine) {
|
|
|
131
136
|
kind: "workflow",
|
|
132
137
|
path: ".github/workflows/public-build-demo.yml",
|
|
133
138
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/public-build-demo.yml@${majorLine}`,
|
|
134
|
-
requiredInputs: ["binary-artifact-name", "binary-artifact-digest", "renderer-image"],
|
|
135
|
-
requiredOutputs: [
|
|
136
|
-
"source-sha", "capture-artifact-name", "capture-artifact-digest",
|
|
137
|
-
"evidence-artifact-name", "evidence-artifact-digest", "publication-pr-url",
|
|
138
|
-
],
|
|
139
139
|
breakingDefaults: {
|
|
140
140
|
scenarioPathDefault: ".buildchain/auditable-demo.json",
|
|
141
141
|
renderMediaDefault: false,
|
|
@@ -144,10 +144,6 @@ function declarativeAuditableDemoSurface(root, pkg, majorLine) {
|
|
|
144
144
|
artifactRetentionDaysDefault: 14,
|
|
145
145
|
executionBoundary: "exact-binary-network-none-secret-free-60-seconds",
|
|
146
146
|
},
|
|
147
|
-
optionalInputs: [
|
|
148
|
-
"buildchain-repository", "source-ref", "scenario-path", "render-media",
|
|
149
|
-
"media-profile", "materialize", "materialize-base-ref", "artifact-retention-days",
|
|
150
|
-
],
|
|
151
147
|
guarantees: [
|
|
152
148
|
"one versioned declaration can contain multiple demos with multiple ordered literal argv steps",
|
|
153
149
|
"every demo uses the exact same-run standalone binary admitted by producer-owned artifact name and digest",
|
|
@@ -222,19 +218,11 @@ export function createBuildchainContractWorld({
|
|
|
222
218
|
kind: "workflow",
|
|
223
219
|
path: ".github/workflows/.build.yml",
|
|
224
220
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/.build.yml@${majorLine}`,
|
|
225
|
-
requiredInputs: [],
|
|
226
|
-
requiredOutputs: [
|
|
227
|
-
"buildchain-runtime-sha",
|
|
228
|
-
"publish-source-sha",
|
|
229
|
-
"build-summary-artifact",
|
|
230
|
-
"release-candidate-artifact",
|
|
231
|
-
],
|
|
232
221
|
breakingDefaults: {
|
|
233
222
|
configurationAuthority: "buildchain.toml",
|
|
234
|
-
runtimeIdentity: "
|
|
223
|
+
runtimeIdentity: "entry-selected-complete-runtime",
|
|
235
224
|
projectDiscovery: "unambiguous-root-or-config-path",
|
|
236
225
|
},
|
|
237
|
-
optionalInputs: ["config-path"],
|
|
238
226
|
guarantees: [
|
|
239
227
|
"runtime floating refs are resolved to immutable SHAs before matrix jobs",
|
|
240
228
|
"publish source locks are verified before heavy build jobs",
|
|
@@ -248,18 +236,15 @@ export function createBuildchainContractWorld({
|
|
|
248
236
|
kind: "workflow",
|
|
249
237
|
path: ".github/workflows/build.yml",
|
|
250
238
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/build.yml@${majorLine}`,
|
|
251
|
-
requiredInputs: [],
|
|
252
|
-
requiredOutputs: ["buildchain-channel", "buildchain-runtime-sha", "build-summary-artifact"],
|
|
253
239
|
breakingDefaults: {
|
|
254
240
|
configurationAuthority: "buildchain.toml",
|
|
255
|
-
runtimeIdentity: "
|
|
241
|
+
runtimeIdentity: "entry-selected-complete-runtime",
|
|
256
242
|
projectDiscovery: "unambiguous-root-or-config-path",
|
|
257
243
|
},
|
|
258
|
-
optionalInputs: ["config-path"],
|
|
259
244
|
guarantees: [
|
|
260
245
|
"single-project consumers require no workflow inputs",
|
|
261
246
|
"project settings have one TOML authority and environment profiles own infrastructure",
|
|
262
|
-
"the
|
|
247
|
+
"the floating entry selects runtime parameters before contract locks and its default",
|
|
263
248
|
"stable and alpha select their matching repository contract locks",
|
|
264
249
|
"source, runtime and configuration roots are bound before the build matrix",
|
|
265
250
|
],
|
|
@@ -270,48 +255,12 @@ export function createBuildchainContractWorld({
|
|
|
270
255
|
kind: "workflow",
|
|
271
256
|
path: ".github/workflows/public-release-promote.yml",
|
|
272
257
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/public-release-promote.yml@${majorLine}`,
|
|
273
|
-
requiredInputs: ["channel"],
|
|
274
|
-
requiredOutputs: ["promoted-sha", "built-source-sha", "release-candidate-artifact", "release-candidate-action"],
|
|
275
258
|
breakingDefaults: {
|
|
276
259
|
channelDefault: "auto",
|
|
277
|
-
|
|
278
|
-
stableShellDefault: majorLine,
|
|
260
|
+
runtimeSelectionOwner: "actions/runtime/selection/resolve",
|
|
279
261
|
promoteOnlyReleaseCandidate: true,
|
|
280
262
|
requiredStatusCheck: "check / check",
|
|
281
263
|
},
|
|
282
|
-
optionalInputs: [
|
|
283
|
-
"buildchain-channel",
|
|
284
|
-
"buildchain-ref",
|
|
285
|
-
"buildchain-alpha-contract-lock-path",
|
|
286
|
-
"buildchain-stable-contract-lock-path",
|
|
287
|
-
"release-candidate-workflow-file",
|
|
288
|
-
"release-candidate-workflow-name",
|
|
289
|
-
"resume-candidate-repository",
|
|
290
|
-
"resume-candidate-run-id",
|
|
291
|
-
"resume-expected-workflow-file",
|
|
292
|
-
"resume-expected-workflow-name",
|
|
293
|
-
"resume-expected-source-tree",
|
|
294
|
-
"resume-expected-candidate-root",
|
|
295
|
-
"resume-expected-candidate-runtime-sha",
|
|
296
|
-
"resume-buildchain-runtime-sha",
|
|
297
|
-
"resume-transaction-id",
|
|
298
|
-
"publish-required-artifacts-json",
|
|
299
|
-
"release-passport-kfd-1-witness-jsons",
|
|
300
|
-
"release-passport-kfd-2-claim-jsons",
|
|
301
|
-
"release-passport-kfd-3-prebuild-witness-jsons",
|
|
302
|
-
"release-passport-kfd-3-artifact-witness-jsons",
|
|
303
|
-
"release-passport-kfd-3-artifact-verify-command",
|
|
304
|
-
"release-passport-invariant-passport-jsons",
|
|
305
|
-
"release-passport-invariant-passport-command",
|
|
306
|
-
"release-passport-evidence-jsons",
|
|
307
|
-
"release-passport-attachment-command",
|
|
308
|
-
"github-artifact-attestation-policy-json",
|
|
309
|
-
"github-artifact-attestation-environment",
|
|
310
|
-
"github-artifact-attestation-retention-days",
|
|
311
|
-
"buildchain-contract-lock-path",
|
|
312
|
-
"buildchain-contract-drift-issue-mode",
|
|
313
|
-
"github-release",
|
|
314
|
-
],
|
|
315
264
|
publishArtifactSchema: {
|
|
316
265
|
requirementDigest: "optional-before-publish-required-after-publish",
|
|
317
266
|
exactRefResolution: "missing requirement refs resolve to the promoted exact version",
|
|
@@ -343,86 +292,32 @@ export function createBuildchainContractWorld({
|
|
|
343
292
|
"publish-gate source locks are created by the wrapper and enforced by promote-buildchain-ref before publish side effects",
|
|
344
293
|
"GitHub Release passport and evidence publication is delegated to promote-buildchain-ref after the semver release transaction completes",
|
|
345
294
|
],
|
|
346
|
-
compatibleBreakingDigests: [
|
|
347
|
-
"sha256:acd401cfc46450115a3763fd4b679d85f185e8757ebd52510d6262e1533df4cf",
|
|
348
|
-
],
|
|
349
295
|
}),
|
|
350
296
|
surface(root, {
|
|
351
297
|
id: "advanced-release-candidate-promote",
|
|
352
298
|
kind: "workflow",
|
|
353
299
|
path: ".github/workflows/.release-promote.yml",
|
|
354
300
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/.release-promote.yml@${majorLine}`,
|
|
355
|
-
requiredInputs: ["channel"],
|
|
356
|
-
requiredOutputs: ["promoted-sha", "built-source-sha", "release-candidate-artifact", "release-candidate-action"],
|
|
357
301
|
breakingDefaults: {
|
|
358
302
|
promoteOnlyReleaseCandidate: true,
|
|
359
303
|
requiredStatusCheck: "check / check",
|
|
360
304
|
},
|
|
361
|
-
optionalInputs: [
|
|
362
|
-
"buildchain-ref",
|
|
363
|
-
"buildchain-expected-channel",
|
|
364
|
-
"buildchain-expected-major",
|
|
365
|
-
"buildchain-contract-lock-path",
|
|
366
|
-
"promotion-router-ref",
|
|
367
|
-
"promotion-router-sha",
|
|
368
|
-
"promotion-shell-ref",
|
|
369
|
-
"promotion-shell-sha",
|
|
370
|
-
"promotion-runtime-ref",
|
|
371
|
-
"promotion-runtime-sha",
|
|
372
|
-
"promotion-contract-lock-path",
|
|
373
|
-
"promotion-contract-lock-digest",
|
|
374
|
-
"promotion-publication-channel",
|
|
375
|
-
"promotion-target-ref",
|
|
376
|
-
"promotion-override-used",
|
|
377
|
-
"resume-candidate-repository",
|
|
378
|
-
"resume-candidate-run-id",
|
|
379
|
-
"resume-expected-workflow-file",
|
|
380
|
-
"resume-expected-workflow-name",
|
|
381
|
-
"resume-expected-source-tree",
|
|
382
|
-
"resume-expected-candidate-root",
|
|
383
|
-
"resume-expected-candidate-runtime-sha",
|
|
384
|
-
"resume-buildchain-runtime-sha",
|
|
385
|
-
"resume-transaction-id",
|
|
386
|
-
],
|
|
387
305
|
guarantees: [
|
|
388
|
-
"advanced promotion verifies
|
|
306
|
+
"advanced promotion verifies publication intent and source evidence using the prepared runtime",
|
|
389
307
|
"promotion reuses PR-stage release-candidate artifacts and does not run the heavy native build matrix",
|
|
390
308
|
"resume-from-candidate-run is fail-closed and uses a fresh caller event instead of rerunning a frozen startup graph",
|
|
391
309
|
],
|
|
392
|
-
compatibleBreakingDigests: [
|
|
393
|
-
"sha256:aa30f22e3af0a89841310bdbdc900844dd95a66974db173fa140a71bbd7e82c0",
|
|
394
|
-
],
|
|
395
310
|
}),
|
|
396
311
|
surface(root, {
|
|
397
312
|
id: "web-surface",
|
|
398
313
|
kind: "workflow",
|
|
399
314
|
path: ".github/workflows/public-release-web.yml",
|
|
400
315
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/public-release-web.yml@${majorLine}`,
|
|
401
|
-
requiredInputs: [],
|
|
402
|
-
requiredOutputs: [
|
|
403
|
-
"buildchain-runtime-sha",
|
|
404
|
-
"web-surface-channel",
|
|
405
|
-
"web-surface-url",
|
|
406
|
-
"web-surface-manifest-json",
|
|
407
|
-
],
|
|
408
316
|
breakingDefaults: {
|
|
409
|
-
|
|
317
|
+
runtimeSelectionOwner: "actions/runtime/selection/resolve",
|
|
410
318
|
contractCompatibilityPolicy: "major-compatible",
|
|
411
319
|
breakingDriftPolicy: "fail-closed-before-build",
|
|
412
320
|
},
|
|
413
|
-
optionalInputs: [
|
|
414
|
-
"buildchain-ref",
|
|
415
|
-
"buildchain-contract-lock-path",
|
|
416
|
-
"buildchain-contract-compatibility-policy",
|
|
417
|
-
"buildchain-contract-drift-issue-mode",
|
|
418
|
-
"build-command",
|
|
419
|
-
"verify-command",
|
|
420
|
-
"artifact-path",
|
|
421
|
-
"preview-apply",
|
|
422
|
-
"staging-apply",
|
|
423
|
-
"production-apply",
|
|
424
|
-
"production-release-on-main",
|
|
425
|
-
],
|
|
426
321
|
guarantees: [
|
|
427
322
|
"runtime floating refs are resolved to immutable SHAs before caller build and deploy work",
|
|
428
323
|
"contract drift is checked before caller build, web-surface render, deploy planning, and apply side effects",
|
|
@@ -437,27 +332,6 @@ export function createBuildchainContractWorld({
|
|
|
437
332
|
kind: "workflow",
|
|
438
333
|
path: ".github/workflows/.build-demo-adapter.yml",
|
|
439
334
|
publicRef: `${pkg.repository ? "kungfu-systems/buildchain" : "buildchain"}/.github/workflows/.build-demo-adapter.yml@${majorLine}`,
|
|
440
|
-
requiredInputs: [
|
|
441
|
-
"source-artifact-name",
|
|
442
|
-
"source-artifact-digest",
|
|
443
|
-
"adapter-path",
|
|
444
|
-
"renderer-image",
|
|
445
|
-
],
|
|
446
|
-
requiredOutputs: [
|
|
447
|
-
"source-sha",
|
|
448
|
-
"gate-artifact-name",
|
|
449
|
-
"gate-artifact-id",
|
|
450
|
-
"gate-artifact-digest",
|
|
451
|
-
"gate-artifact-url",
|
|
452
|
-
"gate-root",
|
|
453
|
-
"media-artifact-name",
|
|
454
|
-
"media-artifact-id",
|
|
455
|
-
"media-artifact-digest",
|
|
456
|
-
"media-artifact-url",
|
|
457
|
-
"media-root",
|
|
458
|
-
"media-profile",
|
|
459
|
-
"media-qualification-root",
|
|
460
|
-
],
|
|
461
335
|
breakingDefaults: {
|
|
462
336
|
trustedEventRequired: true,
|
|
463
337
|
renderMediaDefault: false,
|
|
@@ -465,14 +339,6 @@ export function createBuildchainContractWorld({
|
|
|
465
339
|
artifactRetentionDaysDefault: 14,
|
|
466
340
|
gatePolicy: "required-before-selective-render",
|
|
467
341
|
},
|
|
468
|
-
optionalInputs: [
|
|
469
|
-
"buildchain-repository",
|
|
470
|
-
"source-ref",
|
|
471
|
-
"render-media",
|
|
472
|
-
"media-profile",
|
|
473
|
-
"artifact-retention-days",
|
|
474
|
-
"require-trusted-event",
|
|
475
|
-
],
|
|
476
342
|
guarantees: [
|
|
477
343
|
"the source GitHub Artifact is admitted by exact same-run name and archive digest",
|
|
478
344
|
"the checked-in consumer adapter runs from the exact consumer source with a disposable home and reduced environment",
|
|
@@ -1033,6 +899,6 @@ export function renderBuildchainContractDriftIssueBody({
|
|
|
1033
899
|
"",
|
|
1034
900
|
evaluation.compatible
|
|
1035
901
|
? "Review the Buildchain release notes, then update the consumer contract lock to the current SHA and contract digest."
|
|
1036
|
-
: "Failing before heavy build is intentional. Review the Buildchain contract change, update the consumer workflow/configuration, or
|
|
902
|
+
: "Failing before heavy build is intentional. Review the Buildchain contract change, update the consumer workflow/configuration, or refresh the runtime contract lock.",
|
|
1037
903
|
].join("\n");
|
|
1038
904
|
}
|
|
@@ -33,7 +33,17 @@ function unquote(value) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function blockValue(lines, entry) {
|
|
36
|
-
if (!/^[>|][+-]?$/.test(entry.value))
|
|
36
|
+
if (!/^[>|][+-]?$/.test(entry.value)) {
|
|
37
|
+
if (!entry.value) return entry.value;
|
|
38
|
+
const fragments = [entry.value];
|
|
39
|
+
for (let index = entry.line + 1; index < lines.length; index += 1) {
|
|
40
|
+
const line = lines[index];
|
|
41
|
+
if (line.trim() && indentation(line) <= entry.indent) break;
|
|
42
|
+
if (!line.trim() || line.trim().startsWith("#")) continue;
|
|
43
|
+
fragments.push(stripComment(line.trim()));
|
|
44
|
+
}
|
|
45
|
+
return fragments.join(" ");
|
|
46
|
+
}
|
|
37
47
|
const values = [];
|
|
38
48
|
for (let index = entry.line + 1; index < lines.length; index += 1) {
|
|
39
49
|
const line = lines[index];
|
|
@@ -4,7 +4,6 @@ import crypto from "node:crypto";
|
|
|
4
4
|
import {
|
|
5
5
|
sourceCoordinates,
|
|
6
6
|
validateNativeContract,
|
|
7
|
-
validateRuntimeSelector,
|
|
8
7
|
} from "./coordinates.js";
|
|
9
8
|
import {
|
|
10
9
|
verifyProjectCutReplayProof,
|
|
@@ -31,13 +30,13 @@ export function admitDeliveryRequest(input, defaultBranch) {
|
|
|
31
30
|
deliveryClass: input["delivery-class"],
|
|
32
31
|
environmentRoot: input["environment-root"],
|
|
33
32
|
});
|
|
34
|
-
validateRuntimeSelector({ runtimeRef: input["buildchain-ref"] });
|
|
35
33
|
return target;
|
|
36
34
|
}
|
|
37
35
|
export async function qualifyDeliverySource(
|
|
38
36
|
{
|
|
39
37
|
workspace,
|
|
40
38
|
runtimeSha,
|
|
39
|
+
runtimeRef,
|
|
41
40
|
request,
|
|
42
41
|
repository,
|
|
43
42
|
branch,
|
|
@@ -61,8 +60,8 @@ export async function qualifyDeliverySource(
|
|
|
61
60
|
writeJson(path.join(workspace, ".buildchain/dev-delivery", name), value);
|
|
62
61
|
const runtime = {
|
|
63
62
|
schema: "kungfu.buildchain.dev-delivery-runtime-selection/v1",
|
|
64
|
-
repository:
|
|
65
|
-
selector:
|
|
63
|
+
repository: "kungfu-systems/buildchain",
|
|
64
|
+
selector: runtimeRef,
|
|
66
65
|
resolvedSha: runtimeSha,
|
|
67
66
|
};
|
|
68
67
|
writeEvidence("runtime-selection.json", runtime);
|
|
@@ -36,11 +36,3 @@ export function validateNativeContract(request) {
|
|
|
36
36
|
"environment-root must be an exact sha256 content root before required native Warrant admission",
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
export function validateRuntimeSelector(request) {
|
|
40
|
-
requireValue(
|
|
41
|
-
/^(?:v4(?:-alpha)?|[0-9a-f]{40}|train\/v4\/v4\.\d+\/[a-z0-9][a-z0-9._-]*)$/u.test(
|
|
42
|
-
request.runtimeRef || "",
|
|
43
|
-
),
|
|
44
|
-
"buildchain-ref must be an exact SHA, v4, v4-alpha, or a v4 capability train",
|
|
45
|
-
);
|
|
46
|
-
}
|
|
@@ -49,15 +49,8 @@ jq -e --arg repository "$repository" '
|
|
|
49
49
|
base="$(jq -r .baseRefName <<<"$pr")"
|
|
50
50
|
source_head="$(jq -r .headRefOid <<<"$pr")"
|
|
51
51
|
runtime_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
|
|
52
|
-
|
|
53
|
-
workflow_ref="$
|
|
54
|
-
if [ "$repository" = kungfu-systems/buildchain ]; then
|
|
55
|
-
[ "$runtime_sha" = "$source_head" ] || {
|
|
56
|
-
echo "buildchain dev deliver: source-owned workflow and runtime must match the exact PR head" >&2
|
|
57
|
-
exit 1
|
|
58
|
-
}
|
|
59
|
-
workflow_ref="$(jq -er '.headRefName | select(type == "string" and length > 0)' <<<"$pr")"
|
|
60
|
-
fi
|
|
52
|
+
runtime_ref="${BUILDCHAIN_RUNTIME_REF:-}"
|
|
53
|
+
workflow_ref="$(jq -er '.headRefName | select(type == "string" and length > 0)' <<<"$pr")"
|
|
61
54
|
|
|
62
55
|
run_id="$(jq -r '[.statusCheckRollup[] | select(.workflowName == "Verify" and .conclusion == "SUCCESS") | .detailsUrl | capture("/runs/(?<id>[0-9]+)").id] | unique | last // empty' <<<"$pr")"
|
|
63
56
|
[ -n "$run_id" ] || { echo "buildchain dev deliver: no successful Verify run covers the PR head" >&2; exit 1; }
|
|
@@ -91,8 +84,7 @@ required_contexts="$(jq '[.statusCheckRollup[] | select(.conclusion == "SUCCESS"
|
|
|
91
84
|
|
|
92
85
|
predicates="$(node "$runtime_root/packages/core/dev-delivery/commands/dev-delivery-source-proof-reuse.mjs" predicates \
|
|
93
86
|
--cwd "$PWD" --repository "$repository" --branch "$base" --qualified-base "$qualified_base" \
|
|
94
|
-
--source-head "$source_head" --
|
|
95
|
-
--contract-digest "$runtime_sha" --node-version "${BUILDCHAIN_NODE_VERSION:-24}" \
|
|
87
|
+
--source-head "$source_head" --node-version "${BUILDCHAIN_NODE_VERSION:-24}" \
|
|
96
88
|
--policy-paths-json "$policy_paths" --closure-paths-json "$existing_paths" \
|
|
97
89
|
--dependency-paths-json "$dependency_paths" --required-contexts-json "$required_contexts")"
|
|
98
90
|
|
|
@@ -132,10 +124,10 @@ if [ -n "$github_token" ]; then
|
|
|
132
124
|
|
|
133
125
|
fi
|
|
134
126
|
workflow="self-ops-dev-delivery.yml"
|
|
135
|
-
payload="$(jq --arg ref "$workflow_ref" --arg base "$base" --arg runtime "$
|
|
127
|
+
payload="$(jq --arg ref "$workflow_ref" --arg base "$base" --arg runtime "$runtime_ref" --arg number "$number" \
|
|
136
128
|
--arg head "$source_head" --arg roots "$(jq -cn --arg root "$source_root" '{sourceRoot:$root}')" \
|
|
137
129
|
--arg run "$run_id" '. as $proof | {ref:$ref,inputs:{
|
|
138
|
-
"
|
|
130
|
+
"runtime-ref":$runtime,"target-branch":$base,"expected-pr-number":$number,
|
|
139
131
|
"expected-head-sha":$head,"native-roots-json":$roots,"source-workflow-run-id":$run,
|
|
140
132
|
"source-identity-root":$proof.sourceIdentityRoot,
|
|
141
133
|
"source-patch-root":$proof.sourcePatchRoot,"plan-root":$proof.planRoot,
|
|
@@ -35,9 +35,6 @@ function cliInput(args) {
|
|
|
35
35
|
"source-workflow-run-id",
|
|
36
36
|
process.env.GITHUB_RUN_ID,
|
|
37
37
|
),
|
|
38
|
-
runtimeRef: flag(args, "runtime-ref"),
|
|
39
|
-
runtimeSha: flag(args, "runtime-sha"),
|
|
40
|
-
contractDigest: flag(args, "contract-digest"),
|
|
41
38
|
nodeVersion: flag(args, "node-version", "24"),
|
|
42
39
|
workingDirectory: flag(args, "working-directory", "."),
|
|
43
40
|
policyPaths: flag(args, "policy-paths-json"),
|