@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,235 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://buildchain.libkungfu.dev/schema/v4-runtime-ref-resume-authority-v1.schema.json",
|
|
4
|
-
"title": "Buildchain v4 transient runtime authorization and resume lineage evidence",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"required": ["authorizationRoot", "authorization", "lineageRoot", "lineage"],
|
|
8
|
-
"properties": {
|
|
9
|
-
"authorizationRoot": { "$ref": "#/$defs/root" },
|
|
10
|
-
"authorization": { "$ref": "#/$defs/authorization" },
|
|
11
|
-
"lineageRoot": { "$ref": "#/$defs/root" },
|
|
12
|
-
"lineage": { "$ref": "#/$defs/lineage" }
|
|
13
|
-
},
|
|
14
|
-
"$defs": {
|
|
15
|
-
"root": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
16
|
-
"sha": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
17
|
-
"token": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$" },
|
|
18
|
-
"authorization": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"additionalProperties": false,
|
|
21
|
-
"required": [
|
|
22
|
-
"schemaVersion",
|
|
23
|
-
"contract",
|
|
24
|
-
"status",
|
|
25
|
-
"mode",
|
|
26
|
-
"eventName",
|
|
27
|
-
"repository",
|
|
28
|
-
"actor",
|
|
29
|
-
"reason",
|
|
30
|
-
"authorizedAt",
|
|
31
|
-
"source",
|
|
32
|
-
"request",
|
|
33
|
-
"runtime",
|
|
34
|
-
"contractLocks",
|
|
35
|
-
"consumerPolicyReceiptRoot",
|
|
36
|
-
"persistenceScanRoot"
|
|
37
|
-
],
|
|
38
|
-
"properties": {
|
|
39
|
-
"schemaVersion": { "const": 1 },
|
|
40
|
-
"contract": {
|
|
41
|
-
"const": "kungfu-buildchain-v4-runtime-authorization/v1"
|
|
42
|
-
},
|
|
43
|
-
"status": { "const": "authorized" },
|
|
44
|
-
"mode": { "enum": ["dispatch", "resume", "rescue"] },
|
|
45
|
-
"eventName": { "const": "workflow_dispatch" },
|
|
46
|
-
"repository": { "type": "string", "minLength": 3 },
|
|
47
|
-
"actor": { "$ref": "#/$defs/actor" },
|
|
48
|
-
"reason": { "type": "string", "minLength": 1 },
|
|
49
|
-
"authorizedAt": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"pattern": "^(?!0000)\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$"
|
|
52
|
-
},
|
|
53
|
-
"source": { "$ref": "#/$defs/source" },
|
|
54
|
-
"request": { "$ref": "#/$defs/request" },
|
|
55
|
-
"runtime": { "$ref": "#/$defs/runtime" },
|
|
56
|
-
"contractLocks": { "$ref": "#/$defs/contractLocks" },
|
|
57
|
-
"consumerPolicyReceiptRoot": { "$ref": "#/$defs/root" },
|
|
58
|
-
"persistenceScanRoot": { "$ref": "#/$defs/root" }
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"lineage": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"additionalProperties": false,
|
|
64
|
-
"required": [
|
|
65
|
-
"schemaVersion",
|
|
66
|
-
"contract",
|
|
67
|
-
"status",
|
|
68
|
-
"authorizationRoot",
|
|
69
|
-
"source",
|
|
70
|
-
"consumerPolicyReceiptRoot",
|
|
71
|
-
"attempts",
|
|
72
|
-
"floatingRefMovement",
|
|
73
|
-
"continuation",
|
|
74
|
-
"stageCapsules",
|
|
75
|
-
"finalPublicReadbackRoot"
|
|
76
|
-
],
|
|
77
|
-
"properties": {
|
|
78
|
-
"schemaVersion": { "const": 1 },
|
|
79
|
-
"contract": {
|
|
80
|
-
"const": "kungfu-buildchain-v4-runtime-resume-lineage/v1"
|
|
81
|
-
},
|
|
82
|
-
"status": { "const": "qualified" },
|
|
83
|
-
"authorizationRoot": { "$ref": "#/$defs/root" },
|
|
84
|
-
"source": { "$ref": "#/$defs/source" },
|
|
85
|
-
"consumerPolicyReceiptRoot": { "$ref": "#/$defs/root" },
|
|
86
|
-
"attempts": { "$ref": "#/$defs/attempts" },
|
|
87
|
-
"floatingRefMovement": { "$ref": "#/$defs/floatingRefMovement" },
|
|
88
|
-
"continuation": { "$ref": "#/$defs/continuation" },
|
|
89
|
-
"stageCapsules": { "$ref": "#/$defs/stageCapsules" },
|
|
90
|
-
"finalPublicReadbackRoot": { "$ref": "#/$defs/root" }
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"actor": {
|
|
94
|
-
"type": "object",
|
|
95
|
-
"additionalProperties": false,
|
|
96
|
-
"required": ["login", "permission"],
|
|
97
|
-
"properties": {
|
|
98
|
-
"login": { "type": "string", "minLength": 1 },
|
|
99
|
-
"permission": { "enum": ["write", "maintain", "admin"] }
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"source": {
|
|
103
|
-
"type": "object",
|
|
104
|
-
"additionalProperties": false,
|
|
105
|
-
"required": ["sha", "treeSha"],
|
|
106
|
-
"properties": {
|
|
107
|
-
"sha": { "$ref": "#/$defs/sha" },
|
|
108
|
-
"treeSha": { "$ref": "#/$defs/sha" }
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"request": {
|
|
112
|
-
"type": "object",
|
|
113
|
-
"additionalProperties": false,
|
|
114
|
-
"required": ["ref", "class"],
|
|
115
|
-
"properties": {
|
|
116
|
-
"ref": { "type": "string", "minLength": 1 },
|
|
117
|
-
"class": { "enum": ["exact-sha", "floating", "train", "authority"] }
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
"readback": {
|
|
121
|
-
"type": "object",
|
|
122
|
-
"additionalProperties": false,
|
|
123
|
-
"required": ["ref", "sha", "containsRuntimeSha", "readbackRoot"],
|
|
124
|
-
"properties": {
|
|
125
|
-
"ref": { "type": "string", "minLength": 1 },
|
|
126
|
-
"sha": { "$ref": "#/$defs/sha" },
|
|
127
|
-
"containsRuntimeSha": { "type": "boolean" },
|
|
128
|
-
"readbackRoot": { "$ref": "#/$defs/root" }
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"runtime": {
|
|
132
|
-
"type": "object",
|
|
133
|
-
"additionalProperties": false,
|
|
134
|
-
"required": ["sha", "reachableFrom"],
|
|
135
|
-
"properties": {
|
|
136
|
-
"sha": { "$ref": "#/$defs/sha" },
|
|
137
|
-
"reachableFrom": {
|
|
138
|
-
"type": "array",
|
|
139
|
-
"minItems": 1,
|
|
140
|
-
"uniqueItems": true,
|
|
141
|
-
"items": { "$ref": "#/$defs/readback" }
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"contractLocks": {
|
|
146
|
-
"type": "object",
|
|
147
|
-
"additionalProperties": false,
|
|
148
|
-
"required": ["stableRoot", "alphaRoot"],
|
|
149
|
-
"properties": {
|
|
150
|
-
"stableRoot": { "$ref": "#/$defs/root" },
|
|
151
|
-
"alphaRoot": { "$ref": "#/$defs/root" }
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
"attempt": {
|
|
155
|
-
"type": "object",
|
|
156
|
-
"additionalProperties": false,
|
|
157
|
-
"required": ["id", "runtimeSha"],
|
|
158
|
-
"properties": {
|
|
159
|
-
"id": { "$ref": "#/$defs/token" },
|
|
160
|
-
"runtimeSha": { "$ref": "#/$defs/sha" }
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"attempts": {
|
|
164
|
-
"type": "object",
|
|
165
|
-
"additionalProperties": false,
|
|
166
|
-
"required": ["build", "resume"],
|
|
167
|
-
"properties": {
|
|
168
|
-
"build": { "$ref": "#/$defs/attempt" },
|
|
169
|
-
"resume": { "$ref": "#/$defs/attempt" }
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
"refReadback": {
|
|
173
|
-
"type": "object",
|
|
174
|
-
"additionalProperties": false,
|
|
175
|
-
"required": ["ref", "sha"],
|
|
176
|
-
"properties": {
|
|
177
|
-
"ref": { "enum": ["v4", "v4-alpha"] },
|
|
178
|
-
"sha": { "$ref": "#/$defs/sha" }
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
"floatingRefMovement": {
|
|
182
|
-
"type": "object",
|
|
183
|
-
"additionalProperties": false,
|
|
184
|
-
"required": ["before", "after"],
|
|
185
|
-
"properties": {
|
|
186
|
-
"before": { "$ref": "#/$defs/refReadback" },
|
|
187
|
-
"after": { "$ref": "#/$defs/refReadback" }
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"continuation": {
|
|
191
|
-
"type": "object",
|
|
192
|
-
"additionalProperties": false,
|
|
193
|
-
"required": ["mechanism", "rerunFailedJobs", "resumePlanRoot"],
|
|
194
|
-
"properties": {
|
|
195
|
-
"mechanism": { "const": "new-governed-attempt" },
|
|
196
|
-
"rerunFailedJobs": { "const": false },
|
|
197
|
-
"resumePlanRoot": { "$ref": "#/$defs/root" }
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
"capsule": {
|
|
201
|
-
"type": "object",
|
|
202
|
-
"additionalProperties": false,
|
|
203
|
-
"required": ["platform", "capsuleRoot", "identityRoot", "artifactDigest"],
|
|
204
|
-
"properties": {
|
|
205
|
-
"platform": { "$ref": "#/$defs/token" },
|
|
206
|
-
"capsuleRoot": { "$ref": "#/$defs/root" },
|
|
207
|
-
"identityRoot": { "$ref": "#/$defs/root" },
|
|
208
|
-
"artifactDigest": { "$ref": "#/$defs/root" }
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
"stageCapsules": {
|
|
212
|
-
"type": "object",
|
|
213
|
-
"additionalProperties": false,
|
|
214
|
-
"required": ["requiredPlatforms", "reused", "rebuildPlatforms"],
|
|
215
|
-
"properties": {
|
|
216
|
-
"requiredPlatforms": {
|
|
217
|
-
"type": "array",
|
|
218
|
-
"minItems": 1,
|
|
219
|
-
"uniqueItems": true,
|
|
220
|
-
"items": { "$ref": "#/$defs/token" }
|
|
221
|
-
},
|
|
222
|
-
"reused": {
|
|
223
|
-
"type": "array",
|
|
224
|
-
"uniqueItems": true,
|
|
225
|
-
"items": { "$ref": "#/$defs/capsule" }
|
|
226
|
-
},
|
|
227
|
-
"rebuildPlatforms": {
|
|
228
|
-
"type": "array",
|
|
229
|
-
"uniqueItems": true,
|
|
230
|
-
"items": { "$ref": "#/$defs/token" }
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: draft
|
|
3
|
-
period: ongoing
|
|
4
|
-
theme: buildchain-v4-runtime-ref-resume-authority
|
|
5
|
-
doc_type: contract-guide
|
|
6
|
-
source_level: local-files
|
|
7
|
-
confidence: high
|
|
8
|
-
sensitivity: public
|
|
9
|
-
evidence_grade: A
|
|
10
|
-
review_state: unreviewed
|
|
11
|
-
last_reviewed: 2026-08-15
|
|
12
|
-
ai_provenance:
|
|
13
|
-
model_family: GPT-5
|
|
14
|
-
product: Codex
|
|
15
|
-
generated_at: 2026-08-14
|
|
16
|
-
invisible_context: not asserted
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Buildchain v4 transient runtime and resume authority
|
|
20
|
-
|
|
21
|
-
Buildchain v4 consumers keep `v4` or `v4-alpha` in tracked workflow source.
|
|
22
|
-
A train, authority ref, or exact SHA is transient run data, never a new
|
|
23
|
-
committed default. The public promotion router accepts that escape only from a
|
|
24
|
-
trusted `workflow_dispatch` actor with write, maintain, or admin permission.
|
|
25
|
-
Before heavy promotion work, it binds an exact source tree, operator reason,
|
|
26
|
-
dual consumer contract-lock roots, the floating-consumer policy receipt, a
|
|
27
|
-
clean persistence scan, and GitHub provider readbacks proving that the selected
|
|
28
|
-
runtime is reachable from an approved v4 ref.
|
|
29
|
-
|
|
30
|
-
The persistence scan covers tracked workflow, composite-action, JSON, TOML, and
|
|
31
|
-
YAML surfaces. Exact SHA, train/authority defaults, and runtime selectors hidden
|
|
32
|
-
through repository variables, secrets, or environment indirection reject the
|
|
33
|
-
run. OIDC, IAM, and other external authority references are inventoried as
|
|
34
|
-
metadata only; credential values are never read or written to evidence.
|
|
35
|
-
|
|
36
|
-
## Resume after a floating ref moves
|
|
37
|
-
|
|
38
|
-
A late platform failure is resumed as a new governed attempt. It is not a
|
|
39
|
-
GitHub failed-job rerun. The lineage keeps runtime A (the runtime that built and
|
|
40
|
-
sealed each reusable Stage Capsule) separate from runtime B (the authorized
|
|
41
|
-
runtime executing the new attempt). A Capsule is reusable only when its source
|
|
42
|
-
SHA, source tree, platform, policy root, build runtime, identity root, Capsule
|
|
43
|
-
root, and artifact digest still match. Valid unaffected platforms are restored;
|
|
44
|
-
only missing platforms rebuild. Stale, ambiguous, unsealed, cross-source, or
|
|
45
|
-
cross-policy evidence fails closed.
|
|
46
|
-
|
|
47
|
-
This deliberately does not weaken the existing Stage Capsule resume planner's
|
|
48
|
-
`runtime-changed` invalidation. That planner decides whether a stage may be
|
|
49
|
-
reused under one expected build identity. This contract instead proves that an
|
|
50
|
-
already sealed output built under runtime A remains the exact product input
|
|
51
|
-
while a distinct orchestration attempt runs under runtime B. Runtime B never
|
|
52
|
-
rewrites the Capsule's build identity.
|
|
53
|
-
|
|
54
|
-
Final Release Passport evidence embeds the complete authorization receipt and
|
|
55
|
-
the A+B resume lineage under `v4RuntimeResume`. The section binds the new
|
|
56
|
-
attempt, floating-ref movement, reused and rebuilt platform partition,
|
|
57
|
-
consumer-policy receipt, resume plan, and final public readback roots. Tampering
|
|
58
|
-
with either document or crossing authorization/lineage roots rejects Passport
|
|
59
|
-
construction and verification.
|
|
60
|
-
|
|
61
|
-
Normative files:
|
|
62
|
-
|
|
63
|
-
- `architecture/runtime-ref-resume-authority.json`
|
|
64
|
-
- `contracts/v4-runtime-ref-resume-authority-v1.schema.json`
|
|
65
|
-
- `packages/core/consumer/runtime-ref-resume-authority.js`
|
|
66
|
-
- `packages/core/release/runtime-override-authorization.js`
|
|
67
|
-
|
|
68
|
-
This contract changes no v3 behavior, grants no provider mutation authority,
|
|
69
|
-
and stores no credential material.
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
const CHANNELS = new Set(["auto", "alpha", "stable"]);
|
|
2
|
-
const STABLE_PUBLISH_CHANNELS = new Set(["release", "major"]);
|
|
3
|
-
const OFFICIAL_REF = /^v(\d+)(?:\.\d+)?(?:-alpha)?$/;
|
|
4
|
-
const EXACT_SHA = /^[0-9a-f]{40}$/i;
|
|
5
|
-
const TRAIN_REF =
|
|
6
|
-
/^(?:refs\/heads\/)?train\/v(\d+)\/v\d+\.\d+\/[A-Za-z0-9._/-]+$/;
|
|
7
|
-
const AUTHORITY_REF =
|
|
8
|
-
/^(?:refs\/heads\/)?authority\/v(\d+)\/v\d+\.\d+\/[A-Za-z0-9._/-]+$/;
|
|
9
|
-
const SEMVER_TAG = /^refs\/tags\/v?\d+\.\d+\.\d+(?:-([0-9A-Za-z.-]+))?$/;
|
|
10
|
-
|
|
11
|
-
function normalized(value) {
|
|
12
|
-
return String(value ?? "").trim();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function parseBoolean(value, name) {
|
|
16
|
-
const text = normalized(value).toLowerCase();
|
|
17
|
-
if (text === "true") return true;
|
|
18
|
-
if (text === "false") return false;
|
|
19
|
-
throw new Error(`${name} must be true or false`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function majorFrom(value) {
|
|
23
|
-
const text = normalized(value).replace(/^refs\/(?:heads|tags)\//, "");
|
|
24
|
-
const official = text.match(OFFICIAL_REF);
|
|
25
|
-
if (official) return Number(official[1]);
|
|
26
|
-
const train = text.match(TRAIN_REF);
|
|
27
|
-
if (train) return Number(train[1]);
|
|
28
|
-
const authority = text.match(AUTHORITY_REF);
|
|
29
|
-
if (authority) return Number(authority[1]);
|
|
30
|
-
const embedded = text.match(/(?:^|\/)v(\d+)(?:$|[./-])/);
|
|
31
|
-
if (embedded) return Number(embedded[1]);
|
|
32
|
-
const version = text.match(/^(\d+)\.\d+\.\d+/);
|
|
33
|
-
return version ? Number(version[1]) : undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function resolveMajor({ requestedRef, routerRef, packageVersion }) {
|
|
37
|
-
for (const candidate of [requestedRef, routerRef, packageVersion]) {
|
|
38
|
-
const major = majorFrom(candidate);
|
|
39
|
-
if (Number.isInteger(major)) return major;
|
|
40
|
-
}
|
|
41
|
-
throw new Error(
|
|
42
|
-
"unable to derive the Buildchain major; call the router from a vN ref or provide a vN buildchain-ref",
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function classifyRequestedRef(value) {
|
|
47
|
-
const ref = normalized(value).replace(/^refs\/(?:heads|tags)\//, "");
|
|
48
|
-
if (!ref) return { kind: "none", ref };
|
|
49
|
-
if (EXACT_SHA.test(ref)) return { kind: "override", ref };
|
|
50
|
-
if (TRAIN_REF.test(value) || TRAIN_REF.test(ref)) {
|
|
51
|
-
return {
|
|
52
|
-
kind: "override",
|
|
53
|
-
ref: normalized(value).replace(/^refs\/heads\//, ""),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (AUTHORITY_REF.test(value) || AUTHORITY_REF.test(ref)) {
|
|
57
|
-
return {
|
|
58
|
-
kind: "override",
|
|
59
|
-
ref: normalized(value).replace(/^refs\/heads\//, ""),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const official = ref.match(OFFICIAL_REF);
|
|
63
|
-
if (official) {
|
|
64
|
-
return {
|
|
65
|
-
kind: ref.endsWith("-alpha") ? "alpha" : "stable",
|
|
66
|
-
ref,
|
|
67
|
-
major: Number(official[1]),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
throw new Error(
|
|
71
|
-
"buildchain-ref must be an official vN/vN.M channel, a train ref, an authority ref, or an exact 40-character SHA",
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function selected(channel, major, source, reason) {
|
|
76
|
-
return {
|
|
77
|
-
channel,
|
|
78
|
-
major,
|
|
79
|
-
buildchainRef: channel === "alpha" ? `v${major}-alpha` : `v${major}`,
|
|
80
|
-
runtimeOverride: false,
|
|
81
|
-
selectionSource: source,
|
|
82
|
-
reason,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function resolveBuildchainChannel({
|
|
87
|
-
requestedChannel = "auto",
|
|
88
|
-
requestedRef = "",
|
|
89
|
-
publishChannel = "none",
|
|
90
|
-
eventName = "",
|
|
91
|
-
gitRef = "",
|
|
92
|
-
releasePrerelease = "",
|
|
93
|
-
routerRef = "",
|
|
94
|
-
packageVersion = "",
|
|
95
|
-
} = {}) {
|
|
96
|
-
const channel = normalized(requestedChannel || "auto").toLowerCase();
|
|
97
|
-
if (!CHANNELS.has(channel)) {
|
|
98
|
-
throw new Error("buildchain-channel must be auto, alpha, or stable");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const explicitRef = classifyRequestedRef(requestedRef);
|
|
102
|
-
const major = resolveMajor({
|
|
103
|
-
requestedRef: explicitRef.ref,
|
|
104
|
-
routerRef,
|
|
105
|
-
packageVersion,
|
|
106
|
-
});
|
|
107
|
-
if (explicitRef.kind !== "none") {
|
|
108
|
-
if (
|
|
109
|
-
channel !== "auto" &&
|
|
110
|
-
explicitRef.kind !== "override" &&
|
|
111
|
-
channel !== explicitRef.kind
|
|
112
|
-
) {
|
|
113
|
-
throw new Error(
|
|
114
|
-
`buildchain-channel=${channel} conflicts with buildchain-ref=${explicitRef.ref}`,
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
if (explicitRef.kind === "override") {
|
|
118
|
-
const lane = resolveBuildchainChannel({
|
|
119
|
-
requestedChannel: channel,
|
|
120
|
-
requestedRef: "",
|
|
121
|
-
publishChannel,
|
|
122
|
-
eventName,
|
|
123
|
-
gitRef,
|
|
124
|
-
releasePrerelease,
|
|
125
|
-
routerRef: `v${major}`,
|
|
126
|
-
packageVersion,
|
|
127
|
-
});
|
|
128
|
-
return {
|
|
129
|
-
...lane,
|
|
130
|
-
major,
|
|
131
|
-
buildchainRef: explicitRef.ref,
|
|
132
|
-
runtimeOverride: true,
|
|
133
|
-
selectionSource: "explicit-buildchain-ref+channel-evidence",
|
|
134
|
-
reason: `trusted runtime override ${explicitRef.ref} bound to ${lane.channel}`,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
return {
|
|
138
|
-
channel: explicitRef.kind,
|
|
139
|
-
major,
|
|
140
|
-
buildchainRef: explicitRef.ref,
|
|
141
|
-
runtimeOverride: false,
|
|
142
|
-
selectionSource: "explicit-buildchain-ref",
|
|
143
|
-
reason: `explicit Buildchain runtime ref ${explicitRef.ref}`,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (channel !== "auto") {
|
|
148
|
-
return selected(
|
|
149
|
-
channel,
|
|
150
|
-
major,
|
|
151
|
-
"explicit-channel",
|
|
152
|
-
`explicit buildchain-channel=${channel}`,
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const publishing = normalized(publishChannel || "none").toLowerCase();
|
|
157
|
-
if (publishing === "alpha") {
|
|
158
|
-
return selected("alpha", major, "publish-channel", "publish-channel=alpha");
|
|
159
|
-
}
|
|
160
|
-
if (STABLE_PUBLISH_CHANNELS.has(publishing)) {
|
|
161
|
-
return selected(
|
|
162
|
-
"stable",
|
|
163
|
-
major,
|
|
164
|
-
"publish-channel",
|
|
165
|
-
`publish-channel=${publishing}`,
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
if (publishing !== "none") {
|
|
169
|
-
throw new Error(
|
|
170
|
-
`custom publish-channel=${publishing} requires an explicit buildchain-channel`,
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (eventName === "release") {
|
|
175
|
-
if (normalized(releasePrerelease) === "") {
|
|
176
|
-
throw new Error(
|
|
177
|
-
"release events require github.event.release.prerelease to select a Buildchain channel",
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
const prerelease = parseBoolean(releasePrerelease, "releasePrerelease");
|
|
181
|
-
return selected(
|
|
182
|
-
prerelease ? "alpha" : "stable",
|
|
183
|
-
major,
|
|
184
|
-
"release-event",
|
|
185
|
-
prerelease ? "GitHub prerelease event" : "GitHub stable release event",
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const ref = normalized(gitRef);
|
|
190
|
-
if (ref.startsWith("refs/tags/")) {
|
|
191
|
-
const tag = ref.match(SEMVER_TAG);
|
|
192
|
-
if (!tag) {
|
|
193
|
-
throw new Error(
|
|
194
|
-
`tag ${ref} is not a canonical semver release tag; set buildchain-channel explicitly`,
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
return selected(
|
|
198
|
-
tag[1] ? "alpha" : "stable",
|
|
199
|
-
major,
|
|
200
|
-
"semver-tag",
|
|
201
|
-
tag[1] ? `prerelease tag ${ref}` : `stable tag ${ref}`,
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return selected(
|
|
206
|
-
"alpha",
|
|
207
|
-
major,
|
|
208
|
-
"development-default",
|
|
209
|
-
`non-release ${eventName || "unknown"} event`,
|
|
210
|
-
);
|
|
211
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
|
|
7
|
-
import { resolveBuildchainChannel } from "../channel-selection.js";
|
|
8
|
-
function readPackageVersion(cwd) {
|
|
9
|
-
try {
|
|
10
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, "package.json"), "utf8")).version || "";
|
|
11
|
-
} catch {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function parseArgs(argv) {
|
|
17
|
-
const values = {};
|
|
18
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
19
|
-
const token = argv[index];
|
|
20
|
-
if (!token.startsWith("--")) throw new Error(`unexpected argument: ${token}`);
|
|
21
|
-
const key = token.slice(2);
|
|
22
|
-
const value = argv[index + 1];
|
|
23
|
-
if (value === undefined || value.startsWith("--")) throw new Error(`missing value for --${key}`);
|
|
24
|
-
values[key] = value;
|
|
25
|
-
index += 1;
|
|
26
|
-
}
|
|
27
|
-
return values;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function appendOutputs(file, result) {
|
|
31
|
-
const entries = {
|
|
32
|
-
channel: result.channel,
|
|
33
|
-
major: String(result.major),
|
|
34
|
-
"buildchain-ref": result.buildchainRef,
|
|
35
|
-
"runtime-override": String(result.runtimeOverride),
|
|
36
|
-
"selection-source": result.selectionSource,
|
|
37
|
-
reason: result.reason,
|
|
38
|
-
};
|
|
39
|
-
fs.appendFileSync(file, Object.entries(entries).map(([key, value]) => `${key}=${value}\n`).join(""));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function appendSummary(file, result) {
|
|
43
|
-
fs.appendFileSync(
|
|
44
|
-
file,
|
|
45
|
-
[
|
|
46
|
-
"## Buildchain channel router",
|
|
47
|
-
"",
|
|
48
|
-
`- selected channel: \`${result.channel}\``,
|
|
49
|
-
`- selected runtime ref: \`${result.buildchainRef}\``,
|
|
50
|
-
`- selection source: \`${result.selectionSource}\``,
|
|
51
|
-
`- reason: ${result.reason}`,
|
|
52
|
-
"",
|
|
53
|
-
].join("\n"),
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function main() {
|
|
58
|
-
const args = parseArgs(process.argv.slice(2));
|
|
59
|
-
const cwd = path.resolve(args.cwd || process.cwd());
|
|
60
|
-
const result = resolveBuildchainChannel({
|
|
61
|
-
requestedChannel: args.channel,
|
|
62
|
-
requestedRef: args["buildchain-ref"],
|
|
63
|
-
publishChannel: args["publish-channel"],
|
|
64
|
-
eventName: args["event-name"],
|
|
65
|
-
gitRef: args.ref,
|
|
66
|
-
releasePrerelease: args["release-prerelease"],
|
|
67
|
-
routerRef: args["router-ref"],
|
|
68
|
-
packageVersion: readPackageVersion(cwd),
|
|
69
|
-
});
|
|
70
|
-
if (process.env.GITHUB_OUTPUT) appendOutputs(process.env.GITHUB_OUTPUT, result);
|
|
71
|
-
if (process.env.GITHUB_STEP_SUMMARY) appendSummary(process.env.GITHUB_STEP_SUMMARY, result);
|
|
72
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const isMain = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
76
|
-
if (isMain) {
|
|
77
|
-
main().catch((error) => {
|
|
78
|
-
console.error(`buildchain-channel-router: ${error.message}`);
|
|
79
|
-
process.exitCode = 1;
|
|
80
|
-
});
|
|
81
|
-
}
|