@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
|
@@ -8,7 +8,7 @@ confidence: high
|
|
|
8
8
|
sensitivity: public
|
|
9
9
|
evidence_grade: A
|
|
10
10
|
review_state: unreviewed
|
|
11
|
-
last_reviewed: 2026-09-
|
|
11
|
+
last_reviewed: 2026-09-11
|
|
12
12
|
ai_provenance:
|
|
13
13
|
model_family: GPT-6
|
|
14
14
|
product: Codex
|
|
@@ -185,11 +185,9 @@ floating ref, such as:
|
|
|
185
185
|
```yaml
|
|
186
186
|
jobs:
|
|
187
187
|
web:
|
|
188
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@
|
|
188
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@v4
|
|
189
189
|
with:
|
|
190
|
-
|
|
191
|
-
buildchain-contract-compatibility-policy: major-compatible
|
|
192
|
-
buildchain-contract-drift-issue-mode: compatible-and-breaking
|
|
190
|
+
contract-lock: .buildchain/contract-lock.json
|
|
193
191
|
build-command: pnpm build
|
|
194
192
|
artifact-path: dist
|
|
195
193
|
```
|
|
@@ -747,7 +745,7 @@ the standard PR review and promotion flow without copying bespoke glue:
|
|
|
747
745
|
```yaml
|
|
748
746
|
jobs:
|
|
749
747
|
web-surface:
|
|
750
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@
|
|
748
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@v4
|
|
751
749
|
with:
|
|
752
750
|
build-command: npm run build
|
|
753
751
|
verify-command: npm run check
|
|
@@ -760,40 +758,38 @@ The reusable workflow maps GitHub events to Buildchain web-surface semantics:
|
|
|
760
758
|
| --- | --- |
|
|
761
759
|
| `pull_request` opened / synchronized / reopened | validate, build, verify, and plan `preview` for `pr-N` |
|
|
762
760
|
| `pull_request` closed | plan apply-mode cleanup for the `pr-N` preview alias and manifest |
|
|
763
|
-
| `pull_request` closed for a matching release PR | verify the release intent
|
|
761
|
+
| `pull_request` closed for a matching release PR | verify the release intent, then wait for the protected `main` push; do not plan or apply production from `refs/pull/*/merge` |
|
|
764
762
|
| `push` to `main` | validate, build, verify, plan and apply `staging` from the merged `main` SHA, then optionally open a production release PR |
|
|
765
763
|
| `push` to `main` from a matching release PR merge | validate the associated release PR, plan `production`, and enter the configured GitHub Environment gate from the protected mainline ref |
|
|
766
764
|
| `workflow_dispatch` with `production-approved = true` | plan `production` and enter the configured GitHub Environment gate |
|
|
767
765
|
|
|
768
|
-
The optional `
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
See [`runtime-train-validation.md`](runtime-train-validation.md) for the shared
|
|
773
|
-
train protocol and notification template:
|
|
766
|
+
The optional `runtime-ref` parameter selects a transient execution runtime.
|
|
767
|
+
An empty value uses the selected consumer contract lock or entry default.
|
|
768
|
+
All preparation goes through the shared [Runtime entry](runtime-entry.md).
|
|
769
|
+
A maintainer can expose a manual input for train validation or repair:
|
|
774
770
|
|
|
775
771
|
```yaml
|
|
776
772
|
on:
|
|
777
773
|
workflow_dispatch:
|
|
778
774
|
inputs:
|
|
779
|
-
|
|
775
|
+
runtime-ref:
|
|
780
776
|
description: "Temporary Buildchain runtime ref for trusted manual validation"
|
|
781
777
|
required: false
|
|
782
778
|
default: ""
|
|
783
779
|
|
|
784
780
|
jobs:
|
|
785
781
|
web-surface:
|
|
786
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@
|
|
782
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@v4
|
|
787
783
|
with:
|
|
788
|
-
|
|
784
|
+
runtime-ref: ${{ inputs.runtime-ref || '' }}
|
|
789
785
|
build-command: pnpm run build
|
|
790
786
|
verify-command: pnpm run check
|
|
791
787
|
artifact-path: dist
|
|
792
788
|
```
|
|
793
789
|
|
|
794
|
-
Only
|
|
790
|
+
Only repository actors with write,
|
|
795
791
|
maintain, or admin permission may use a non-empty runtime override. Train refs
|
|
796
|
-
such as `train/
|
|
792
|
+
such as `train/v4/v4.1/site-source-of-truth` are temporary validation refs, not
|
|
797
793
|
stable production dependencies or pending merge targets. They may remain for a
|
|
798
794
|
retention window after release as a fast-use and rollback channel, with old
|
|
799
795
|
trains handled by periodic Buildchain cleanup. The web-surface deployment
|
|
@@ -811,7 +807,7 @@ permissions:
|
|
|
811
807
|
|
|
812
808
|
jobs:
|
|
813
809
|
web-surface:
|
|
814
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@
|
|
810
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@v4
|
|
815
811
|
with:
|
|
816
812
|
build-command: pnpm run build
|
|
817
813
|
verify-command: pnpm run check
|
|
@@ -905,7 +901,7 @@ For release-PR publishing, callers opt in explicitly:
|
|
|
905
901
|
```yaml
|
|
906
902
|
jobs:
|
|
907
903
|
web-surface:
|
|
908
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@
|
|
904
|
+
uses: kungfu-systems/buildchain/.github/workflows/public-release-web.yml@v4
|
|
909
905
|
with:
|
|
910
906
|
build-command: npm run build
|
|
911
907
|
verify-command: npm run check
|
package/docs/workflow-catalog.md
CHANGED
|
@@ -38,7 +38,6 @@ Register ownership before adding a workflow. `pnpm run check:workflows` validate
|
|
|
38
38
|
| [public-build-publication.yml](../.github/workflows/public-build-publication.yml) | build | reusable | active | Buildchain Publication Artifact |
|
|
39
39
|
| [public-build-stage-capsule-canary.yml](../.github/workflows/public-build-stage-capsule-canary.yml) | build | reusable | active | V4 Stage Capsule Canary |
|
|
40
40
|
| [public-ops-alpha-candidate-patrol.yml](../.github/workflows/public-ops-alpha-candidate-patrol.yml) | ops | reusable | active | Buildchain Dev to Alpha Candidate Patrol |
|
|
41
|
-
| [public-ops-bootstrap-recovery.yml](../.github/workflows/public-ops-bootstrap-recovery.yml) | ops | reusable | active | Universal Buildchain Bootstrap Recovery |
|
|
42
41
|
| [public-ops-bootstrap.yml](../.github/workflows/public-ops-bootstrap.yml) | ops | reusable | active | Buildchain Universal Bootstrap |
|
|
43
42
|
| [public-ops-dev-auto-merge.yml](../.github/workflows/public-ops-dev-auto-merge.yml) | ops | reusable | active | Dev PR Auto Merge |
|
|
44
43
|
| [public-ops-dev-qualification-patrol.yml](../.github/workflows/public-ops-dev-qualification-patrol.yml) | ops | reusable | active | Buildchain Dev Qualification Patrol |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungfu-tech/buildchain",
|
|
3
|
-
"version": "4.1.0-alpha.
|
|
3
|
+
"version": "4.1.0-alpha.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
|
|
6
6
|
"repository": "https://github.com/kungfu-systems/buildchain",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"./package.json": "./package.json",
|
|
117
117
|
"./oci-publication": "./packages/core/publication/oci-publication-bundle.js",
|
|
118
118
|
"./floating-consumer-policy": "./packages/core/consumer/floating-consumer-policy.js",
|
|
119
|
-
"./runtime-
|
|
119
|
+
"./runtime-resume-lineage": "./packages/core/release/recovery/lineage.js",
|
|
120
120
|
"./tail-reseal": "./packages/core/release/tail-reseal.js",
|
|
121
121
|
"./tail-reseal-receipt": "./packages/core/release/tail-reseal-receipt.js",
|
|
122
122
|
"./publication-rehearsal": "./packages/core/publication/publication-rehearsal.js",
|
|
@@ -155,10 +155,10 @@
|
|
|
155
155
|
"scripts": {
|
|
156
156
|
"precheck:static": "prettier --check architecture/decisions/0003-two-phase-delivery-warrant.md architecture/delivery-authority-parity.json contracts/dev-delivery-authority-v2.schema.json dist/site/schemas/dev-delivery-authority-v2.schema.json docs/dev-delivery-qualification-landing-adr.md packages/core/dev-delivery/dev-delivery-authority-candidate.js packages/core/dev-delivery/dev-delivery-authority-evidence.js packages/core/dev-delivery/dev-delivery-authority-landing.js packages/core/dev-delivery/dev-delivery-authority-observation.js packages/core/dev-delivery/dev-delivery-authority-qualification.js packages/core/dev-delivery/dev-delivery-authority-settlement.js packages/core/dev-delivery/dev-delivery-authority-state.js packages/core/dev-delivery/dev-delivery-execution-failure.js packages/core/dev-delivery/dev-delivery-execution-transfer.js packages/core/dev-delivery/dev-delivery-landing-readback.js packages/core/dev-delivery/dev-delivery-landing-terminal-evidence.js packages/core/dev-delivery/dev-delivery-landing-testing-port.js packages/core/dev-delivery/dev-delivery-native-execution.js packages/core/dev-delivery/dev-delivery-native-proof.js packages/core/dev-delivery/dev-delivery-process-boundary.js packages/core/dev-delivery/dev-delivery-warrant-qualification.js packages/core/dev-delivery/dev-delivery-warrant-state.js packages/core/dev-delivery/commands/dev-delivery-authority-command-adapters.mjs packages/core/dev-delivery/commands/dev-delivery-authority-provider.mjs packages/core/dev-delivery/commands/dev-delivery-authority.mjs packages/core/dev-delivery/native/execution.js packages/core/dev-delivery/commands/dev-delivery-process-boundary.mjs packages/core/dev-delivery/native/transactions.js packages/core/dev-delivery/commands/dev-delivery-two-phase.mjs packages/core/dev-delivery/commands/dev-delivery-warrant-options.mjs packages/core/dev-delivery/warrant/persistence.js templates/native-dev-delivery.yml",
|
|
157
157
|
"operator:windows-jit": "bash packages/core/providers/commands/aws-windows-jit-operator.sh",
|
|
158
|
-
"check": "pnpm run check:layout && pnpm run check:implementation-naming && pnpm run check:static && node scripts/check-ci-lane-change-budget.mjs && node scripts/check-public-dogfood-contract.mjs && node scripts/check-floating-consumer-policy-contract.mjs && node scripts/check-release-topology.mjs && node scripts/check-universal-workflow-bootstrap.mjs && pnpm run check:bridge && pnpm run check:contracts:rust && pnpm run check:wasm && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/generate-agent-change-map.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-runtime-semantic-closure.mjs && node scripts/check-capability-parity-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/publication-rehearsal-fixture.mjs --check && node packages/core/governance/commands/architecture.mjs validate && node scripts/warrant-shadow-plan.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
|
|
159
|
-
"check:static": "node scripts/check-javascript-syntax.mjs && node scripts/check-source-bindings.mjs && prettier --check architecture/*.json contracts/release-tail-provider-bindings-v1.schema.json contracts/v4-canonical-contracts-v1.schema.json contracts/v4-compatibility-facts-v1.schema.json contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json contracts/v4-delivery-warrant-trace-v1.schema.json contracts/v4-floating-consumer-policy-receipt-v1.schema.json contracts/
|
|
158
|
+
"check": "pnpm run check:layout && node scripts/check-runtime-entry.mjs && pnpm run check:implementation-naming && pnpm run check:static && node scripts/check-ci-lane-change-budget.mjs && node scripts/check-public-dogfood-contract.mjs && node scripts/check-floating-consumer-policy-contract.mjs && node scripts/check-release-topology.mjs && node scripts/check-universal-workflow-bootstrap.mjs && pnpm run check:bridge && pnpm run check:contracts:rust && pnpm run check:wasm && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/generate-agent-change-map.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-runtime-semantic-closure.mjs && node scripts/check-capability-parity-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/publication-rehearsal-fixture.mjs --check && node packages/core/governance/commands/architecture.mjs validate && node scripts/warrant-shadow-plan.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
|
|
159
|
+
"check:static": "node scripts/check-javascript-syntax.mjs && node scripts/check-source-bindings.mjs && prettier --check architecture/*.json contracts/release-tail-provider-bindings-v1.schema.json contracts/v4-canonical-contracts-v1.schema.json contracts/v4-compatibility-facts-v1.schema.json contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json contracts/v4-delivery-warrant-trace-v1.schema.json contracts/v4-floating-consumer-policy-receipt-v1.schema.json contracts/runtime-resume-lineage-v2.schema.json contracts/v4-tail-reseal-v1.schema.json contracts/v4-host-contract-v1.schema.json contracts/v4-provider-operation-journal-v1.schema.json contracts/v4-release-activation-shadow-v1.schema.json contracts/v4-stable-publication-fence-v1.schema.json contracts/v4-partial-mutation-recovery-v1.schema.json contracts/v4-stage-capsule-v1.schema.json contracts/v4-stage-capsule-store-v1.schema.json contracts/v4-stage-capsule-resume-v1.schema.json contracts/release-tail-capabilities-v1.schema.json contracts/fixtures/release-tail-capabilities-v1/*.json contracts/fixtures/v4-delivery-warrant-trace-v1/*.json contracts/fixtures/v4-floating-consumer-policy-v1/*.json contracts/fixtures/runtime-resume-lineage-v2/*.json contracts/fixtures/v4-tail-reseal-v1/*.json contracts/fixtures/v4-compatibility-facts-v1/*.json contracts/fixtures/v4-provider-operation-journal-v1/*.json contracts/fixtures/v4-provider-readback-idempotency-v1/*.json contracts/fixtures/v4-release-activation-shadow-v1/*.json contracts/fixtures/v4-stable-publication-fence-v1/*.json contracts/fixtures/v4-partial-mutation-recovery-v1/*.json contracts/fixtures/v4-stage-capsule-v1/*.json contracts/fixtures/v4-stage-capsule-store-v1/*.json contracts/fixtures/v4-stage-capsule-resume-v1/*.json packages/core/contracts/command-registry.mjs packages/core/governance/cli/compatibility-facts.mjs packages/core/contracts/canonical-contracts.js packages/core/contracts/kungfu-temporal-fact.js packages/core/governance/buildchain-compatibility-fact.js packages/core/governance/buildchain-compatibility-authority.js packages/core/governance/buildchain-compatibility-proof.js packages/core/consumer/floating-consumer-evidence.js packages/core/consumer/floating-consumer-policy.js packages/core/consumer/floating-consumer-release-passport.js packages/core/release/recovery/lineage.js packages/core/release/tail-reseal-contract.js packages/core/release/tail-reseal-github.js packages/core/release/tail-reseal-receipt.js packages/core/release/tail-reseal.js packages/core/consumer/runtime-selector-persistence.js packages/core/release/provider-operation-journal.js packages/core/release/provider-readback-idempotency.js packages/core/release/release-activation-shadow.js packages/core/release/stable-publication-fence.js packages/core/release/partial-mutation-recovery-qualification.js packages/core/build/stage-capsule.js packages/core/build/stage-capsule-store.js packages/core/build/stage-capsule-local-store.js packages/core/build/platform-stage-checkpoints.js packages/core/build/stage-capsule-resume-planner.js packages/core/build/stage-capsule-qualification.js packages/core/build/stage-capsule-qualification-campaign.js packages/core/dev-delivery/delivery-warrant-fixture-runner.js packages/core/dev-delivery/delivery-warrant-read-candidate.js packages/core/dev-delivery/delivery-warrant-semantic-diff-gate.js packages/core/dev-delivery/delivery-warrant-shadow-adapter.js scripts/check-core-mechanism-inventory.mjs scripts/check-runtime-semantic-closure.mjs scripts/check-release-tail-contract.mjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs packages/core/dev-delivery/commands/dev-pr-prequeue-guard.mjs scripts/check-public-dogfood-contract.mjs scripts/maintainability-metrics.mjs scripts/maintainability-domain-metrics.mjs scripts/maintainability-governance.mjs scripts/generate-agent-change-map.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs packages/core/governance/commands/architecture.mjs packages/core/runtime/commands/bridge-bootstrap.mjs scripts/bridge-evidence.mjs packages/core/consumer/commands/consumer-policy.mjs packages/core/runtime/commands/host-adapter.mjs scripts/platform-stage-checkpoint-rehearsal.mjs scripts/stage-capsule-resume-rehearsal.mjs packages/core/build/commands/stage-capsule-qualification.mjs scripts/tail-reseal-macos-rehearsal.mjs packages/core/release/commands/tail-reseal.mjs scripts/warrant-shadow-plan.mjs scripts/verify-golden-path.mjs tests/runtime-entry-provider.test.mjs tests/command-registry.test.mjs tests/core-mechanism-inventory.test.mjs tests/release-tail-contract.test.mjs tests/maintainability.test.mjs tests/maintainability-governance.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs tests/architecture.test.mjs tests/bridge.test.mjs tests/canonical-contracts.test.mjs tests/delivery-warrant-fixture-runner.test.mjs tests/delivery-warrant-read-candidate.test.mjs tests/floating-consumer-policy.test.mjs tests/runtime-resume-lineage.test.mjs tests/runtime-semantic-closure.test.mjs tests/tail-reseal.test.mjs tests/tail-reseal-parity.test.mjs tests/compatibility-facts.test.mjs tests/platform-stage-checkpoints.test.mjs tests/provider-operation-journal.test.mjs tests/provider-readback-idempotency.test.mjs tests/public-dogfood-contract.test.mjs tests/release-activation-shadow.test.mjs tests/stable-publication-fence.test.mjs tests/partial-mutation-recovery-qualification.test.mjs tests/stage-capsule.test.mjs tests/stage-capsule-store.test.mjs tests/stage-capsule-resume-planner.test.mjs tests/stage-capsule-qualification.test.mjs tests/warrant-shadow-plan.test.mjs",
|
|
160
160
|
"check:bridge": "cargo fmt --manifest-path crates/buildchain-host-bridge/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-host-bridge/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-host-bridge/Cargo.toml",
|
|
161
|
-
"check:contracts": "pnpm run check:contracts:rust && node --test tests/canonical-contracts.test.mjs tests/delivery-warrant-fixture-runner.test.mjs tests/delivery-warrant-read-candidate.test.mjs tests/domain-wasm.test.mjs tests/floating-consumer-policy-contract.test.mjs tests/floating-consumer-policy.test.mjs tests/runtime-
|
|
161
|
+
"check:contracts": "pnpm run check:contracts:rust && node --test tests/canonical-contracts.test.mjs tests/delivery-warrant-fixture-runner.test.mjs tests/delivery-warrant-read-candidate.test.mjs tests/domain-wasm.test.mjs tests/floating-consumer-policy-contract.test.mjs tests/floating-consumer-policy.test.mjs tests/runtime-resume-lineage.test.mjs tests/tail-reseal.test.mjs tests/tail-reseal-parity.test.mjs tests/compatibility-facts.test.mjs tests/publication-rehearsal.test.mjs tests/platform-stage-checkpoints.test.mjs tests/provider-operation-journal.test.mjs tests/provider-readback-idempotency.test.mjs tests/public-dogfood-contract.test.mjs tests/release-activation-shadow.test.mjs tests/stable-publication-fence.test.mjs tests/partial-mutation-recovery-qualification.test.mjs tests/stage-capsule.test.mjs tests/stage-capsule-store.test.mjs tests/stage-capsule-resume-planner.test.mjs tests/stage-capsule-qualification.test.mjs",
|
|
162
162
|
"build:wasm": "node scripts/build-domain-wasm.mjs",
|
|
163
163
|
"check:wasm": "prettier --check packages/core/runtime/domain-wasm.js packages/core/runtime/domain-wasm-artifact.js scripts/build-domain-wasm.mjs scripts/tsup-action.config.mjs packages/core/contracts/action-inventory.js tests/domain-wasm.test.mjs && node scripts/build-domain-wasm.mjs --check",
|
|
164
164
|
"check:workflows": "node scripts/check-workflow-taxonomy.mjs && bash scripts/check-workflows.sh",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"bridge:run": "node packages/core/runtime/commands/bridge-bootstrap.mjs run",
|
|
179
179
|
"bridge:evidence": "node scripts/bridge-evidence.mjs",
|
|
180
180
|
"check:contracts:rust": "cargo fmt --manifest-path crates/buildchain-domain-contracts/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-domain-contracts/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-domain-contracts/Cargo.toml",
|
|
181
|
-
"generate:workflows": "node scripts/generate-workflow-taxonomy.mjs && node scripts/generate-bootstrap-
|
|
181
|
+
"generate:workflows": "node scripts/generate-workflow-taxonomy.mjs && node scripts/generate-bootstrap-admission.mjs",
|
|
182
182
|
"check:implementation-naming": "node scripts/check-implementation-naming.mjs",
|
|
183
183
|
"check:layout": "node scripts/check-code-layout.mjs"
|
|
184
184
|
},
|
|
@@ -339,7 +339,7 @@ name: Build
|
|
|
339
339
|
on:
|
|
340
340
|
workflow_dispatch:
|
|
341
341
|
inputs:
|
|
342
|
-
|
|
342
|
+
runtime-ref:
|
|
343
343
|
description: "Temporary Buildchain runtime ref for trusted manual validation"
|
|
344
344
|
required: false
|
|
345
345
|
default: ""
|
|
@@ -358,7 +358,7 @@ jobs:
|
|
|
358
358
|
publication:
|
|
359
359
|
uses: kungfu-systems/buildchain/.github/workflows/public-build-publication.yml@v4
|
|
360
360
|
with:
|
|
361
|
-
|
|
361
|
+
runtime-ref: \${{ inputs.runtime-ref || '' }}
|
|
362
362
|
toolchain-type: config
|
|
363
363
|
verify-command: make check
|
|
364
364
|
artifact-name: publication-artifact
|
|
@@ -43,11 +43,10 @@ function validateSourceBinding(binding) {
|
|
|
43
43
|
"source binding",
|
|
44
44
|
);
|
|
45
45
|
if (
|
|
46
|
-
!SHA.test(binding.runtimeSha || "") ||
|
|
47
46
|
!SHA.test(binding.consumerSha || "") ||
|
|
48
47
|
!ROOT.test(binding.inputRoot || "")
|
|
49
48
|
)
|
|
50
|
-
fail("report requires exact
|
|
49
|
+
fail("report requires exact consumer and input roots");
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
function validateExecutionEvidence(execution) {
|
|
@@ -171,25 +170,15 @@ export function qualifyCrossPlatformAdopters({ reports, consumers }) {
|
|
|
171
170
|
fail(
|
|
172
171
|
`platform matrix mismatch; missing=${missing.join(",") || "none"}; unexpected=${unexpected.join(",") || "none"}`,
|
|
173
172
|
);
|
|
174
|
-
const reference = normalized[0].sourceBinding;
|
|
175
|
-
for (const report of normalized.slice(1)) {
|
|
176
|
-
if (
|
|
177
|
-
report.sourceBinding.runtimeSha !== reference.runtimeSha
|
|
178
|
-
)
|
|
179
|
-
fail("all platform reports must bind the same exact source and matrix");
|
|
180
|
-
}
|
|
181
173
|
for (const consumer of consumers) {
|
|
182
174
|
const rows = normalized.filter(report => report.consumer === consumer);
|
|
183
|
-
if (rows.some(report =>
|
|
175
|
+
if (rows.some(report => report.sourceBinding.consumerSha !== rows[0].sourceBinding.consumerSha || report.sourceBinding.inputRoot !== rows[0].sourceBinding.inputRoot))
|
|
184
176
|
fail("each consumer must bind the same exact source and input on every platform");
|
|
185
177
|
}
|
|
186
178
|
const orderedReports = expectedKeys.map((key) => reportByKey.get(key));
|
|
187
179
|
const body = {
|
|
188
180
|
schemaVersion: 1,
|
|
189
181
|
contract: CROSS_PLATFORM_ADOPTER_QUALIFICATION_CONTRACT,
|
|
190
|
-
sourceBinding: {
|
|
191
|
-
runtimeSha: reference.runtimeSha,
|
|
192
|
-
},
|
|
193
182
|
consumers: [...consumers],
|
|
194
183
|
platforms: [...CROSS_PLATFORM_ADOPTER_PLATFORMS],
|
|
195
184
|
reports: orderedReports.map(({ consumer, platform, reportRoot, sourceBinding }) => ({
|
|
@@ -17,7 +17,7 @@ function coordinates(core, env) {
|
|
|
17
17
|
return {
|
|
18
18
|
runtimeRoot: installationRoot(import.meta.url),
|
|
19
19
|
consumerRoot: path.join(env.GITHUB_WORKSPACE, ".buildchain/consumer"),
|
|
20
|
-
runtimeSha:
|
|
20
|
+
runtimeSha: env.BUILDCHAIN_RUNTIME_SHA,
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export function selectAdopterAction(core, env) {
|
|
@@ -25,7 +25,7 @@ export function selectAdopterAction(core, env) {
|
|
|
25
25
|
request: request(core),
|
|
26
26
|
repository: env.GITHUB_REPOSITORY,
|
|
27
27
|
sourceSha: env.GITHUB_SHA,
|
|
28
|
-
runtimeSha:
|
|
28
|
+
runtimeSha: env.BUILDCHAIN_RUNTIME_SHA,
|
|
29
29
|
});
|
|
30
30
|
for (const [key, value] of Object.entries(selected))
|
|
31
31
|
core.setOutput(key, value);
|
|
@@ -46,9 +46,7 @@ export function admitAdopterPolicyAction(core, env) {
|
|
|
46
46
|
inputPath: input["input-path"],
|
|
47
47
|
invocationSourcePath:
|
|
48
48
|
input["invocation-source-path"] ||
|
|
49
|
-
(env.GITHUB_REPOSITORY
|
|
50
|
-
? ".github/workflows/self-build-adopter-dogfood.yml"
|
|
51
|
-
: ""),
|
|
49
|
+
env.GITHUB_WORKFLOW_REF?.split("@")[0].slice(env.GITHUB_REPOSITORY.length + 1),
|
|
52
50
|
});
|
|
53
51
|
for (const [key, value] of Object.entries(
|
|
54
52
|
consumerPolicyOutputs(result, output),
|
|
@@ -21,8 +21,8 @@ export function selectAdopter({ request, repository, sourceSha, runtimeSha }) {
|
|
|
21
21
|
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(request.consumer || ""))
|
|
22
22
|
throw new Error("Adopter identity must be stable lowercase");
|
|
23
23
|
const sha = String(request["consumer-ref"] || sourceSha).toLowerCase();
|
|
24
|
-
if (!/^[0-9a-f]{40}$/.test(sha)
|
|
25
|
-
throw new Error("Adopter requires exact consumer
|
|
24
|
+
if (!/^[0-9a-f]{40}$/.test(sha))
|
|
25
|
+
throw new Error("Adopter requires an exact consumer commit");
|
|
26
26
|
return { repository: request["consumer-repository"] || repository, sha };
|
|
27
27
|
}
|
|
28
28
|
export function verifyAdopterCheckouts(
|
|
@@ -30,7 +30,6 @@ export function verifyAdopterCheckouts(
|
|
|
30
30
|
execute = command,
|
|
31
31
|
) {
|
|
32
32
|
for (const [directory, sha] of [
|
|
33
|
-
[runtimeRoot, runtimeSha],
|
|
34
33
|
[consumerRoot, consumerSha],
|
|
35
34
|
]) {
|
|
36
35
|
if (
|
|
@@ -98,7 +98,6 @@ export function createBuildAttestationService({
|
|
|
98
98
|
);
|
|
99
99
|
if (
|
|
100
100
|
prepared.predicate?.plan_root !== plan.root ||
|
|
101
|
-
prepared.predicate?.runtime?.sha !== plan.identity.sha ||
|
|
102
101
|
prepared.platform?.id !== plan.build.attestation.platform
|
|
103
102
|
)
|
|
104
103
|
throw new Error("Attestation preparation belongs to another build");
|
|
@@ -44,7 +44,6 @@ export function verifyExecutionIdentity(result, plan, platform) {
|
|
|
44
44
|
root !== rootOf(body) ||
|
|
45
45
|
result.plan_root !== plan.root ||
|
|
46
46
|
result.source_sha !== plan.source.sha ||
|
|
47
|
-
result.runtime_sha !== plan.identity.sha ||
|
|
48
47
|
result.platform !== platform.id ||
|
|
49
48
|
JSON.stringify(result.run) !== JSON.stringify(plan.run)
|
|
50
49
|
)
|
|
@@ -72,7 +71,6 @@ export function verifyManifest(file, root, plan, platform) {
|
|
|
72
71
|
manifest.platform?.id !== platform.id ||
|
|
73
72
|
manifest.git?.sha !== plan.source.sha ||
|
|
74
73
|
manifest.git?.treeSha !== plan.source.tree_sha ||
|
|
75
|
-
manifest.git?.runtimeSha !== plan.identity.sha ||
|
|
76
74
|
manifest.git?.repository !== plan.run.repository
|
|
77
75
|
) {
|
|
78
76
|
throw new Error(`Artifact manifest identity mismatch: ${platform.id}`);
|
|
@@ -142,8 +140,7 @@ export function verifyCredential(manifestFile, payloadRoot, plan, platform) {
|
|
|
142
140
|
evidence[0].status !== "accepted" ||
|
|
143
141
|
evidence[0].source?.repository !== plan.run.repository ||
|
|
144
142
|
evidence[0].source?.sha !== plan.source.sha ||
|
|
145
|
-
evidence[0].source?.treeSha !== plan.source.tree_sha
|
|
146
|
-
evidence[0].buildchain?.runtimeSha !== plan.identity.sha
|
|
143
|
+
evidence[0].source?.treeSha !== plan.source.tree_sha
|
|
147
144
|
)
|
|
148
145
|
throw new Error("Credential evidence identity mismatch");
|
|
149
146
|
return manifest;
|
|
@@ -72,7 +72,7 @@ export function createBuildArtifactStore({
|
|
|
72
72
|
) {
|
|
73
73
|
const result = await client.downloadArtifact(ref.id, {
|
|
74
74
|
path: target,
|
|
75
|
-
expectedHash: ref.digest.replace(/^sha256:/u, "")
|
|
75
|
+
expectedHash: `sha256:${ref.digest.replace(/^sha256:/u, "")}`,
|
|
76
76
|
...findOptions(repository, runId, token),
|
|
77
77
|
});
|
|
78
78
|
if (result.digestMismatch)
|
|
@@ -92,10 +92,11 @@ export function createBuildArtifactStore({
|
|
|
92
92
|
...findOptions(repository, runId, token),
|
|
93
93
|
});
|
|
94
94
|
const matches = artifacts.filter((item) => item.name === name);
|
|
95
|
-
if (matches.length !== 1)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
if (matches.length !== 1) {
|
|
96
|
+
const error = new Error(`Expected one artifact ${name}; found ${matches.length}`);
|
|
97
|
+
error.code = matches.length === 0 ? "artifact-not-found" : "artifact-ambiguous";
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
99
100
|
const found = matches[0];
|
|
100
101
|
if (!found.digest)
|
|
101
102
|
throw new Error(`Artifact provider omitted digest: ${name}`);
|
|
@@ -268,7 +268,7 @@ export function createArtifactSigningRequest({
|
|
|
268
268
|
runtime.repository || "kungfu-systems/buildchain",
|
|
269
269
|
"runtime repository",
|
|
270
270
|
),
|
|
271
|
-
sha:
|
|
271
|
+
sha: runtime.sha,
|
|
272
272
|
},
|
|
273
273
|
artifact: {
|
|
274
274
|
id: nonEmptyString(artifact.id || artifact.path, "artifact id"),
|
|
@@ -398,10 +398,7 @@ export function createArtifactSigningReceipt({
|
|
|
398
398
|
authority: {
|
|
399
399
|
contract: ARTIFACT_SIGNING_AUTHORITY_CONTRACT,
|
|
400
400
|
id: nonEmptyString(authority.id || request.authority.id, "authority id"),
|
|
401
|
-
runtimeSha:
|
|
402
|
-
authority.runtimeSha || request.runtime.sha,
|
|
403
|
-
"authority runtime SHA",
|
|
404
|
-
),
|
|
401
|
+
runtimeSha: authority.runtimeSha || request.runtime.sha,
|
|
405
402
|
},
|
|
406
403
|
signature: { ...request.signature },
|
|
407
404
|
...(status === "passed"
|
|
@@ -443,17 +440,14 @@ export function validateArtifactSigningReceipt(receipt, { request } = {}) {
|
|
|
443
440
|
}
|
|
444
441
|
if (receipt.digest !== documentDigest(receipt))
|
|
445
442
|
issues.push("receipt digest mismatch");
|
|
443
|
+
|
|
446
444
|
if (request) {
|
|
447
445
|
const requestCheck = validateArtifactSigningRequest(request);
|
|
448
446
|
if (!requestCheck.ok) issues.push(...requestCheck.issues);
|
|
449
447
|
if (receipt.requestDigest !== request.digest)
|
|
450
448
|
issues.push("receipt request digest mismatch");
|
|
451
|
-
if (stableJson(receipt.signature) !== stableJson(request.signature))
|
|
449
|
+
if (stableJson(receipt.signature) !== stableJson(request.signature))
|
|
452
450
|
issues.push("receipt signature policy mismatch");
|
|
453
|
-
}
|
|
454
|
-
if (receipt.authority?.runtimeSha !== request.runtime.sha) {
|
|
455
|
-
issues.push("receipt authority runtime mismatch");
|
|
456
|
-
}
|
|
457
451
|
}
|
|
458
452
|
if (receipt.status === "passed") {
|
|
459
453
|
exactDigest(receipt.result?.artifactDigest, "result artifact digest");
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
3
1
|
import { command } from "../../runtime/action-process.mjs";
|
|
4
2
|
import { releaseAssetClient } from "../../providers/github/release-assets.js";
|
|
5
3
|
import {
|
|
@@ -10,14 +8,14 @@ import {
|
|
|
10
8
|
function sourceWorkspace(env) {
|
|
11
9
|
const workspace = env.GITHUB_WORKSPACE;
|
|
12
10
|
if (
|
|
13
|
-
path.resolve(installationRoot(import.meta.url)) !==
|
|
14
|
-
path.resolve(workspace) ||
|
|
15
11
|
command("git", ["rev-parse", "HEAD"], {
|
|
16
12
|
cwd: workspace,
|
|
17
13
|
stdio: "pipe",
|
|
18
14
|
}).trim() !== env.GITHUB_SHA
|
|
19
15
|
)
|
|
20
|
-
throw new Error(
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Binary distribution requires the exact checked-out source",
|
|
18
|
+
);
|
|
21
19
|
return workspace;
|
|
22
20
|
}
|
|
23
21
|
export function admitBinaryDistributionAction(core, env) {
|
|
@@ -31,7 +29,11 @@ export function admitBinaryDistributionAction(core, env) {
|
|
|
31
29
|
sourceSha: env.GITHUB_SHA,
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
|
-
export async function buildBinaryDistributionAction(
|
|
32
|
+
export async function buildBinaryDistributionAction(
|
|
33
|
+
core,
|
|
34
|
+
env,
|
|
35
|
+
{ build = buildBinaryDistribution } = {},
|
|
36
|
+
) {
|
|
35
37
|
const workspace = sourceWorkspace(env),
|
|
36
38
|
matrix = JSON.parse(core.getInput("matrix-json", { required: true }));
|
|
37
39
|
const nodePath = command("node", ["-p", "process.execPath"], {
|
|
@@ -42,7 +44,7 @@ export async function buildBinaryDistributionAction(core, env) {
|
|
|
42
44
|
cwd: workspace,
|
|
43
45
|
stdio: "pipe",
|
|
44
46
|
}).trim();
|
|
45
|
-
return
|
|
47
|
+
return build({
|
|
46
48
|
workspace,
|
|
47
49
|
tag: core.getInput("tag", { required: true }),
|
|
48
50
|
platform: matrix.platform,
|
|
@@ -52,9 +54,13 @@ export async function buildBinaryDistributionAction(core, env) {
|
|
|
52
54
|
logPath: env.BUILDCHAIN_LOG_PATH,
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
export async function qualifyBinaryDistributionAction(
|
|
57
|
+
export async function qualifyBinaryDistributionAction(
|
|
58
|
+
core,
|
|
59
|
+
env,
|
|
60
|
+
{ qualify = qualifyBinaryDistribution } = {},
|
|
61
|
+
) {
|
|
56
62
|
const workspace = sourceWorkspace(env);
|
|
57
|
-
return
|
|
63
|
+
return qualify({
|
|
58
64
|
workspace,
|
|
59
65
|
tag: core.getInput("tag", { required: true }),
|
|
60
66
|
repository: env.GITHUB_REPOSITORY,
|
|
@@ -8,10 +8,6 @@ export function dispatchBinaryPublication(
|
|
|
8
8
|
/^[\w.-]+\/[\w.-]+$/u.test(repository || ""),
|
|
9
9
|
"Binary publication requires an exact repository",
|
|
10
10
|
);
|
|
11
|
-
requireValue(
|
|
12
|
-
/^[0-9a-f]{40}$/u.test(sha || ""),
|
|
13
|
-
"Binary publication requires an exact runtime SHA",
|
|
14
|
-
);
|
|
15
11
|
requireValue(
|
|
16
12
|
/^\d+$/u.test(runId || ""),
|
|
17
13
|
"Binary publication requires an exact evidence run",
|
|
@@ -29,7 +25,7 @@ export function dispatchBinaryPublication(
|
|
|
29
25
|
"--ref",
|
|
30
26
|
tag,
|
|
31
27
|
"-f",
|
|
32
|
-
`
|
|
28
|
+
`runtime-ref=${sha}`,
|
|
33
29
|
"-f",
|
|
34
30
|
`evidence-run-id=${runId}`,
|
|
35
31
|
"-f",
|
|
@@ -43,7 +39,7 @@ export function binaryPublicationDispatchAction(_core, env) {
|
|
|
43
39
|
dispatchBinaryPublication({
|
|
44
40
|
repository: env.GITHUB_REPOSITORY,
|
|
45
41
|
tag: env.RELEASE_TAG,
|
|
46
|
-
sha: env.
|
|
42
|
+
sha: env.BUILDCHAIN_RUNTIME_SHA,
|
|
47
43
|
runId: env.GITHUB_RUN_ID,
|
|
48
44
|
});
|
|
49
45
|
}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { command } from "../../runtime/action-process.mjs";
|
|
3
2
|
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
3
|
export function demoActionContext(core, env) {
|
|
5
4
|
const runtimeRoot = installationRoot(import.meta.url);
|
|
6
5
|
const workspace = path.resolve(env.GITHUB_WORKSPACE);
|
|
7
|
-
const sha =
|
|
8
|
-
|
|
9
|
-
!/^[a-f0-9]{40}$/u.test(sha) ||
|
|
10
|
-
command("git", ["-C", runtimeRoot, "rev-parse", "HEAD"], {
|
|
11
|
-
stdio: "pipe",
|
|
12
|
-
}).trim() !== sha
|
|
13
|
-
)
|
|
14
|
-
throw new Error(
|
|
15
|
-
"Demo runtime differs from the exact workflow implementation",
|
|
16
|
-
);
|
|
6
|
+
const sha = env.BUILDCHAIN_RUNTIME_SHA;
|
|
7
|
+
|
|
17
8
|
return {
|
|
18
9
|
workspace,
|
|
19
10
|
runtimeRoot,
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import path from "node:path";
|
|
3
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
2
|
import { sourceSha } from "../standalone/identity.js";
|
|
5
3
|
import { buildStandaloneBinary } from "../standalone/build.js";
|
|
6
4
|
import { runTransportSmoke } from "./transport-smoke.js";
|
|
7
|
-
export function prepareDemoBinaryAction(
|
|
5
|
+
export function prepareDemoBinaryAction(
|
|
6
|
+
core,
|
|
7
|
+
env,
|
|
8
|
+
{ build = buildStandaloneBinary, smoke = runTransportSmoke } = {},
|
|
9
|
+
) {
|
|
8
10
|
const workspace = path.resolve(env.GITHUB_WORKSPACE);
|
|
9
|
-
if (
|
|
10
|
-
fs.realpathSync(installationRoot(import.meta.url)) !==
|
|
11
|
-
fs.realpathSync(workspace) ||
|
|
12
|
-
sourceSha(workspace) !== env.GITHUB_SHA
|
|
13
|
-
)
|
|
11
|
+
if (sourceSha(workspace) !== env.GITHUB_SHA)
|
|
14
12
|
throw new Error(
|
|
15
13
|
"Demo binary must be built from the exact checked-out source",
|
|
16
14
|
);
|
|
17
|
-
|
|
15
|
+
build({
|
|
18
16
|
cwd: workspace,
|
|
19
17
|
outputDir: "dist/auditable-demo-binary",
|
|
20
18
|
});
|
|
21
|
-
|
|
19
|
+
smoke({
|
|
22
20
|
artifactRoot: path.join(workspace, "dist/auditable-demo-binary"),
|
|
23
21
|
scenarioPath: path.join(workspace, ".buildchain/auditable-demo.json"),
|
|
24
22
|
});
|
|
@@ -15,8 +15,6 @@ export function prepareGateProfileController({
|
|
|
15
15
|
execFileSync("git", ["-C", directory, "rev-parse", "HEAD"], {
|
|
16
16
|
encoding: "utf8",
|
|
17
17
|
}).trim();
|
|
18
|
-
if (git(runtimeRoot) !== runtimeSha)
|
|
19
|
-
throw new Error("Gate runtime differs from admitted commit");
|
|
20
18
|
const sourceRoot = path.join(workspace, "source");
|
|
21
19
|
const sourceSha = git(sourceRoot);
|
|
22
20
|
const cwd = containedBuildPath(
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
3
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
4
2
|
import { validateAttestationInput } from "./admission.js";
|
|
5
3
|
import { prepareAttestation, sealAttestation } from "./transaction.js";
|
|
6
4
|
export function admitAttestationAction(core, env) {
|
|
7
5
|
const input = JSON.parse(core.getInput("request-json", { required: true }));
|
|
8
|
-
validateAttestationInput({
|
|
6
|
+
validateAttestationInput({ evidenceRunId: input["evidence-run-id"], currentRunId: env.GITHUB_RUN_ID,
|
|
9
7
|
sourceSha: input["source-sha"], currentSourceSha: env.GITHUB_SHA, subjectRelativePath: input["subject-relative-path"], platformManifestRelativePath: input["platform-manifest-relative-path"], releasePassportRelativePath: input["release-passport-relative-path"] });
|
|
10
8
|
}
|
|
11
9
|
const input = (core, name) => core.getInput(name, { required: true });
|
|
12
|
-
function runtime(core) { verifyCheckoutIdentity({ directory: installationRoot(import.meta.url), sha: input(core, "runtime-sha"), label: "Attester runtime" }); }
|
|
13
10
|
export function prepareAttestationAction(core, env) {
|
|
14
|
-
runtime(core);
|
|
15
11
|
const outputs = prepareAttestation({ subjectPath: input(core, "subject-path"), platformManifestPath: input(core, "platform-manifest-path"), releasePassportPath: input(core, "release-passport-path"),
|
|
16
|
-
policy: JSON.parse(input(core, "policy-json")),
|
|
12
|
+
policy: JSON.parse(input(core, "policy-json")), expectedCallerRepository: env.GITHUB_REPOSITORY, expectedSourceSha: env.GITHUB_SHA,
|
|
17
13
|
outputDir: path.join(env.GITHUB_WORKSPACE, ".buildchain/github-artifact-attestation") });
|
|
18
14
|
for (const [key, value] of Object.entries(outputs)) core.setOutput(key, value);
|
|
19
15
|
}
|
|
20
16
|
export function sealAttestationAction(core, env) {
|
|
21
|
-
runtime(core);
|
|
22
17
|
const outputs = sealAttestation({ runtimeSha: input(core, "runtime-sha"), sourceSha: env.GITHUB_SHA, outputDir: path.join(env.GITHUB_WORKSPACE, ".buildchain/github-artifact-attestation"), preparation: JSON.parse(input(core, "preparation-json")),
|
|
23
18
|
bundlePath: input(core, "bundle-path"), attestationId: input(core, "attestation-id"), attestationUrl: input(core, "attestation-url"), token: input(core, "token"), environment: env,
|
|
24
19
|
workflow: { repository: env.GITHUB_REPOSITORY, runId: env.GITHUB_RUN_ID, runAttempt: env.GITHUB_RUN_ATTEMPT, job: env.GITHUB_JOB, url: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}` } });
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { requireValue } from "../../runtime/action-process.mjs";
|
|
2
2
|
export function validateAttestationInput(request) {
|
|
3
|
-
requireValue(
|
|
4
|
-
/^[0-9a-f]{40}$/u.test(request.runtimeSha || ""),
|
|
5
|
-
"buildchain-ref must be an exact 40-hex commit",
|
|
6
|
-
);
|
|
7
|
-
requireValue(
|
|
8
|
-
request.runtimeSha === request.definitionSha,
|
|
9
|
-
"attester runtime must match the defining signer workflow SHA",
|
|
10
|
-
);
|
|
11
3
|
requireValue(
|
|
12
4
|
request.evidenceRunId === request.currentRunId,
|
|
13
5
|
"attestation inputs must come from the current caller workflow run",
|
|
@@ -41,7 +41,6 @@ export function sealAttestation(
|
|
|
41
41
|
verify = verifyArtifactAttestationSigner,
|
|
42
42
|
) {
|
|
43
43
|
if (
|
|
44
|
-
preparation.policy.signer.workflowDigest !== runtimeSha ||
|
|
45
44
|
preparation.policy.caller.sourceSha !== sourceSha ||
|
|
46
45
|
preparation.policy.caller.repository !== workflow.repository
|
|
47
46
|
)
|
|
@@ -52,7 +51,7 @@ export function sealAttestation(
|
|
|
52
51
|
verify({
|
|
53
52
|
subjectPath: preparation.subjectPath,
|
|
54
53
|
repository: workflow.repository,
|
|
55
|
-
|
|
54
|
+
signerDigest: preparation.policy.signer.workflowDigest,
|
|
56
55
|
sourceSha,
|
|
57
56
|
predicateType: preparation.predicateType,
|
|
58
57
|
bundlePath,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { buildStageRecovery } from "../recovery/transaction.js";
|
|
1
2
|
import { readBuildActionContext } from "../plan/action-context.js";
|
|
2
3
|
import { runBuildStage } from "./stage.js";
|
|
3
4
|
export async function runBuildStageAction(core, env) {
|
|
@@ -9,6 +10,7 @@ export async function runBuildStageAction(core, env) {
|
|
|
9
10
|
);
|
|
10
11
|
await runBuildStage({
|
|
11
12
|
...context,
|
|
13
|
+
recovery: buildStageRecovery(context, core.getInput("token", { required: true })),
|
|
12
14
|
stage: core.getInput("stage", { required: true }),
|
|
13
15
|
environment: {
|
|
14
16
|
...environment,
|