@kungfu-tech/buildchain 4.0.9 → 4.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +35 -5
- package/CONTRIBUTING.md +18 -29
- package/README.md +55 -29
- package/actions/build/artifact/prepare-attestation/README.md +26 -0
- package/actions/build/artifact/seal-attestation/README.md +26 -0
- package/actions/build/lifecycle/run/README.md +71 -0
- package/actions/build/lifecycle/validate/README.md +52 -0
- package/actions/governance/incident/report/README.md +107 -0
- package/actions/release/promotion/ref/README.md +92 -0
- package/architecture/action-taxonomy.json +543 -0
- package/architecture/agent-change-map.md +2061 -431
- package/architecture/build-environments.json +18 -2
- package/architecture/build-orchestration.json +58 -9
- package/architecture/capability-state-machine-manifest.json +15 -16
- package/architecture/capability-state-machine-manifest.schema.json +2 -2
- package/architecture/ci-lane-change-budget.json +2105 -225
- package/architecture/code-layout.json +55 -0
- package/architecture/core-mechanisms.json +1160 -0
- package/architecture/cross-platform-adopter-qualification.json +4 -14
- package/architecture/delivery-authority-parity.json +46 -46
- package/architecture/delivery-warrant-shadow-bootstrap-plan.json +4 -4
- package/architecture/delivery-warrant-shadow-bootstrap-plan.md +3 -3
- package/architecture/dev-delivery-orchestration.json +175 -0
- package/architecture/floating-consumer-policy.json +15 -11
- package/architecture/history/warrant-shadow-observations.json +900 -0
- package/architecture/internal-capabilities.json +2332 -358
- package/architecture/layered-transition.json +32 -0
- package/architecture/maintainability-debt.json +883 -1840
- package/architecture/maintainability-policy.json +63 -1438
- package/architecture/partial-mutation-recovery-qualification.json +4 -4
- package/architecture/platform-stage-checkpoints.json +1 -1
- package/architecture/promotion-job-topology.json +85 -0
- package/architecture/provider-operation-journal-contract.json +5 -5
- package/architecture/publication-facade-patches.json +5 -5
- package/architecture/release-activation-shadow-domain.json +4 -4
- package/architecture/release-invocation-fixtures.json +31 -16
- package/architecture/release-tail-contract-inventory.json +1 -9
- package/architecture/release-tail-contract.json +273 -0
- package/architecture/release-topology.json +245 -215
- package/architecture/runtime-ref-resume-authority.json +1 -1
- package/architecture/runtime-semantic-closure.json +27 -17
- package/architecture/rust-libnode-bridge-evaluation.json +1 -1
- package/architecture/rust-wasm-production-authority.json +7 -7
- package/architecture/stable-publication-fence.json +4 -4
- package/architecture/stage-capsule-qualification.json +4 -4
- package/architecture/stage-capsule-resume-planner.json +1 -1
- package/architecture/stage-capsule-store-contract.json +2 -2
- package/architecture/tail-reseal-parity.json +22 -17
- package/architecture/universal-workflow-bootstrap.json +121 -102
- package/architecture/universal-workflow-fault-campaign.json +11 -11
- package/architecture/universal-workflow-train-admission.json +44 -8
- package/architecture/workflow-taxonomy.json +81 -798
- package/bin/buildchain.mjs +2 -1820
- package/contracts/buildchain-v2-residuals-v1.json +2 -138
- package/contracts/dev-delivery-authority-v2.schema.json +509 -231
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/contracts/promotion-invocation-v1.schema.json +547 -0
- package/contracts/promotion-request-v1.schema.json +472 -0
- package/contracts/v4-adopter-delivery-v1.schema.json +1 -1
- package/contracts/v4-compatibility-facts-v1.schema.json +4 -4
- package/contracts/v4-floating-consumer-policy-receipt-v1.schema.json +124 -21
- package/contracts/v4-release-invocation-v1.schema.json +1 -1
- package/crates/buildchain-host-bridge/src/main.rs +1 -1
- package/dist/site/buildchain-contract.json +145 -2206
- package/dist/site/buildchain-site.json +350 -326
- package/dist/site/capability-registry.json +17 -17
- package/dist/site/cli-registry.json +354 -365
- package/dist/site/controller-registry.json +142 -715
- package/dist/site/kfd-claims.json +5871 -3138
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +26 -26
- package/dist/site/node-api-registry.json +12561 -16063
- package/dist/site/page-registry.json +312 -292
- package/dist/site/public-surface-audit.json +3844 -3601
- package/dist/site/publication-authority-registry.json +295 -1117
- package/dist/site/publication-registry.json +5 -5
- package/dist/site/release-provenance.json +80 -90
- package/dist/site/schemas/dev-delivery-authority-v2.schema.json +509 -231
- package/dist/site/schemas/v4-adopter-delivery-v1.schema.json +1 -1
- package/dist/site/schemas/v4-compatibility-facts-v1.schema.json +4 -4
- package/dist/site/site-manifest.json +31 -31
- package/dist/site/workflow-registry.json +7274 -5321
- package/docs/MAP.md +8 -6
- package/docs/auditable-demo.md +4 -4
- package/docs/aws-us-elastic-runner-burst-plane.md +5 -5
- package/docs/binary-distribution.md +2 -2
- package/docs/bootstrap-recovery.md +50 -0
- package/docs/cli-reference.md +2 -35
- package/docs/cli.md +6 -6
- package/docs/code-organization.md +131 -0
- package/docs/consumer-issue-reporting.md +1 -1
- package/docs/dev-alpha-candidate-patrol.md +1 -1
- package/docs/dev-delivery-orchestration.md +116 -0
- package/docs/dev-delivery-qualification-landing-adr.md +1 -1
- package/docs/dev-delivery-warrant.md +5 -2
- package/docs/dev-qualification-patrol.md +1 -1
- package/docs/engineering-housekeeper.md +3 -3
- package/docs/github-artifact-attestation.md +3 -3
- package/docs/kfd-support.md +1 -1
- package/docs/lifecycle-protocol.md +8 -8
- package/docs/migration-inventory.md +6 -6
- package/docs/next-development-transition.md +4 -4
- package/docs/node-api-reference.md +2273 -2644
- package/docs/ownership.md +3 -3
- package/docs/publication-artifacts.md +5 -5
- package/docs/publication-authority.md +4 -4
- package/docs/publish-transaction.md +10 -10
- package/docs/release-activation-transaction.md +1 -1
- package/docs/release-candidate.md +4 -4
- package/docs/release-governance.md +25 -25
- package/docs/release-passport.md +2 -2
- package/docs/release-promotion-request.md +64 -0
- package/docs/release-propagation.md +19 -18
- package/docs/release-tail-contract.md +40 -76
- package/docs/release-tail-provider-plane.md +17 -26
- package/docs/reusable-build-surface.md +34 -21
- package/docs/shifu-gate-profiles.md +4 -4
- package/docs/site-bundle-contract.md +1 -1
- package/docs/stable-candidate-patrol.md +1 -1
- package/docs/v4-adopter-delivery.md +50 -121
- package/docs/v4-canonical-contracts.md +3 -3
- package/docs/v4-compatibility-facts.md +1 -1
- package/docs/v4-declarative-release-tail-migration.md +24 -29
- package/docs/v4-production-release.md +16 -1
- package/docs/v4-publication-rehearsal.md +1 -1
- package/docs/v4-runtime-ref-resume-authority.md +2 -2
- package/docs/v4-rust-wasm-production-authority.md +2 -2
- package/docs/v4-stage-capsule.md +1 -1
- package/docs/web-surface-deployments.md +22 -28
- package/docs/workflow-catalog.md +82 -127
- package/docs/workflow-path-migration.md +1 -5
- package/package.json +99 -102
- package/packages/core/README.md +41 -164
- package/packages/core/adoption/adopter-delivery-parity.js +219 -0
- package/packages/core/adoption/adopter-delivery.js +210 -0
- package/packages/core/adoption/buildchain-kfd-claims.js +733 -0
- package/packages/core/adoption/cli/delivery.mjs +39 -0
- package/packages/core/adoption/cli/dispatch.mjs +5 -0
- package/packages/core/adoption/cli/kfd-aggregate.mjs +20 -0
- package/packages/core/adoption/cli/kfd-hub.mjs +53 -0
- package/packages/core/adoption/cli/kfd-migrate-layout.mjs +27 -0
- package/packages/core/adoption/cli/kfd-schema.mjs +55 -0
- package/packages/core/adoption/cli/kfd-status.mjs +21 -0
- package/packages/core/adoption/cli/kfd-upstream.mjs +69 -0
- package/packages/core/adoption/cli/kfd.mjs +63 -0
- package/packages/core/adoption/cli/output.mjs +18 -0
- package/packages/core/adoption/cli/product-gate.mjs +110 -0
- package/packages/core/adoption/cli/project.mjs +38 -0
- package/packages/core/adoption/cli/standards.mjs +282 -0
- package/packages/core/adoption/cli/support.mjs +101 -0
- package/packages/core/adoption/cli/surface-register.mjs +172 -0
- package/packages/core/adoption/commands/cross-platform-adopter-qualification.mjs +28 -0
- package/packages/core/adoption/commands/init-repo.mjs +518 -0
- package/packages/core/adoption/cross-platform-adopter-qualification.js +217 -0
- package/packages/core/adoption/kfd-agent-hub.js +496 -0
- package/packages/core/adoption/kfd.js +966 -0
- package/packages/core/adoption/kfd2-product-claims.js +454 -0
- package/packages/core/adoption/kfd3-surface-register.js +924 -0
- package/packages/core/adoption/qualification/actions.js +106 -0
- package/packages/core/adoption/qualification/admission.js +96 -0
- package/packages/core/adoption/qualification/aggregate.js +10 -0
- package/packages/core/adoption/qualification/io.js +51 -0
- package/packages/core/adoption/qualification/platform.js +120 -0
- package/packages/core/build/anchored-version-material.js +281 -0
- package/packages/core/build/artifact/actions.js +47 -0
- package/packages/core/build/artifact/attestation.js +166 -0
- package/packages/core/build/artifact/contracts.js +168 -0
- package/packages/core/build/artifact/coordinates.js +113 -0
- package/packages/core/build/artifact/credential-transport.js +68 -0
- package/packages/core/build/artifact/expectations.js +94 -0
- package/packages/core/build/artifact/files.js +14 -0
- package/packages/core/build/artifact/naming.js +65 -0
- package/packages/core/build/artifact/services.js +17 -0
- package/packages/core/build/artifact/store.js +119 -0
- package/packages/core/build/artifact/summary.js +20 -0
- package/packages/core/build/artifact/transfer-policy.js +34 -0
- package/packages/core/build/artifact/transport.js +112 -0
- package/packages/core/build/artifact/upload.js +178 -0
- package/packages/core/build/artifact-coordinate-action.js +46 -0
- package/packages/core/build/artifact-coordinate.js +58 -0
- package/packages/core/build/artifact-integrity.js +10 -0
- package/packages/core/build/artifact-passport.js +842 -0
- package/packages/core/build/artifact-verification-envelope.js +500 -0
- package/packages/core/build/binary/actions.js +77 -0
- package/packages/core/build/binary/checksums.js +33 -0
- package/packages/core/build/binary/distribution.js +271 -0
- package/packages/core/build/binary-publication-dispatch.js +49 -0
- package/packages/core/build/build-facts.js +518 -0
- package/packages/core/build/cache/compiler-evidence.js +287 -0
- package/packages/core/build/cli/cache.mjs +77 -0
- package/packages/core/build/cli/facts.mjs +120 -0
- package/packages/core/build/cli/homebrew.mjs +101 -0
- package/packages/core/build/cli/lifecycle.mjs +66 -0
- package/packages/core/build/commands/aggregate-build-summary.mjs +75 -0
- package/packages/core/build/commands/anchored-version-material.mjs +42 -0
- package/packages/core/build/commands/artifact-signing-controller.mjs +112 -0
- package/packages/core/build/commands/artifact-signing-delegation.mjs +34 -0
- package/packages/core/build/commands/auditable-demo-platform.mjs +77 -0
- package/packages/core/build/commands/auditable-demo-transport-smoke.mjs +24 -0
- package/packages/core/build/commands/auditable-demo.mjs +63 -0
- package/packages/core/build/commands/compiler-cache-evidence.mjs +39 -0
- package/packages/core/build/commands/dispatch-artifact-signing-authority.mjs +19 -0
- package/packages/core/build/commands/import-artifact-signing-results.mjs +10 -0
- package/packages/core/build/commands/lifecycle-substage-evidence.mjs +42 -0
- package/packages/core/build/commands/resolve-artifact-coordinates.mjs +58 -0
- package/packages/core/build/commands/resolve-artifact-transfer-mode.mjs +54 -0
- package/packages/core/build/commands/resolve-build-configuration.mjs +23 -0
- package/packages/core/build/commands/resolve-build-contract.mjs +94 -0
- package/packages/core/build/commands/run-candidate-body-prefix-renderer.mjs +24 -0
- package/packages/core/build/commands/run-lifecycle.mjs +56 -0
- package/packages/core/build/commands/seal-artifact-signing-requests.mjs +10 -0
- package/packages/core/build/commands/seal-macos-credential-input.mjs +4 -0
- package/packages/core/build/commands/shifu-gate-profile.mjs +43 -0
- package/packages/core/build/commands/source-verification-evidence.mjs +14 -0
- package/packages/core/build/commands/stage-capsule-qualification.mjs +79 -0
- package/packages/core/build/commands/validate-package-manager-contract.mjs +24 -0
- package/packages/core/build/credential/seal-input.js +109 -0
- package/packages/core/build/demo/action-context.js +25 -0
- package/packages/core/build/demo/adapter-actions.js +35 -0
- package/packages/core/build/demo/adapter-transactions.js +66 -0
- package/packages/core/build/demo/adapter.js +272 -0
- package/packages/core/build/demo/binary-action.js +29 -0
- package/packages/core/build/demo/bundle-verification.js +211 -0
- package/packages/core/build/demo/capture-adaptation.js +37 -0
- package/packages/core/build/demo/capture.js +377 -0
- package/packages/core/build/demo/collection-actions.js +62 -0
- package/packages/core/build/demo/collection-containers.js +136 -0
- package/packages/core/build/demo/collection-context.js +40 -0
- package/packages/core/build/demo/collection.js +129 -0
- package/packages/core/build/demo/composition.js +319 -0
- package/packages/core/build/demo/container.js +113 -0
- package/packages/core/build/demo/gate.js +297 -0
- package/packages/core/build/demo/inspection-worker.js +4 -0
- package/packages/core/build/demo/io.js +220 -0
- package/packages/core/build/demo/materialization.js +350 -0
- package/packages/core/build/demo/media-bundle.js +112 -0
- package/packages/core/build/demo/media-inspection.js +332 -0
- package/packages/core/build/demo/media-profile.js +399 -0
- package/packages/core/build/demo/media-qualification-action.js +37 -0
- package/packages/core/build/demo/media-qualification.js +117 -0
- package/packages/core/build/demo/presentation.js +222 -0
- package/packages/core/build/demo/publication.js +118 -0
- package/packages/core/build/demo/renderer-evidence.js +193 -0
- package/packages/core/build/demo/renditions.js +398 -0
- package/packages/core/build/demo/scenario.js +493 -0
- package/packages/core/build/demo/schema.js +278 -0
- package/packages/core/build/demo/transport-smoke.js +149 -0
- package/packages/core/build/demo/values.js +137 -0
- package/packages/core/build/environment/action.js +17 -0
- package/packages/core/build/environment/provision.js +121 -0
- package/packages/core/build/gate/actions.js +99 -0
- package/packages/core/build/gate/aggregate.js +21 -0
- package/packages/core/build/gate/commands.js +66 -0
- package/packages/core/build/gate/controller.js +43 -0
- package/packages/core/build/gate/environment.js +18 -0
- package/packages/core/build/gate/execution.js +88 -0
- package/packages/core/build/gate/files.js +46 -0
- package/packages/core/build/gate/outputs.js +31 -0
- package/packages/core/build/gate/plan.js +61 -0
- package/packages/core/build/github-artifact-attestation.js +642 -0
- package/packages/core/build/github-attestation/action.js +26 -0
- package/packages/core/build/github-attestation/admission.js +34 -0
- package/packages/core/build/github-attestation/transaction.js +83 -0
- package/packages/core/build/homebrew.js +416 -0
- package/packages/core/build/lifecycle/action.js +65 -0
- package/packages/core/build/lifecycle/artifacts.js +123 -0
- package/packages/core/build/lifecycle/context.js +202 -0
- package/packages/core/build/lifecycle/diagnostics.js +254 -0
- package/packages/core/build/lifecycle/errors.js +44 -0
- package/packages/core/build/lifecycle/execution.js +221 -0
- package/packages/core/build/lifecycle/files.js +61 -0
- package/packages/core/build/lifecycle/manifest.js +107 -0
- package/packages/core/build/lifecycle/sampling.js +209 -0
- package/packages/core/build/lifecycle/stage-action.js +18 -0
- package/packages/core/build/lifecycle/stage.js +143 -0
- package/packages/core/build/lifecycle/substage-evidence.js +232 -0
- package/packages/core/build/lifecycle/transaction.js +13 -0
- package/packages/core/build/macos-credential-island/action.js +704 -0
- package/packages/core/build/macos-credential-island/cleanup.js +48 -0
- package/packages/core/build/macos-credential-island/dmg-assembly.js +443 -0
- package/packages/core/build/macos-credential-island/lib.js +816 -0
- package/packages/core/build/package-manager.js +315 -0
- package/packages/core/build/plan/action-context.js +30 -0
- package/packages/core/build/plan/action.js +79 -0
- package/packages/core/build/plan/admission.js +93 -0
- package/packages/core/build/plan/configuration.js +196 -0
- package/packages/core/build/plan/environment.js +18 -0
- package/packages/core/build/plan/identity.js +49 -0
- package/packages/core/build/plan/lifecycle.js +38 -0
- package/packages/core/build/plan/matrices.js +58 -0
- package/packages/core/build/plan/resolve.js +76 -0
- package/packages/core/build/plan/runners.js +48 -0
- package/packages/core/build/plan/source.js +58 -0
- package/packages/core/build/plan/stage-order.js +10 -0
- package/packages/core/build/plan/values.js +10 -0
- package/packages/core/build/platform-stage-checkpoints.js +471 -0
- package/packages/core/build/release-evidence-bundle.js +156 -0
- package/packages/core/build/runner/matrix.js +266 -0
- package/packages/core/build/runner/presets.js +115 -0
- package/packages/core/build/signing/actions.js +54 -0
- package/packages/core/build/signing/authority-actions.js +147 -0
- package/packages/core/build/signing/authority-transaction.js +82 -0
- package/packages/core/build/signing/control.js +223 -0
- package/packages/core/build/signing/controller-transaction.js +110 -0
- package/packages/core/build/signing/credential-transaction.js +66 -0
- package/packages/core/build/signing/delegation.js +281 -0
- package/packages/core/build/signing/detached.js +170 -0
- package/packages/core/build/signing/dispatch.js +307 -0
- package/packages/core/build/signing/environment.js +13 -0
- package/packages/core/build/signing/files.js +53 -0
- package/packages/core/build/signing/import-results.js +151 -0
- package/packages/core/build/signing/intake.js +113 -0
- package/packages/core/build/signing/materialize.js +54 -0
- package/packages/core/build/signing/merge-results.js +82 -0
- package/packages/core/build/signing/native-result.js +244 -0
- package/packages/core/build/signing/prepare.js +44 -0
- package/packages/core/build/signing/request.js +519 -0
- package/packages/core/build/signing/seal-requests.js +402 -0
- package/packages/core/build/signing/transaction.js +158 -0
- package/packages/core/build/signing/verify-results.js +118 -0
- package/packages/core/build/source/checkout-action.js +16 -0
- package/packages/core/build/source/controller-actions.js +52 -0
- package/packages/core/build/source/controller.js +182 -0
- package/packages/core/build/source/lifecycle-action.js +32 -0
- package/packages/core/build/source/lifecycle.js +134 -0
- package/packages/core/build/source/proof-actions.js +57 -0
- package/packages/core/build/source/proof-lookup.js +82 -0
- package/packages/core/build/source/proof.js +134 -0
- package/packages/core/build/source-admission.js +35 -0
- package/packages/core/build/stage-capsule/actions.js +53 -0
- package/packages/core/build/stage-capsule/campaign/aggregate.js +51 -0
- package/packages/core/build/stage-capsule/campaign/context.js +51 -0
- package/packages/core/build/stage-capsule/campaign/resume.js +240 -0
- package/packages/core/build/stage-capsule/campaign/run.js +47 -0
- package/packages/core/build/stage-capsule/campaign/seed.js +124 -0
- package/packages/core/build/stage-capsule/campaign/worker.js +17 -0
- package/packages/core/build/stage-capsule/canary.js +62 -0
- package/packages/core/build/stage-capsule/rehearsal/checkpoint.js +110 -0
- package/packages/core/build/stage-capsule/rehearsal/files.js +36 -0
- package/packages/core/build/stage-capsule/rehearsal/macos-tail.js +104 -0
- package/packages/core/build/stage-capsule/rehearsal/resume.js +38 -0
- package/packages/core/build/stage-capsule/rehearsal/run.js +46 -0
- package/packages/core/build/stage-capsule/rehearsal/verify.js +56 -0
- package/packages/core/build/stage-capsule/rehearsal/worker.js +11 -0
- package/packages/core/build/stage-capsule-local-store.js +428 -0
- package/packages/core/build/stage-capsule-qualification-campaign.js +511 -0
- package/packages/core/build/stage-capsule-qualification.js +455 -0
- package/packages/core/build/stage-capsule-resume-planner.js +397 -0
- package/packages/core/build/stage-capsule-store.js +404 -0
- package/packages/core/build/stage-capsule.js +319 -0
- package/packages/core/build/standalone/build.js +266 -0
- package/packages/core/build/standalone/bundle.js +69 -0
- package/packages/core/build/standalone/identity.js +47 -0
- package/packages/core/build/standalone/logging.js +72 -0
- package/packages/core/build/standalone/process.js +50 -0
- package/packages/core/build/summary/action.js +33 -0
- package/packages/core/build/summary/aggregation.js +120 -0
- package/packages/core/build/summary/artifacts.js +165 -0
- package/packages/core/build/summary/controller-receipt.js +50 -0
- package/packages/core/build/summary/execution.js +39 -0
- package/packages/core/build/summary/finalization.js +133 -0
- package/packages/core/build/summary/payloads.js +80 -0
- package/packages/core/build/validate-config/action.js +58 -0
- package/packages/core/build/validate-config/lib.js +42 -0
- package/packages/core/build/verification/actions.js +54 -0
- package/packages/core/build/verification/discovery.js +115 -0
- package/packages/core/build/verification/identity.js +123 -0
- package/packages/core/build/verification/proof.js +8 -0
- package/packages/core/build/verification/repository.js +4 -0
- package/packages/core/build/verification/runner.js +69 -0
- package/packages/core/build/verification/source.js +169 -0
- package/packages/core/consumer/buildchain-config.js +1825 -0
- package/packages/core/consumer/channel-selection.js +211 -0
- package/packages/core/consumer/cli/infrastructure.mjs +6 -0
- package/packages/core/consumer/commands/buildchain-channel-router.mjs +81 -0
- package/packages/core/consumer/commands/consumer-policy.mjs +229 -0
- package/packages/core/consumer/floating-consumer-evidence.js +341 -0
- package/packages/core/consumer/floating-consumer-policy.js +596 -0
- package/packages/core/consumer/invocation-selector.js +4 -0
- package/packages/core/consumer/policy-admission.js +103 -0
- package/packages/core/consumer/policy-scan.js +33 -0
- package/packages/core/consumer/runtime-selector-persistence.js +291 -0
- package/packages/core/consumer/workflow-definition-authority.js +64 -0
- package/packages/core/contracts/action-inventory.js +78 -0
- package/packages/core/contracts/action-taxonomy.js +46 -0
- package/packages/core/contracts/buildchain-contract.js +1038 -0
- package/packages/core/contracts/canonical-contracts.js +239 -0
- package/packages/core/contracts/cli/context.mjs +28 -0
- package/packages/core/contracts/cli/introspection.mjs +47 -0
- package/packages/core/contracts/cli/options.mjs +85 -0
- package/packages/core/contracts/cli-reference.js +192 -0
- package/packages/core/contracts/commands/buildchain-contract-lock.mjs +120 -0
- package/packages/core/contracts/commands/workflow-call-contract.mjs +133 -0
- package/packages/core/contracts/public-surface-audit.js +274 -0
- package/packages/core/contracts/public-surface-cli.js +134 -0
- package/packages/core/contracts/runtime-contract-action.js +48 -0
- package/packages/core/contracts/runtime-contract-inspection.js +115 -0
- package/packages/core/contracts/structured-values.js +29 -0
- package/packages/core/contracts/workflow-yaml-contract.js +373 -0
- package/packages/core/dev-delivery/admission/gh-cli-client.js +110 -0
- package/packages/core/dev-delivery/admission/github-client.js +274 -0
- package/packages/core/dev-delivery/admission/policy.js +177 -0
- package/packages/core/dev-delivery/admission/queue.js +554 -0
- package/packages/core/dev-delivery/admission/readiness.js +222 -0
- package/packages/core/dev-delivery/admission/report.js +27 -0
- package/packages/core/dev-delivery/admission/request.js +34 -0
- package/packages/core/dev-delivery/admission/targeted.js +375 -0
- package/packages/core/dev-delivery/admission/transaction.js +47 -0
- package/packages/core/dev-delivery/buildchain-delivery-bootstrap.js +240 -0
- package/packages/core/dev-delivery/buildchain-delivery-infrastructure.js +164 -0
- package/packages/core/dev-delivery/buildchain-delivery-self-dogfood.js +395 -0
- package/packages/core/dev-delivery/candidate/admission-actions.js +34 -0
- package/packages/core/dev-delivery/candidate/admission.js +172 -0
- package/packages/core/dev-delivery/candidate/coordinates.js +46 -0
- package/packages/core/dev-delivery/candidate/evidence.js +20 -0
- package/packages/core/dev-delivery/candidate/request.js +39 -0
- package/packages/core/dev-delivery/candidate/reservation-action.js +21 -0
- package/packages/core/dev-delivery/candidate/reservation.js +98 -0
- package/packages/core/dev-delivery/candidate/source-paths.js +102 -0
- package/packages/core/dev-delivery/candidate/submission.js +41 -0
- package/packages/core/dev-delivery/cli/dispatch.mjs +54 -0
- package/packages/core/dev-delivery/commands/dev-delivery-authority-command-adapters.mjs +193 -0
- package/packages/core/dev-delivery/commands/dev-delivery-authority-provider.mjs +28 -0
- package/packages/core/dev-delivery/commands/dev-delivery-authority.mjs +454 -0
- package/packages/core/dev-delivery/commands/dev-delivery-process-boundary.mjs +93 -0
- package/packages/core/dev-delivery/commands/dev-delivery-proof.mjs +258 -0
- package/packages/core/dev-delivery/commands/dev-delivery-provider-heartbeat.mjs +76 -0
- package/packages/core/dev-delivery/commands/dev-delivery-request.sh +160 -0
- package/packages/core/dev-delivery/commands/dev-delivery-source-proof-reuse.mjs +128 -0
- package/packages/core/dev-delivery/commands/dev-delivery-two-phase.mjs +180 -0
- package/packages/core/dev-delivery/commands/dev-delivery-warrant-options.mjs +283 -0
- package/packages/core/dev-delivery/commands/dev-delivery-warrant.mjs +65 -0
- package/packages/core/dev-delivery/commands/dev-merge-queue.mjs +98 -0
- package/packages/core/dev-delivery/commands/dev-pr-auto-merge.mjs +111 -0
- package/packages/core/dev-delivery/commands/dev-pr-delivery-warrant.mjs +467 -0
- package/packages/core/dev-delivery/commands/dev-pr-prequeue-guard.mjs +381 -0
- package/packages/core/dev-delivery/commands/dev-qualification-patrol.mjs +21 -0
- package/packages/core/dev-delivery/delivery-warrant-fixture-runner.js +375 -0
- package/packages/core/dev-delivery/delivery-warrant-read-candidate.js +281 -0
- package/packages/core/dev-delivery/delivery-warrant-semantic-diff-gate.js +351 -0
- package/packages/core/dev-delivery/delivery-warrant-shadow-adapter.js +444 -0
- package/packages/core/dev-delivery/dev-delivery-authority-candidate.js +197 -0
- package/packages/core/dev-delivery/dev-delivery-authority-landing.js +459 -0
- package/packages/core/dev-delivery/dev-delivery-authority-state.js +424 -0
- package/packages/core/dev-delivery/dev-delivery-candidate-identity.js +152 -0
- package/packages/core/dev-delivery/dev-delivery-contract-surface.js +74 -0
- package/packages/core/dev-delivery/dev-delivery-native-proof.js +509 -0
- package/packages/core/dev-delivery/dev-delivery-proof.js +282 -0
- package/packages/core/dev-delivery/dev-delivery-warrant-native-requirements.js +7 -0
- package/packages/core/dev-delivery/dev-delivery-warrant-state.js +580 -0
- package/packages/core/dev-delivery/dev-delivery-warrant.js +588 -0
- package/packages/core/dev-delivery/merge-queue-policy.js +543 -0
- package/packages/core/dev-delivery/native/action-context.js +59 -0
- package/packages/core/dev-delivery/native/actions.js +74 -0
- package/packages/core/dev-delivery/native/attempt.js +93 -0
- package/packages/core/dev-delivery/native/candidate.js +101 -0
- package/packages/core/dev-delivery/native/context-record.js +26 -0
- package/packages/core/dev-delivery/native/execution.js +176 -0
- package/packages/core/dev-delivery/native/failure.js +105 -0
- package/packages/core/dev-delivery/native/files.js +11 -0
- package/packages/core/dev-delivery/native/finalizer-admission.js +93 -0
- package/packages/core/dev-delivery/native/heartbeat-action.js +29 -0
- package/packages/core/dev-delivery/native/heartbeat.js +137 -0
- package/packages/core/dev-delivery/native/provider-boundary.js +71 -0
- package/packages/core/dev-delivery/native/qualification.js +228 -0
- package/packages/core/dev-delivery/native/readback.js +32 -0
- package/packages/core/dev-delivery/native/reuse.js +60 -0
- package/packages/core/dev-delivery/native/seal-action.js +19 -0
- package/packages/core/dev-delivery/native/transactions.js +156 -0
- package/packages/core/dev-delivery/native/transfer.js +122 -0
- package/packages/core/dev-delivery/published-delivery-authority.js +266 -0
- package/packages/core/dev-delivery/qualification/action.js +60 -0
- package/packages/core/dev-delivery/qualification/controller.js +218 -0
- package/packages/core/dev-delivery/qualification/github-client.js +108 -0
- package/packages/core/dev-delivery/qualification/model.js +186 -0
- package/packages/core/dev-delivery/qualification/report.js +25 -0
- package/packages/core/dev-delivery/queue/completion.js +52 -0
- package/packages/core/dev-delivery/queue/landing-action.js +60 -0
- package/packages/core/dev-delivery/queue/reconciliation-action.js +45 -0
- package/packages/core/dev-delivery/source-proof/evidence.js +92 -0
- package/packages/core/dev-delivery/source-proof/io.js +97 -0
- package/packages/core/dev-delivery/source-proof/predicates.js +88 -0
- package/packages/core/dev-delivery/source-proof/replay.js +143 -0
- package/packages/core/dev-delivery/source-proof/reuse.js +116 -0
- package/packages/core/dev-delivery/source-proof/seal.js +32 -0
- package/packages/core/dev-delivery/warrant/actions.js +78 -0
- package/packages/core/dev-delivery/warrant/cancellation.js +49 -0
- package/packages/core/dev-delivery/warrant/failure-settlement.js +93 -0
- package/packages/core/dev-delivery/warrant/handoff.js +107 -0
- package/packages/core/dev-delivery/warrant/observation.js +59 -0
- package/packages/core/dev-delivery/warrant/persistence.js +109 -0
- package/packages/core/dev-delivery/warrant/reservation-readback.js +72 -0
- package/packages/core/dev-delivery/warrant/service.js +134 -0
- package/packages/core/dev-delivery/warrant/terminal-policy.js +53 -0
- package/packages/core/dev-delivery/warrant/terminal.js +89 -0
- package/packages/core/dev-delivery/warrant/transitions.js +222 -0
- package/packages/core/dev-delivery/warrant/values.js +102 -0
- package/packages/core/governance/alpha-candidate/action.js +96 -0
- package/packages/core/governance/alpha-candidate/controller.js +490 -0
- package/packages/core/governance/alpha-candidate/lifecycle.js +121 -0
- package/packages/core/governance/alpha-candidate/options.js +60 -0
- package/packages/core/governance/alpha-candidate/outputs.js +23 -0
- package/packages/core/governance/alpha-candidate/provider.js +192 -0
- package/packages/core/governance/alpha-candidate/report.js +56 -0
- package/packages/core/governance/alpha-candidate/state.js +184 -0
- package/packages/core/governance/alpha-candidate/values.js +90 -0
- package/packages/core/governance/architecture-graph.js +24 -0
- package/packages/core/governance/audit/actions.js +57 -0
- package/packages/core/governance/audit/collection.js +259 -0
- package/packages/core/governance/audit/github-reader.js +204 -0
- package/packages/core/governance/audit/identity.js +86 -0
- package/packages/core/governance/audit/incident.mjs +39 -0
- package/packages/core/governance/audit/transactions.js +75 -0
- package/packages/core/governance/buildchain-compatibility-authority.js +335 -0
- package/packages/core/governance/buildchain-compatibility-fact.js +386 -0
- package/packages/core/governance/buildchain-compatibility-facts.json +18 -0
- package/packages/core/governance/buildchain-compatibility-proof.js +523 -0
- package/packages/core/governance/buildchain-publication-authority.js +117 -0
- package/packages/core/governance/candidate/body-action.js +18 -0
- package/packages/core/governance/candidate/body-renderer.js +160 -0
- package/packages/core/governance/ci-lane-change-budget.js +260 -0
- package/packages/core/governance/cli/compatibility-facts.mjs +101 -0
- package/packages/core/governance/cli/dispatch.mjs +19 -0
- package/packages/core/governance/cli/doctor.mjs +144 -0
- package/packages/core/governance/commands/architecture.mjs +594 -0
- package/packages/core/governance/commands/audit-github-governance.mjs +43 -0
- package/packages/core/governance/commands/audit-publication-control-plane.mjs +26 -0
- package/packages/core/governance/commands/buildchain-patrol.mjs +32 -0
- package/packages/core/governance/commands/create-github-artifact-attestation-policy.mjs +62 -0
- package/packages/core/governance/commands/engineering-housekeeper-workflow.mjs +23 -0
- package/packages/core/governance/commands/reconcile-github-governance.mjs +689 -0
- package/packages/core/governance/commands/reconcile-release-governance.mjs +77 -0
- package/packages/core/governance/commands/workflow-friction-report.mjs +375 -0
- package/packages/core/governance/github-governance-authority.js +1367 -0
- package/packages/core/governance/housekeeping/action.js +45 -0
- package/packages/core/governance/housekeeping/execution.js +75 -0
- package/packages/core/governance/housekeeping/options.js +103 -0
- package/packages/core/governance/housekeeping/report.js +53 -0
- package/packages/core/governance/housekeeping/transactions.js +96 -0
- package/packages/core/governance/patrol/action.js +41 -0
- package/packages/core/governance/patrol/controller.js +125 -0
- package/packages/core/governance/patrol/options.js +121 -0
- package/packages/core/governance/patrol/report.js +53 -0
- package/packages/core/governance/patrol/transaction.js +30 -0
- package/packages/core/governance/publication/audit.js +26 -0
- package/packages/core/governance/publication/collection.js +396 -0
- package/packages/core/governance/publication/policy-values.js +227 -0
- package/packages/core/governance/publication/source-authorization.js +293 -0
- package/packages/core/governance/receipt-admission-action.js +12 -0
- package/packages/core/governance/receipt-admission.js +34 -0
- package/packages/core/governance/release-check-policy.js +179 -0
- package/packages/core/governance/release-reconciliation-action.js +25 -0
- package/packages/core/governance/release-reconciliation.js +122 -0
- package/packages/core/governance/report-issue/action.js +201 -0
- package/packages/core/index.js +85 -117
- package/packages/core/observability/cli/candidate.mjs +42 -0
- package/packages/core/observability/cli/context.mjs +47 -0
- package/packages/core/observability/cli/diagnostics.mjs +88 -0
- package/packages/core/observability/cli/events.mjs +126 -0
- package/packages/core/observability/cli/process-sample.mjs +71 -0
- package/packages/core/observability/commands/aggregate-diagnostics-summary.mjs +45 -0
- package/packages/core/observability/commands/controller-evidence.mjs +109 -0
- package/packages/core/observability/commands/observed-evidence.mjs +27 -0
- package/packages/core/observability/controller/identity-action.js +11 -0
- package/packages/core/observability/controller/identity.js +32 -0
- package/packages/core/observability/controller-actions.js +63 -0
- package/packages/core/observability/controller-evidence-io.js +112 -0
- package/packages/core/observability/controller-evidence.js +555 -0
- package/packages/core/observability/controller-input-boundary.js +47 -0
- package/packages/core/observability/diagnostics/aggregate.js +25 -0
- package/packages/core/observability/diagnostics.js +1904 -0
- package/packages/core/observability/evidence/actions.js +20 -0
- package/packages/core/observability/evidence/bundle.js +163 -0
- package/packages/core/observability/evidence/publication.js +360 -0
- package/packages/core/observability/evidence/transactions.js +62 -0
- package/packages/core/observability/process/sampling.js +128 -0
- package/packages/core/observability/publisher-admission.js +26 -0
- package/packages/core/observability/transaction-journal.js +40 -0
- package/packages/core/paper/cli/dispatch.mjs +17 -0
- package/packages/core/paper/commands/paper-agent-cli.mjs +35 -0
- package/packages/core/paper/commands/paper-work-fleet-cli.mjs +577 -0
- package/packages/core/paper/commands/paper.mjs +632 -0
- package/packages/core/paper/operations/bootstrap.js +73 -0
- package/packages/core/paper/operations/files.js +48 -0
- package/packages/core/paper/operations/github-observation.js +136 -0
- package/packages/core/paper/operations/identity.js +59 -0
- package/packages/core/paper/operations/npm-observation.js +118 -0
- package/packages/core/paper/operations/plans.js +213 -0
- package/packages/core/paper/operations/preflight-checks.js +269 -0
- package/packages/core/paper/operations/provisioning-validation.js +155 -0
- package/packages/core/paper/operations/provisioning.js +113 -0
- package/packages/core/paper/operations/runtime-observation.js +25 -0
- package/packages/core/paper/operations/runtime.js +84 -0
- package/packages/core/paper/operations/scaffold-config.js +77 -0
- package/packages/core/paper/operations/scaffold-workflows.js +99 -0
- package/packages/core/paper/operations/scaffold.js +370 -0
- package/packages/core/paper/operations/status-facts.js +264 -0
- package/packages/core/paper/operations/status.js +353 -0
- package/packages/core/paper/operations/toolchain-observation.js +49 -0
- package/packages/core/paper/operations/workspace.js +60 -0
- package/packages/core/paper/paper-agent-entry.js +396 -0
- package/packages/core/paper/paper-fleet.js +310 -0
- package/packages/core/paper/paper-npm-bootstrap.js +492 -0
- package/packages/core/paper/paper-repository.js +214 -0
- package/packages/core/paper/paper-runtime-channels.js +344 -0
- package/packages/core/paper/paper-scaffold-content.js +574 -0
- package/packages/core/paper/paper.js +308 -0
- package/packages/core/paper/publication/actions.js +109 -0
- package/packages/core/paper/publication/candidate.js +140 -0
- package/packages/core/paper/publication/controller.js +117 -0
- package/packages/core/paper/publication/envelope.js +118 -0
- package/packages/core/paper/publication/propagation.js +135 -0
- package/packages/core/paper/publication/readback.js +89 -0
- package/packages/core/paper/publication/target.js +54 -0
- package/packages/core/paper/publication-controller.js +144 -0
- package/packages/core/providers/artifact-relay/files.js +71 -0
- package/packages/core/providers/artifact-relay/s3-client.js +259 -0
- package/packages/core/providers/artifact-relay/transactions.js +258 -0
- package/packages/core/providers/commands/artifact-relay-s3.mjs +62 -0
- package/packages/core/providers/commands/aws-codebuild-toolchain.mjs +15 -0
- package/packages/core/providers/commands/aws-macos-jit-controller-runtime.mjs +82 -0
- package/packages/core/providers/commands/aws-runner-burst-core.mjs +249 -0
- package/packages/core/providers/commands/aws-runner-burst.mjs +80 -0
- package/packages/core/providers/commands/aws-windows-jit-campaign.mjs +202 -0
- package/packages/core/providers/commands/aws-windows-jit-controller.mjs +578 -0
- package/packages/core/providers/commands/aws-windows-jit-operator.sh +506 -0
- package/packages/core/providers/commands/infra-contract-core.mjs +1032 -0
- package/packages/core/providers/commands/infra-contract.mjs +345 -0
- package/packages/core/providers/commands/locked-source-checkout.mjs +9 -0
- package/packages/core/providers/commands/route-offline-runners.mjs +30 -0
- package/packages/core/providers/demo/capture-worker.py +541 -0
- package/packages/core/providers/dev-delivery/candidate.js +112 -0
- package/packages/core/providers/dev-delivery/protection.js +29 -0
- package/packages/core/providers/dev-delivery/store.js +292 -0
- package/packages/core/providers/git/fetch-process.js +27 -0
- package/packages/core/providers/git/fetch-worker.js +146 -0
- package/packages/core/providers/git/patch-root.js +54 -0
- package/packages/core/providers/git-ref-readback.mjs +22 -0
- package/packages/core/providers/github/artifact-attestation.js +32 -0
- package/packages/core/providers/github/commits.js +32 -0
- package/packages/core/providers/github/json-client.js +65 -0
- package/packages/core/providers/github/product-publication.js +44 -0
- package/packages/core/providers/github/publication-control-plane.js +116 -0
- package/packages/core/providers/github/pull-requests.js +24 -0
- package/packages/core/providers/github/qualification.js +181 -0
- package/packages/core/providers/github/release-assets.js +91 -0
- package/packages/core/providers/github/signing-request.js +81 -0
- package/packages/core/providers/github/source-lock.js +98 -0
- package/packages/core/providers/github-cli-api.js +35 -0
- package/packages/core/providers/github-issue-comment.js +83 -0
- package/packages/core/providers/github-permission.js +11 -0
- package/packages/core/providers/github-token.js +121 -0
- package/packages/core/providers/process/sample-worker.mjs +14 -0
- package/packages/core/providers/runner/observation.js +30 -0
- package/packages/core/providers/runner/offline-routing.js +205 -0
- package/packages/core/providers/signing/detached-key.js +20 -0
- package/packages/core/providers/signing/macos/compound-archive.py +434 -0
- package/packages/core/providers/signing/macos/sign-request.sh +145 -0
- package/packages/core/providers/signing/native.js +77 -0
- package/packages/core/providers/signing/windows/sign-request.ps1 +48 -0
- package/packages/core/providers/source-checkout/action.js +31 -0
- package/packages/core/providers/source-checkout/auth.js +32 -0
- package/packages/core/providers/source-checkout/fetch.js +135 -0
- package/packages/core/providers/source-checkout/git.js +220 -0
- package/packages/core/providers/source-checkout/transaction.js +360 -0
- package/packages/core/providers/source-checkout/values.js +115 -0
- package/packages/core/providers/source-checkout/workspace.js +50 -0
- package/packages/core/providers/sync-git/action.mjs +16 -0
- package/packages/core/providers/sync-git/transfer.mjs +86 -0
- package/packages/core/providers/toolchain/codebuild-policy.js +36 -0
- package/packages/core/providers/toolchain/codebuild.js +220 -0
- package/packages/core/publication/authority/actions.js +156 -0
- package/packages/core/publication/authority/admission.js +113 -0
- package/packages/core/publication/authority/assembly.js +77 -0
- package/packages/core/publication/authority/binary-evidence.js +77 -0
- package/packages/core/publication/authority/candidate-evidence.js +42 -0
- package/packages/core/publication/authority/consumer-gate.js +80 -0
- package/packages/core/publication/authority/control-plane.js +38 -0
- package/packages/core/publication/authority/evidence.js +113 -0
- package/packages/core/publication/authority/gate.js +39 -0
- package/packages/core/publication/authority/governance.js +61 -0
- package/packages/core/publication/authority/paper-evidence.js +24 -0
- package/packages/core/publication/authority/request.js +13 -0
- package/packages/core/publication/authority/result.js +37 -0
- package/packages/core/publication/authority/runner.js +26 -0
- package/packages/core/publication/authority/seal.js +97 -0
- package/packages/core/publication/authority/verification-evidence.js +80 -0
- package/packages/core/publication/authority/verification.js +94 -0
- package/packages/core/publication/binary/action.js +33 -0
- package/packages/core/publication/binary/capability.js +55 -0
- package/packages/core/publication/binary/evidence.js +109 -0
- package/packages/core/publication/binary/transaction.js +38 -0
- package/packages/core/publication/candidate/artifact.js +71 -0
- package/packages/core/publication/candidate/collection-action.js +24 -0
- package/packages/core/publication/candidate/collection.js +70 -0
- package/packages/core/publication/candidate/kind.js +93 -0
- package/packages/core/publication/candidate/manifest.js +35 -0
- package/packages/core/publication/candidate/package-binding.js +42 -0
- package/packages/core/publication/candidate/package.js +50 -0
- package/packages/core/publication/candidate/paper-package.js +120 -0
- package/packages/core/publication/candidate/passport.js +36 -0
- package/packages/core/publication/candidate/qualification-action.js +41 -0
- package/packages/core/publication/candidate/qualification.js +56 -0
- package/packages/core/publication/candidate/registry-hydration.js +204 -0
- package/packages/core/publication/candidate/reproducibility.js +29 -0
- package/packages/core/publication/candidate/sealing.js +184 -0
- package/packages/core/publication/candidate/stage-capsules.js +205 -0
- package/packages/core/publication/candidate/toolchain.js +80 -0
- package/packages/core/publication/cli/dispatch.mjs +107 -0
- package/packages/core/publication/commands/create-release-bundle.mjs +32 -0
- package/packages/core/publication/commands/generate-release-candidate-passport.mjs +80 -0
- package/packages/core/publication/commands/installer-publication.mjs +45 -0
- package/packages/core/publication/commands/npm-publish-dry-run.mjs +48 -0
- package/packages/core/publication/commands/npm-publish-transaction.mjs +55 -0
- package/packages/core/publication/commands/publication-artifact-candidate.mjs +48 -0
- package/packages/core/publication/commands/publication-artifact.mjs +67 -0
- package/packages/core/publication/commands/publication-package.mjs +38 -0
- package/packages/core/publication/commands/publication-registry-hydrate.mjs +19 -0
- package/packages/core/publication/commands/publication-reproducibility.mjs +62 -0
- package/packages/core/publication/installer/evidence.js +319 -0
- package/packages/core/publication/npm/environment.js +18 -0
- package/packages/core/publication/npm/evidence.js +57 -0
- package/packages/core/publication/npm/pack-preview.js +22 -0
- package/packages/core/publication/npm/package-plan.js +82 -0
- package/packages/core/publication/npm/package.js +120 -0
- package/packages/core/publication/npm/preview-action.js +30 -0
- package/packages/core/publication/npm/preview.js +92 -0
- package/packages/core/publication/npm/registry.js +61 -0
- package/packages/core/publication/npm/transaction.js +115 -0
- package/packages/core/publication/oci/preview-actions.js +48 -0
- package/packages/core/publication/oci/preview-admission.js +93 -0
- package/packages/core/publication/oci/preview-promotion.js +64 -0
- package/packages/core/publication/oci/preview-registry.js +36 -0
- package/packages/core/publication/oci/preview-transaction.js +42 -0
- package/packages/core/publication/oci/preview-values.js +8 -0
- package/packages/core/publication/oci-compose-qualification.js +143 -0
- package/packages/core/publication/oci-publication-bundle.js +281 -0
- package/packages/core/publication/publication-artifact-candidate.js +128 -0
- package/packages/core/publication/publication-artifact.js +641 -0
- package/packages/core/publication/publication-authority.js +1163 -0
- package/packages/core/publication/publication-development.js +72 -0
- package/packages/core/publication/publication-package.js +252 -0
- package/packages/core/publication/publication-rehearsal-capsule.js +468 -0
- package/packages/core/publication/publication-rehearsal-projection.js +104 -0
- package/packages/core/publication/publication-rehearsal-runtime.js +190 -0
- package/packages/core/publication/publication-rehearsal.js +481 -0
- package/packages/core/publication/publication-reproducibility.js +947 -0
- package/packages/core/publication/settlement/actions.js +63 -0
- package/packages/core/publication/settlement/transaction.js +197 -0
- package/packages/core/release/binary/coordinates-action.js +25 -0
- package/packages/core/release/binary/coordinates.js +76 -0
- package/packages/core/release/candidate/download.js +64 -0
- package/packages/core/release/candidate/lineage.js +72 -0
- package/packages/core/release/candidate/materialize.js +155 -0
- package/packages/core/release/candidate/payloads.js +330 -0
- package/packages/core/release/candidate/publication-intent.js +89 -0
- package/packages/core/release/candidate/resolve.js +132 -0
- package/packages/core/release/candidate/run-selection.js +88 -0
- package/packages/core/release/candidate/selection.js +181 -0
- package/packages/core/release/candidate/transport.js +143 -0
- package/packages/core/release/cli/command-handlers.mjs +14 -0
- package/packages/core/release/cli/dispatch.mjs +39 -0
- package/packages/core/release/cli/inspection-handlers.mjs +178 -0
- package/packages/core/release/cli/release-handlers.mjs +332 -0
- package/packages/core/release/cli/trust-release.mjs +19 -0
- package/packages/core/release/cli/verification-handlers.mjs +303 -0
- package/packages/core/release/commands/dev-alpha-candidate-patrol.mjs +42 -0
- package/packages/core/release/commands/ensure-github-release.mjs +199 -0
- package/packages/core/release/commands/next-development-review.mjs +77 -0
- package/packages/core/release/commands/next-development-transition.mjs +47 -0
- package/packages/core/release/commands/promotion-channel-router.mjs +62 -0
- package/packages/core/release/commands/promotion-identity-resolver.mjs +77 -0
- package/packages/core/release/commands/publish-source-ref-resolver.mjs +113 -0
- package/packages/core/release/commands/release-candidate-resolver.mjs +122 -0
- package/packages/core/release/commands/release-line-dry-run.mjs +53 -0
- package/packages/core/release/commands/release-propagation.mjs +411 -0
- package/packages/core/release/commands/release-tail.mjs +169 -0
- package/packages/core/release/commands/release-transaction.mjs +212 -0
- package/packages/core/release/commands/resolve-publish-gate.mjs +34 -0
- package/packages/core/release/commands/resolve-publish-source.mjs +96 -0
- package/packages/core/release/commands/resume-from-candidate-run.mjs +107 -0
- package/packages/core/release/commands/stable-candidate-patrol.mjs +31 -0
- package/packages/core/release/commands/stable-candidate-qualification.mjs +24 -0
- package/packages/core/release/commands/stable-release-gate.mjs +351 -0
- package/packages/core/release/commands/tail-reseal.mjs +148 -0
- package/packages/core/release/commands/verify-promotion-router-binding.sh +36 -0
- package/packages/core/release/commands/verify-publish-channel-ref.mjs +83 -0
- package/packages/core/release/commands/verify-publish-source-lock.mjs +37 -0
- package/packages/core/release/commands/verify-release-pr.mjs +6 -0
- package/packages/core/release/commands/verify-version-state-delta.mjs +21 -0
- package/packages/core/release/github-provider-plane.js +319 -0
- package/packages/core/release/github-release.js +385 -0
- package/packages/core/release/line/action.js +49 -0
- package/packages/core/release/line/governance.js +96 -0
- package/packages/core/release/line/plan.js +56 -0
- package/packages/core/release/line/policy.js +320 -0
- package/packages/core/release/line/protection.js +35 -0
- package/packages/core/release/line/request.js +22 -0
- package/packages/core/release/line/source.js +79 -0
- package/packages/core/release/line/transaction.js +33 -0
- package/packages/core/release/line/verification-action.js +13 -0
- package/packages/core/release/line/verification.js +13 -0
- package/packages/core/release/next-development/actions.js +122 -0
- package/packages/core/release/next-development/approval.js +59 -0
- package/packages/core/release/next-development/enqueue.js +51 -0
- package/packages/core/release/next-development/finalization.js +127 -0
- package/packages/core/release/next-development/observation.js +41 -0
- package/packages/core/release/next-development/review-policy.js +56 -0
- package/packages/core/release/next-development/verification.js +89 -0
- package/packages/core/release/next-development-projection.js +310 -0
- package/packages/core/release/next-development-transition.js +737 -0
- package/packages/core/release/partial-mutation-recovery-qualification.js +18 -0
- package/packages/core/release/passport/artifact-index.js +65 -0
- package/packages/core/release/passport/assembly-artifacts.js +43 -0
- package/packages/core/release/passport/assembly-inputs.js +107 -0
- package/packages/core/release/passport/assembly-material.js +261 -0
- package/packages/core/release/passport/assembly-render.js +320 -0
- package/packages/core/release/passport/assembly.js +12 -0
- package/packages/core/release/passport/assets.js +46 -0
- package/packages/core/release/passport/attachments.js +88 -0
- package/packages/core/release/passport/authoritative-base.js +123 -0
- package/packages/core/release/passport/build.js +39 -0
- package/packages/core/release/passport/collection-inputs.js +383 -0
- package/packages/core/release/passport/collection-material.js +199 -0
- package/packages/core/release/passport/collection-options.js +97 -0
- package/packages/core/release/passport/collection-output.js +303 -0
- package/packages/core/release/passport/collection.js +10 -0
- package/packages/core/release/passport/commands.js +44 -0
- package/packages/core/release/passport/consumer-input.js +18 -0
- package/packages/core/release/passport/consumer-validation.js +83 -0
- package/packages/core/release/passport/discovery.js +36 -0
- package/packages/core/release/passport/documents.js +116 -0
- package/packages/core/release/passport/evidence-validation.js +280 -0
- package/packages/core/release/passport/files.js +43 -0
- package/packages/core/release/passport/fixture.js +19 -0
- package/packages/core/release/passport/identity.js +46 -0
- package/packages/core/release/passport/impact-validation.js +230 -0
- package/packages/core/release/passport/impact.js +149 -0
- package/packages/core/release/passport/inputs.js +55 -0
- package/packages/core/release/passport/invariants.js +93 -0
- package/packages/core/release/passport/issues.js +29 -0
- package/packages/core/release/passport/json.js +16 -0
- package/packages/core/release/passport/locations.js +82 -0
- package/packages/core/release/passport/packages.js +123 -0
- package/packages/core/release/passport/publish-validation.js +279 -0
- package/packages/core/release/passport/publish.js +58 -0
- package/packages/core/release/passport/report.js +154 -0
- package/packages/core/release/passport/state-validation.js +163 -0
- package/packages/core/release/passport/transaction.js +69 -0
- package/packages/core/release/passport/trust-claims.js +365 -0
- package/packages/core/release/passport/trust-validation.js +528 -0
- package/packages/core/release/product-publication.js +59 -0
- package/packages/core/release/promote-candidate/action.js +9 -0
- package/packages/core/release/promote-candidate/development-source.js +39 -0
- package/packages/core/release/promote-candidate/evidence-binding.js +142 -0
- package/packages/core/release/promote-candidate/evidence-inputs.js +99 -0
- package/packages/core/release/promote-candidate/files.js +10 -0
- package/packages/core/release/promote-candidate/next-development-provider.js +300 -0
- package/packages/core/release/promote-candidate/next-development-queue.js +63 -0
- package/packages/core/release/promote-candidate/oci-provider.js +241 -0
- package/packages/core/release/promote-candidate/oci-registry-client.js +67 -0
- package/packages/core/release/promote-candidate/outputs.js +29 -0
- package/packages/core/release/promote-candidate/product-finalization-wait.js +52 -0
- package/packages/core/release/promote-candidate/product-provider-adapters.js +462 -0
- package/packages/core/release/promote-candidate/product-provider-github-adapters.js +595 -0
- package/packages/core/release/promote-candidate/product-provider.js +188 -0
- package/packages/core/release/promote-candidate/provider-request.js +51 -0
- package/packages/core/release/promote-candidate/provider-settlement.js +83 -0
- package/packages/core/release/promote-candidate/publication-completion.js +56 -0
- package/packages/core/release/promote-candidate/release-documents.js +156 -0
- package/packages/core/release/promote-candidate/transaction.js +130 -0
- package/packages/core/release/promote-ref/action-environment.js +2 -0
- package/packages/core/release/promote-ref/action-inputs.js +285 -0
- package/packages/core/release/promote-ref/action-outputs.js +140 -0
- package/packages/core/release/promote-ref/action-request.js +205 -0
- package/packages/core/release/promote-ref/action.js +92 -0
- package/packages/core/release/promote-ref/internal/branch-protection.js +218 -0
- package/packages/core/release/promote-ref/internal/candidate-admission.js +149 -0
- package/packages/core/release/promote-ref/internal/channel-governance.js +297 -0
- package/packages/core/release/promote-ref/internal/channel-resume.js +198 -0
- package/packages/core/release/promote-ref/internal/channel-tags.js +207 -0
- package/packages/core/release/promote-ref/internal/contained-published-version-state.js +80 -0
- package/packages/core/release/promote-ref/internal/durable-transaction-operations.js +463 -0
- package/packages/core/release/promote-ref/internal/durable-transaction-store.js +395 -0
- package/packages/core/release/promote-ref/internal/generated-branch.js +16 -0
- package/packages/core/release/promote-ref/internal/generated-identity.js +12 -0
- package/packages/core/release/promote-ref/internal/generated-ref.js +93 -0
- package/packages/core/release/promote-ref/internal/github-adapter.js +312 -0
- package/packages/core/release/promote-ref/internal/npm-distribution.js +185 -0
- package/packages/core/release/promote-ref/internal/npm-existing-evidence.js +61 -0
- package/packages/core/release/promote-ref/internal/passport-files.js +116 -0
- package/packages/core/release/promote-ref/internal/passport-generation.js +567 -0
- package/packages/core/release/promote-ref/internal/promote-alpha-channel.js +588 -0
- package/packages/core/release/promote-ref/internal/promote-major-channel.js +476 -0
- package/packages/core/release/promote-ref/internal/promote-release-channel.js +573 -0
- package/packages/core/release/promote-ref/internal/promotion-operations.js +1170 -0
- package/packages/core/release/promote-ref/internal/promotion-options.js +101 -0
- package/packages/core/release/promote-ref/internal/promotion-policy.js +218 -0
- package/packages/core/release/promote-ref/internal/publish-command.js +211 -0
- package/packages/core/release/promote-ref/internal/publish-contract.js +181 -0
- package/packages/core/release/promote-ref/internal/publish-transaction.js +510 -0
- package/packages/core/release/promote-ref/internal/tag-selection.js +159 -0
- package/packages/core/release/promote-ref/internal/transaction-context.js +506 -0
- package/packages/core/release/promote-ref/internal/transaction-recovery.js +379 -0
- package/packages/core/release/promote-ref/internal/version-state-operations.js +545 -0
- package/packages/core/release/promote-ref/lib.js +600 -0
- package/packages/core/release/promote-ref/release-tail.js +102 -0
- package/packages/core/release/promote-ref/source-lock.js +91 -0
- package/packages/core/release/promotion/actions.js +133 -0
- package/packages/core/release/promotion/admission.js +52 -0
- package/packages/core/release/promotion/candidate.js +71 -0
- package/packages/core/release/promotion/channel.js +104 -0
- package/packages/core/release/promotion/identities.js +56 -0
- package/packages/core/release/promotion/product-state.js +68 -0
- package/packages/core/release/promotion/publish-gate.js +128 -0
- package/packages/core/release/promotion/qualification-action.js +72 -0
- package/packages/core/release/promotion/qualification.js +95 -0
- package/packages/core/release/promotion/routing.js +94 -0
- package/packages/core/release/promotion/selection.js +55 -0
- package/packages/core/release/promotion/source-intent.js +35 -0
- package/packages/core/release/promotion-request.js +148 -0
- package/packages/core/release/propagation/actions.js +75 -0
- package/packages/core/release/propagation/delivery.js +202 -0
- package/packages/core/release/propagation/planning.js +197 -0
- package/packages/core/release/propagation/report.js +97 -0
- package/packages/core/release/propagation/store.js +26 -0
- package/packages/core/release/propagation/transactions.js +213 -0
- package/packages/core/release/propagation/work.js +146 -0
- package/packages/core/release/protected-publication-source.js +91 -0
- package/packages/core/release/provider-operation-journal.js +62 -0
- package/packages/core/release/provider-readback-idempotency.js +309 -0
- package/packages/core/release/qualification/actions.js +51 -0
- package/packages/core/release/qualification/campaign.js +154 -0
- package/packages/core/release/qualification/options.js +102 -0
- package/packages/core/release/qualification/public-build.js +109 -0
- package/packages/core/release/recovery/artifacts.js +161 -0
- package/packages/core/release/recovery/candidate.js +529 -0
- package/packages/core/release/recovery/capsules.js +102 -0
- package/packages/core/release/recovery/download.js +191 -0
- package/packages/core/release/recovery/files.js +39 -0
- package/packages/core/release/recovery/provenance.js +199 -0
- package/packages/core/release/recovery/publication.js +193 -0
- package/packages/core/release/recovery/readback.js +169 -0
- package/packages/core/release/recovery/runtime.js +224 -0
- package/packages/core/release/recovery/transactions.js +139 -0
- package/packages/core/release/release-activation-shadow.js +32 -0
- package/packages/core/release/release-blocker-priority.js +183 -0
- package/packages/core/release/release-candidate-recovery.js +595 -0
- package/packages/core/release/release-candidate.js +591 -0
- package/packages/core/release/release-invocation.js +64 -0
- package/packages/core/release/release-line-bootstrap.js +292 -0
- package/packages/core/release/release-line-dry-run.js +302 -0
- package/packages/core/release/release-passport-contract.js +479 -0
- package/packages/core/release/release-passport.js +74 -0
- package/packages/core/release/release-tail-provider-adapters.js +460 -0
- package/packages/core/release/release-tail-provider-plane.js +248 -0
- package/packages/core/release/reseal/actions.js +84 -0
- package/packages/core/release/reseal/admission.js +75 -0
- package/packages/core/release/reseal/files.js +39 -0
- package/packages/core/release/reseal/finalize-platform.js +65 -0
- package/packages/core/release/reseal/outputs.js +21 -0
- package/packages/core/release/reseal/plan.js +24 -0
- package/packages/core/release/reseal/platform.js +135 -0
- package/packages/core/release/reseal/readbacks.js +36 -0
- package/packages/core/release/reseal/seal.js +125 -0
- package/packages/core/release/reuse-complete-release.js +240 -0
- package/packages/core/release/runtime-override-authorization.js +242 -0
- package/packages/core/release/settle/action.js +412 -0
- package/packages/core/release/source/channel.js +45 -0
- package/packages/core/release/source/coordinates.js +160 -0
- package/packages/core/release/source/lineage.js +144 -0
- package/packages/core/release/source/manifest.js +114 -0
- package/packages/core/release/stable-patrol/action.js +87 -0
- package/packages/core/release/stable-patrol/controller.js +346 -0
- package/packages/core/release/stable-patrol/coordinates.js +16 -0
- package/packages/core/release/stable-patrol/github-client.js +181 -0
- package/packages/core/release/stable-patrol/options.js +87 -0
- package/packages/core/release/stable-patrol/report.js +28 -0
- package/packages/core/release/stable-publication-fence.js +28 -0
- package/packages/core/release/tail-reseal-github.js +175 -0
- package/packages/core/release/tail-reseal-receipt.js +228 -0
- package/packages/core/release/tail-reseal.js +594 -0
- package/packages/core/release/version-state/verification.js +164 -0
- package/packages/core/release/version-state.js +458 -0
- package/packages/core/runtime/action-host.js +19 -0
- package/packages/core/runtime/action-process.mjs +23 -0
- package/packages/core/runtime/buildchain-domain.wasm +0 -0
- package/packages/core/runtime/checkout-identity.js +27 -0
- package/packages/core/runtime/commands/bridge-bootstrap.mjs +147 -0
- package/packages/core/runtime/commands/host-adapter.mjs +185 -0
- package/packages/core/runtime/commands/runtime-ref-core.mjs +171 -0
- package/packages/core/runtime/consumer-shell.js +174 -0
- package/packages/core/runtime/domain-wasm-artifact.js +7 -0
- package/packages/core/runtime/installation-root.js +29 -0
- package/packages/core/runtime/locked-dependencies.js +74 -0
- package/packages/core/runtime/provider-closure.js +60 -0
- package/packages/core/runtime/runtime-selection-action.js +34 -0
- package/packages/core/runtime/runtime-selection.js +136 -0
- package/packages/core/runtime/toolchain/actions.js +14 -0
- package/packages/core/runtime/toolchain/user-paths.js +9 -0
- package/packages/core/runtime/toolchain/windows-rust.js +67 -0
- package/packages/core/runtime/workflow-runtime.js +11 -0
- package/packages/core/web/apply-admission-action.js +20 -0
- package/packages/core/web/apply-admission.js +44 -0
- package/packages/core/web/cli/badges.mjs +100 -0
- package/packages/core/web/cli/surface.mjs +6 -0
- package/packages/core/web/commands/web-surface-core.mjs +2603 -0
- package/packages/core/web/commands/web-surface-production-release-pr.mjs +126 -0
- package/packages/core/web/commands/web-surface.mjs +294 -0
- package/packages/core/web/controller-actions.js +45 -0
- package/packages/core/web/controller.js +145 -0
- package/packages/core/web/deployment/apply-action.js +31 -0
- package/packages/core/web/deployment/apply-evidence.js +134 -0
- package/packages/core/web/deployment/apply.js +118 -0
- package/packages/core/web/deployment/cloudfront-wait.js +88 -0
- package/packages/core/web/deployment/plan-files.js +41 -0
- package/packages/core/web/deployment/planning-action.js +28 -0
- package/packages/core/web/deployment/planning.js +126 -0
- package/packages/core/web/deployment/report-action.js +74 -0
- package/packages/core/web/deployment/summary.js +44 -0
- package/packages/core/web/preview-feedback-action.js +26 -0
- package/packages/core/web/preview-feedback.js +40 -0
- package/packages/core/web/production-decision-action.js +42 -0
- package/packages/core/web/production-decision.js +85 -0
- package/packages/core/web/production-intent-action.js +14 -0
- package/packages/core/web/production-intent.js +167 -0
- package/packages/core/web/publication-admission-action.js +92 -0
- package/packages/core/web/publication-admission.js +183 -0
- package/packages/core/web/publication-capability-action.js +22 -0
- package/packages/core/web/publication-capability.js +73 -0
- package/packages/core/web/readme-badges.js +891 -0
- package/packages/core/web/release-feedback.js +414 -0
- package/packages/core/web/release-pr-action.js +47 -0
- package/packages/core/web/release-pr-handoff.js +176 -0
- package/packages/core/web/release-pr-provider.js +295 -0
- package/packages/core/web/release-pr-summary.js +42 -0
- package/packages/core/web/release-pr-transaction.js +158 -0
- package/packages/core/web/release-review-action.js +21 -0
- package/packages/core/web/release-review.js +130 -0
- package/packages/core/web/web-surface-publication-candidate.js +162 -0
- package/packages/core/workflow/admission/actions.js +56 -0
- package/packages/core/workflow/admission/recovery.js +47 -0
- package/packages/core/workflow/admission/review.js +188 -0
- package/packages/core/workflow/admission/transactions.js +60 -0
- package/packages/core/workflow/cli/main.mjs +131 -0
- package/packages/core/workflow/cli/process.mjs +16 -0
- package/packages/core/workflow/commands/buildchain-cli-help.mjs +318 -0
- package/packages/core/workflow/commands/universal-workflow-backflow.mjs +26 -0
- package/packages/core/workflow/commands/universal-workflow-engine.mjs +73 -0
- package/packages/core/workflow/dogfood/actions.js +62 -0
- package/packages/core/workflow/dogfood/readiness.js +74 -0
- package/packages/core/workflow/dogfood/transactions.js +90 -0
- package/packages/core/workflow/engine/action.js +42 -0
- package/packages/core/workflow/engine/conformance.js +93 -0
- package/packages/core/workflow/engine/execution.js +77 -0
- package/packages/core/workflow/engine/identity.js +34 -0
- package/packages/core/workflow/engine/provider-context.js +16 -0
- package/packages/core/workflow/engine/release-environment.js +57 -0
- package/packages/core/workflow/engine/release-evidence.js +39 -0
- package/packages/core/workflow/engine/release-observation.js +97 -0
- package/packages/core/workflow/engine/release-promotion.js +227 -0
- package/packages/core/workflow/event-trust.js +25 -0
- package/packages/core/workflow/installation.js +33 -0
- package/packages/core/workflow/request-rejection.js +3 -0
- package/packages/core/workflow/settlement/actions.js +34 -0
- package/packages/core/workflow/settlement/backflow.js +187 -0
- package/packages/core/workflow/universal-self-dogfood.js +163 -0
- package/packages/core/workflow/universal-workflow-bootstrap.js +586 -0
- package/packages/core/workflow/workflow-taxonomy.mjs +351 -0
- package/scripts/bridge-evidence.mjs +9 -2
- package/scripts/build-domain-wasm.mjs +15 -3
- package/scripts/build-standalone-binary.mjs +1 -375
- package/scripts/check-action-bundles.mjs +14 -25
- package/scripts/check-ci-lane-change-budget.mjs +3 -3
- package/scripts/check-code-layout.mjs +386 -0
- package/scripts/check-core-mechanism-inventory.mjs +17 -16
- package/scripts/check-dev-delivery-actions.mjs +35 -0
- package/scripts/check-floating-consumer-policy-contract.mjs +33 -59
- package/scripts/check-implementation-naming.mjs +2 -23
- package/scripts/check-internal-architecture.mjs +3 -3
- package/scripts/check-inventory.mjs +160 -318
- package/scripts/check-javascript-syntax.mjs +1 -1
- package/scripts/check-maintainability.mjs +25 -21
- package/scripts/check-project-cut-merge-queue-admission.mjs +1 -1
- package/scripts/check-public-dogfood-contract.mjs +166 -43
- package/scripts/check-release-tail-contract.mjs +62 -71
- package/scripts/check-release-topology.mjs +101 -77
- package/scripts/check-runtime-semantic-closure.mjs +5 -8
- package/scripts/check-source-bindings.mjs +54 -0
- package/scripts/check-universal-workflow-bootstrap.mjs +136 -124
- package/scripts/check-workflow-taxonomy.mjs +1 -1
- package/scripts/check-workflows.sh +11 -0
- package/scripts/generate-bootstrap-admission.mjs +32 -0
- package/scripts/generate-bootstrap-recovery.mjs +94 -0
- package/scripts/generate-buildchain-kfd-witnesses.mjs +3 -3
- package/scripts/generate-channel-promotion-workflow.mjs +39 -518
- package/scripts/generate-next-development-guidance.mjs +1 -1
- package/scripts/generate-public-reference.mjs +2 -2
- package/scripts/generate-site-bundle.mjs +42 -43
- package/scripts/generate-tail-reseal-fixture.mjs +108 -0
- package/scripts/generate-workflow-taxonomy.mjs +2 -2
- package/scripts/inventory/binary.mjs +36 -0
- package/scripts/inventory/promotion.mjs +72 -0
- package/scripts/maintainability-domain-metrics.mjs +1 -1
- package/scripts/maintainability-metrics.mjs +37 -37
- package/scripts/maintainability-public-surface.mjs +19 -95
- package/scripts/next-development-self-dogfood-harness.mjs +2 -2
- package/scripts/next-development-self-dogfood.mjs +2 -2
- package/scripts/platform-stage-checkpoint-rehearsal.mjs +33 -201
- package/scripts/public-reference.mjs +0 -187
- package/scripts/publication-rehearsal-fixture.mjs +1 -1
- package/scripts/release-train-self-dogfood.mjs +9 -14
- package/scripts/site-action-audit.mjs +16 -0
- package/scripts/site-capability-metadata.mjs +3 -7
- package/scripts/source-metric-lineage.mjs +17 -0
- package/scripts/stage-capsule-resume-rehearsal.mjs +19 -55
- package/scripts/tail-reseal-macos-rehearsal.mjs +1 -109
- package/scripts/tsup-action.config.mjs +21 -0
- package/scripts/verify-golden-path.mjs +1 -1
- package/scripts/warrant-shadow-plan.mjs +49 -243
- package/scripts/workflow-action-graph.mjs +149 -0
- package/templates/bootstrap-recovery/actions/build/source/admit/action.yml +17 -0
- package/templates/bootstrap-recovery/actions/build/source/admit/dist/index.js +63 -0
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/action.yml +18 -0
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/dist/index.js +63 -0
- package/templates/bootstrap-recovery/actions/runtime/environment/prepare/action.yml +21 -0
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/action.yml +27 -0
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/dist/index.js +64 -0
- package/templates/bootstrap-recovery/actions/workflow/admission/review/action.yml +15 -0
- package/templates/bootstrap-recovery/actions/workflow/admission/review/dist/index.js +65 -0
- package/templates/bootstrap-recovery/actions/workflow/recovery/admit/action.yml +47 -0
- package/templates/bootstrap-recovery/actions/workflow/recovery/execute/action.yml +48 -0
- package/templates/bootstrap-recovery/actions/workflow/recovery/settle/action.yml +54 -0
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/action.yml +17 -0
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/dist/index.js +65 -0
- package/templates/bootstrap-recovery/manifest.json +68 -0
- package/templates/bootstrap-recovery/package.json +9 -0
- package/templates/native-dev-delivery.yml +28 -41
- package/templates/universal-buildchain-bootstrap-recovery.yml +46 -213
- package/templates/universal-buildchain-bootstrap.yml +1 -1
- package/actions/github-artifact-attestation/README.md +0 -10
- package/actions/promote-buildchain-ref/README.md +0 -549
- package/actions/report-buildchain-issue/README.md +0 -107
- package/actions/run-lifecycle/README.md +0 -71
- package/actions/validate-config/README.md +0 -52
- package/architecture/implementation-naming.json +0 -1273
- package/bin/internal/adopter-delivery-cli.mjs +0 -70
- package/bin/internal/cli-options.mjs +0 -79
- package/bin/internal/compatibility-facts-cli.mjs +0 -101
- package/bin/internal/trust-release-cli.mjs +0 -19
- package/bin/internal/trust-release-command-handlers.mjs +0 -14
- package/bin/internal/trust-release-inspection-handlers.mjs +0 -175
- package/bin/internal/trust-release-release-handlers.mjs +0 -332
- package/bin/internal/trust-release-verification-handlers.mjs +0 -306
- package/contracts/fixtures/v4-adopter-delivery-v1/archive-template.json +0 -19
- package/contracts/fixtures/v4-adopter-delivery-v1/bootstrap-positive.json +0 -93
- package/packages/compatibility/adopter-delivery.js +0 -16
- package/packages/compatibility/cross-platform-adopter-qualification.js +0 -12
- package/packages/compatibility/floating-consumer-policy.js +0 -14
- package/packages/compatibility/publication-qualification.js +0 -11
- package/packages/compatibility/publication-rehearsal.js +0 -18
- package/packages/compatibility/runtime-ref-resume-authority.js +0 -13
- package/packages/compatibility/tail-reseal-receipt.js +0 -7
- package/packages/compatibility/tail-reseal.js +0 -11
- package/packages/core/adopter-delivery-parity.js +0 -219
- package/packages/core/adopter-delivery.js +0 -359
- package/packages/core/anchored-version-material.js +0 -281
- package/packages/core/artifact-passport.js +0 -847
- package/packages/core/artifact-verification-envelope.js +0 -500
- package/packages/core/build-facts.js +0 -575
- package/packages/core/buildchain-compatibility-authority.js +0 -336
- package/packages/core/buildchain-compatibility-fact.js +0 -394
- package/packages/core/buildchain-compatibility-facts.json +0 -217
- package/packages/core/buildchain-compatibility-proof.js +0 -566
- package/packages/core/buildchain-config.js +0 -1887
- package/packages/core/buildchain-contract.js +0 -1048
- package/packages/core/buildchain-delivery-bootstrap.js +0 -240
- package/packages/core/buildchain-delivery-infrastructure.js +0 -164
- package/packages/core/buildchain-delivery-self-dogfood.js +0 -395
- package/packages/core/buildchain-domain.wasm +0 -0
- package/packages/core/buildchain-kfd-claims.js +0 -733
- package/packages/core/buildchain-publication-authority.js +0 -118
- package/packages/core/canonical-contracts.js +0 -239
- package/packages/core/ci-lane-change-budget.js +0 -260
- package/packages/core/controller-evidence.js +0 -553
- package/packages/core/cross-platform-adopter-qualification.js +0 -343
- package/packages/core/delivery-warrant-fixture-runner.js +0 -375
- package/packages/core/delivery-warrant-read-candidate.js +0 -286
- package/packages/core/delivery-warrant-semantic-diff-gate.js +0 -351
- package/packages/core/delivery-warrant-shadow-adapter.js +0 -447
- package/packages/core/dev-delivery-authority-candidate.js +0 -270
- package/packages/core/dev-delivery-authority-landing.js +0 -461
- package/packages/core/dev-delivery-authority-state.js +0 -583
- package/packages/core/dev-delivery-candidate-identity.js +0 -169
- package/packages/core/dev-delivery-contract-surface.js +0 -76
- package/packages/core/dev-delivery-native-proof.js +0 -566
- package/packages/core/dev-delivery-proof.js +0 -286
- package/packages/core/dev-delivery-warrant-legacy-recovery.js +0 -248
- package/packages/core/dev-delivery-warrant-native-compatibility.js +0 -33
- package/packages/core/dev-delivery-warrant-state.js +0 -599
- package/packages/core/dev-delivery-warrant.js +0 -598
- package/packages/core/diagnostics.js +0 -1904
- package/packages/core/domain-wasm-artifact.js +0 -7
- package/packages/core/floating-consumer-evidence.js +0 -338
- package/packages/core/floating-consumer-policy.js +0 -571
- package/packages/core/github-artifact-attestation.js +0 -642
- package/packages/core/github-governance-authority.js +0 -1369
- package/packages/core/homebrew.js +0 -414
- package/packages/core/kfd-agent-hub.js +0 -496
- package/packages/core/kfd.js +0 -966
- package/packages/core/kfd2-product-claims.js +0 -454
- package/packages/core/kfd3-surface-register.js +0 -924
- package/packages/core/legacy-kfd-adopter-driver.js +0 -167
- package/packages/core/next-development-projection.js +0 -310
- package/packages/core/next-development-transition.js +0 -737
- package/packages/core/oci-compose-qualification.js +0 -143
- package/packages/core/oci-publication-bundle.js +0 -281
- package/packages/core/package-manager.js +0 -323
- package/packages/core/paper-agent-entry.js +0 -396
- package/packages/core/paper-fleet.js +0 -313
- package/packages/core/paper-npm-bootstrap.js +0 -492
- package/packages/core/paper-repository.js +0 -214
- package/packages/core/paper-runtime-channels.js +0 -348
- package/packages/core/paper-scaffold-content.js +0 -574
- package/packages/core/paper.js +0 -2478
- package/packages/core/partial-mutation-recovery-qualification.js +0 -18
- package/packages/core/platform-stage-checkpoints.js +0 -471
- package/packages/core/product-publication.js +0 -59
- package/packages/core/protected-publication-source.js +0 -91
- package/packages/core/provider-operation-journal.js +0 -62
- package/packages/core/provider-readback-idempotency.js +0 -309
- package/packages/core/public-export-compatibility.js +0 -33
- package/packages/core/public-surface-audit.js +0 -273
- package/packages/core/public-surface-cli.js +0 -128
- package/packages/core/publication-artifact-candidate.js +0 -128
- package/packages/core/publication-artifact.js +0 -641
- package/packages/core/publication-authority.js +0 -1163
- package/packages/core/publication-development.js +0 -72
- package/packages/core/publication-package.js +0 -252
- package/packages/core/publication-rehearsal-capsule.js +0 -468
- package/packages/core/publication-rehearsal-projection.js +0 -104
- package/packages/core/publication-rehearsal-runtime.js +0 -190
- package/packages/core/publication-rehearsal.js +0 -481
- package/packages/core/publication-reproducibility.js +0 -947
- package/packages/core/published-delivery-authority.js +0 -266
- package/packages/core/readme-badges.js +0 -893
- package/packages/core/release-activation-shadow.js +0 -32
- package/packages/core/release-blocker-priority.js +0 -192
- package/packages/core/release-candidate-recovery.js +0 -595
- package/packages/core/release-candidate.js +0 -591
- package/packages/core/release-invocation.js +0 -64
- package/packages/core/release-line-bootstrap.js +0 -297
- package/packages/core/release-line-dry-run.js +0 -303
- package/packages/core/release-passport-contract.js +0 -479
- package/packages/core/release-passport.js +0 -2884
- package/packages/core/release-tail-compatibility.js +0 -60
- package/packages/core/release-tail-provider-adapters.js +0 -461
- package/packages/core/release-tail-provider-plane.js +0 -248
- package/packages/core/runtime-selector-persistence.js +0 -228
- package/packages/core/stable-publication-fence.js +0 -28
- package/packages/core/stage-capsule-local-store.js +0 -428
- package/packages/core/stage-capsule-qualification-campaign.js +0 -511
- package/packages/core/stage-capsule-qualification.js +0 -455
- package/packages/core/stage-capsule-resume-planner.js +0 -397
- package/packages/core/stage-capsule-store.js +0 -404
- package/packages/core/stage-capsule.js +0 -319
- package/packages/core/tail-reseal-github.js +0 -178
- package/packages/core/tail-reseal-receipt.js +0 -225
- package/packages/core/tail-reseal.js +0 -594
- package/packages/core/universal-workflow-bootstrap.js +0 -586
- package/packages/core/web-surface-publication-candidate.js +0 -162
- package/packages/core/workflow-yaml-contract.js +0 -342
- package/scripts/aggregate-build-summary.mjs +0 -187
- package/scripts/aggregate-diagnostics-summary.mjs +0 -54
- package/scripts/anchored-version-material.mjs +0 -42
- package/scripts/architecture.mjs +0 -610
- package/scripts/artifact-relay-s3.mjs +0 -539
- package/scripts/artifact-signing-controller-core.mjs +0 -525
- package/scripts/artifact-signing-controller.mjs +0 -302
- package/scripts/artifact-signing-delegation.mjs +0 -316
- package/scripts/assemble-binary-release-admission.mjs +0 -213
- package/scripts/assemble-publication-artifact-admission.mjs +0 -200
- package/scripts/assemble-self-publication-admission.mjs +0 -201
- package/scripts/assemble-web-surface-publication-admission.mjs +0 -204
- package/scripts/audit-github-governance.mjs +0 -493
- package/scripts/audit-publication-control-plane.mjs +0 -527
- package/scripts/auditable-demo-bundle-verification.mjs +0 -148
- package/scripts/auditable-demo-platform.mjs +0 -600
- package/scripts/auditable-demo-presentation.mjs +0 -83
- package/scripts/auditable-demo-renditions.mjs +0 -399
- package/scripts/auditable-demo-transport-smoke.mjs +0 -176
- package/scripts/auditable-demo.mjs +0 -1324
- package/scripts/aws-codebuild-toolchain.mjs +0 -285
- package/scripts/aws-macos-jit-controller-runtime.mjs +0 -82
- package/scripts/aws-runner-burst-core.mjs +0 -248
- package/scripts/aws-runner-burst.mjs +0 -79
- package/scripts/aws-windows-jit-campaign.mjs +0 -202
- package/scripts/aws-windows-jit-controller.mjs +0 -578
- package/scripts/binary-publication-evidence.mjs +0 -133
- package/scripts/bridge-bootstrap.mjs +0 -137
- package/scripts/build-contract-core.mjs +0 -1216
- package/scripts/buildchain-channel-router.mjs +0 -249
- package/scripts/buildchain-cli-help.mjs +0 -321
- package/scripts/buildchain-contract-lock.mjs +0 -184
- package/scripts/buildchain-patrol.mjs +0 -280
- package/scripts/compiler-cache-evidence.mjs +0 -304
- package/scripts/consumer-policy.mjs +0 -231
- package/scripts/controller-evidence.mjs +0 -208
- package/scripts/copy-domain-wasm.mjs +0 -14
- package/scripts/create-github-artifact-attestation-policy.mjs +0 -62
- package/scripts/create-release-bundle.mjs +0 -167
- package/scripts/cross-platform-adopter-qualification.mjs +0 -228
- package/scripts/declarative-promotion-admission.mjs +0 -45
- package/scripts/dev-alpha-candidate-patrol.mjs +0 -1197
- package/scripts/dev-delivery-authority-command-adapters.mjs +0 -206
- package/scripts/dev-delivery-authority-provider.mjs +0 -28
- package/scripts/dev-delivery-authority.mjs +0 -490
- package/scripts/dev-delivery-native-run.mjs +0 -177
- package/scripts/dev-delivery-process-boundary.mjs +0 -260
- package/scripts/dev-delivery-proof.mjs +0 -258
- package/scripts/dev-delivery-provider-heartbeat.mjs +0 -215
- package/scripts/dev-delivery-source-proof-replay.mjs +0 -153
- package/scripts/dev-delivery-source-proof-reuse.mjs +0 -548
- package/scripts/dev-delivery-two-phase-resume.mjs +0 -345
- package/scripts/dev-delivery-two-phase.mjs +0 -573
- package/scripts/dev-delivery-warrant-options.mjs +0 -298
- package/scripts/dev-delivery-warrant-store.mjs +0 -316
- package/scripts/dev-delivery-warrant-transition.mjs +0 -109
- package/scripts/dev-delivery-warrant.mjs +0 -559
- package/scripts/dev-merge-queue.mjs +0 -536
- package/scripts/dev-pr-auto-merge.mjs +0 -1222
- package/scripts/dev-pr-delivery-warrant.mjs +0 -467
- package/scripts/dev-pr-prequeue-guard.mjs +0 -381
- package/scripts/dev-qualification-patrol.mjs +0 -594
- package/scripts/dispatch-artifact-signing-authority.mjs +0 -407
- package/scripts/engineering-housekeeper-workflow.mjs +0 -401
- package/scripts/ensure-github-release.mjs +0 -199
- package/scripts/finalize-native-artifact-signing-result.mjs +0 -272
- package/scripts/generate-channel-build-workflow.mjs +0 -69
- package/scripts/generate-release-candidate-passport.mjs +0 -285
- package/scripts/generate-universal-workflow-facades.mjs +0 -499
- package/scripts/git-fetch-process-tree.mjs +0 -175
- package/scripts/host-adapter.mjs +0 -182
- package/scripts/implementation-references.mjs +0 -25
- package/scripts/import-artifact-signing-results.mjs +0 -135
- package/scripts/infra-contract-core.mjs +0 -1032
- package/scripts/infra-contract.mjs +0 -345
- package/scripts/init-repo.mjs +0 -518
- package/scripts/inspect-artifact-signing-requests.mjs +0 -157
- package/scripts/installer-publication.mjs +0 -361
- package/scripts/lifecycle-substage-evidence.mjs +0 -274
- package/scripts/locked-source-checkout.mjs +0 -595
- package/scripts/materialize-artifact-signing-request.mjs +0 -66
- package/scripts/merge-artifact-signing-results.mjs +0 -76
- package/scripts/next-development-review.mjs +0 -331
- package/scripts/next-development-transition.mjs +0 -47
- package/scripts/npm-publish-dry-run.mjs +0 -182
- package/scripts/npm-publish-transaction.mjs +0 -331
- package/scripts/observed-evidence.mjs +0 -311
- package/scripts/oci-compose-preview.mjs +0 -261
- package/scripts/paper-agent-cli.mjs +0 -35
- package/scripts/paper-work-fleet-cli.mjs +0 -594
- package/scripts/paper.mjs +0 -644
- package/scripts/product-publication-intent.mjs +0 -129
- package/scripts/promotion-channel-router.mjs +0 -139
- package/scripts/promotion-identity-resolver.mjs +0 -129
- package/scripts/publication-artifact-candidate.mjs +0 -122
- package/scripts/publication-artifact.mjs +0 -67
- package/scripts/publication-candidate-kind.mjs +0 -93
- package/scripts/publication-candidate-sealer.mjs +0 -119
- package/scripts/publication-package.mjs +0 -38
- package/scripts/publication-registry-hydrate.mjs +0 -216
- package/scripts/publication-reproducibility.mjs +0 -62
- package/scripts/publication-settlement.mjs +0 -217
- package/scripts/publish-source-ref-resolver.mjs +0 -113
- package/scripts/reconcile-github-governance.mjs +0 -689
- package/scripts/reconcile-release-governance.mjs +0 -368
- package/scripts/release-asset-client.mjs +0 -91
- package/scripts/release-candidate-adapter.mjs +0 -41
- package/scripts/release-candidate-anchor-provenance.mjs +0 -99
- package/scripts/release-candidate-resolver.mjs +0 -842
- package/scripts/release-finalization-review.mjs +0 -53
- package/scripts/release-line-dry-run.mjs +0 -53
- package/scripts/release-line-policy.mjs +0 -231
- package/scripts/release-propagation.mjs +0 -411
- package/scripts/release-tail.mjs +0 -178
- package/scripts/release-transaction.mjs +0 -212
- package/scripts/resolve-artifact-coordinates.mjs +0 -174
- package/scripts/resolve-artifact-transfer-mode.mjs +0 -126
- package/scripts/resolve-build-configuration.mjs +0 -105
- package/scripts/resolve-build-contract.mjs +0 -96
- package/scripts/resolve-publish-gate.mjs +0 -33
- package/scripts/resolve-publish-source.mjs +0 -99
- package/scripts/resume-from-candidate-run.mjs +0 -1117
- package/scripts/route-offline-runners.mjs +0 -237
- package/scripts/run-candidate-body-prefix-renderer.mjs +0 -187
- package/scripts/run-lifecycle-core.mjs +0 -850
- package/scripts/run-lifecycle.mjs +0 -56
- package/scripts/runtime-ref-core.mjs +0 -171
- package/scripts/seal-artifact-signing-requests.mjs +0 -431
- package/scripts/seal-macos-credential-input.mjs +0 -135
- package/scripts/shifu-gate-profile.mjs +0 -374
- package/scripts/sign-detached-artifact-requests.mjs +0 -237
- package/scripts/source-verification-evidence.mjs +0 -344
- package/scripts/stable-candidate-patrol.mjs +0 -527
- package/scripts/stable-candidate-policy.mjs +0 -25
- package/scripts/stable-candidate-qualification.mjs +0 -358
- package/scripts/stable-release-gate.mjs +0 -351
- package/scripts/stage-capsule-qualification.mjs +0 -528
- package/scripts/tail-reseal.mjs +0 -416
- package/scripts/universal-facade-maintainability.mjs +0 -91
- package/scripts/universal-workflow-backflow.mjs +0 -212
- package/scripts/universal-workflow-engine.mjs +0 -620
- package/scripts/universal-workflow-self-dogfood.mjs +0 -212
- package/scripts/validate-package-manager-contract.mjs +0 -24
- package/scripts/verify-artifact-signing-results.mjs +0 -124
- package/scripts/verify-publish-channel-ref.mjs +0 -125
- package/scripts/verify-publish-source-lock.mjs +0 -37
- package/scripts/verify-release-pr.mjs +0 -34
- package/scripts/verify-version-state-delta.mjs +0 -175
- package/scripts/verify-web-surface-publication-capability.mjs +0 -78
- package/scripts/web-surface-core.mjs +0 -2603
- package/scripts/web-surface-production-decision.mjs +0 -158
- package/scripts/web-surface-production-release-pr.mjs +0 -712
- package/scripts/web-surface-release-feedback.mjs +0 -358
- package/scripts/web-surface-release-pr-review.mjs +0 -187
- package/scripts/web-surface.mjs +0 -460
- package/scripts/workflow-call-contract.mjs +0 -133
- package/scripts/workflow-friction-report.mjs +0 -375
- package/scripts/workflow-taxonomy.mjs +0 -507
- /package/actions/{macos-credential-island → build/credential/macos-island}/README.md +0 -0
- /package/actions/{release-candidate-promote → release/promotion/candidate}/README.md +0 -0
- /package/actions/{release-tail → release/tail/settle}/README.md +0 -0
- /package/packages/core/{adopter-delivery-gate.js → adoption/adopter-delivery-gate.js} +0 -0
- /package/packages/core/{adopter-delivery-json.js → adoption/adopter-delivery-json.js} +0 -0
- /package/packages/core/{adopter-delivery-passport.js → adoption/adopter-delivery-passport.js} +0 -0
- /package/packages/core/{adopter-delivery-vectors.js → adoption/adopter-delivery-vectors.js} +0 -0
- /package/packages/core/{adopter-delivery-vectors.json → adoption/adopter-delivery-vectors.json} +0 -0
- /package/packages/core/{buildchain-agent-manuals.js → adoption/buildchain-agent-manuals.js} +0 -0
- /package/packages/core/{kfd-adopter-category-driver.js → adoption/kfd-adopter-category-driver.js} +0 -0
- /package/packages/core/{kfd-adopter-manifest.js → adoption/kfd-adopter-manifest.js} +0 -0
- /package/packages/core/{kfd-gate.js → adoption/kfd-gate.js} +0 -0
- /package/packages/core/{kfd-product-gates.js → adoption/kfd-product-gates.js} +0 -0
- /package/packages/core/{artifact-signing-result.js → build/artifact-signing-result.js} +0 -0
- /package/packages/core/{artifact-signing.js → build/artifact-signing.js} +0 -0
- /package/packages/core/{build-configuration.js → build/build-configuration.js} +0 -0
- /package/{scripts → packages/core/build/commands}/resolve-artifact-signing-upload-route.mjs +0 -0
- /package/packages/core/{detached-artifact-signature.js → build/detached-artifact-signature.js} +0 -0
- /package/{scripts/gate-profile-core.mjs → packages/core/build/gate/contracts.js} +0 -0
- /package/packages/core/{portable-dev-cache.js → build/portable-dev-cache.js} +0 -0
- /package/packages/core/{buildchain-channel-identity.js → consumer/buildchain-channel-identity.js} +0 -0
- /package/packages/core/{floating-consumer-release-passport.js → consumer/floating-consumer-release-passport.js} +0 -0
- /package/packages/core/{runtime-ref-resume-authority.js → consumer/runtime-ref-resume-authority.js} +0 -0
- /package/packages/core/{buildchain-layout.js → contracts/buildchain-layout.js} +0 -0
- /package/{bin/internal → packages/core/contracts}/command-registry.mjs +0 -0
- /package/packages/core/{kungfu-temporal-fact.js → contracts/kungfu-temporal-fact.js} +0 -0
- /package/packages/core/{surface-manifest.js → contracts/surface-manifest.js} +0 -0
- /package/packages/core/{workflow-call-contract.js → contracts/workflow-call-contract.js} +0 -0
- /package/{scripts → packages/core/dev-delivery/commands}/project-cut-merge-queue-admission.mjs +0 -0
- /package/packages/core/{dev-delivery-authority-evidence.js → dev-delivery/dev-delivery-authority-evidence.js} +0 -0
- /package/packages/core/{dev-delivery-authority-observation.js → dev-delivery/dev-delivery-authority-observation.js} +0 -0
- /package/packages/core/{dev-delivery-authority-qualification.js → dev-delivery/dev-delivery-authority-qualification.js} +0 -0
- /package/packages/core/{dev-delivery-authority-settlement.js → dev-delivery/dev-delivery-authority-settlement.js} +0 -0
- /package/packages/core/{dev-delivery-common.js → dev-delivery/dev-delivery-common.js} +0 -0
- /package/packages/core/{dev-delivery-execution-failure.js → dev-delivery/dev-delivery-execution-failure.js} +0 -0
- /package/packages/core/{dev-delivery-execution-transfer.js → dev-delivery/dev-delivery-execution-transfer.js} +0 -0
- /package/packages/core/{dev-delivery-landing-admission-core.js → dev-delivery/dev-delivery-landing-admission-core.js} +0 -0
- /package/packages/core/{dev-delivery-landing-readback.js → dev-delivery/dev-delivery-landing-readback.js} +0 -0
- /package/packages/core/{dev-delivery-landing-terminal-evidence.js → dev-delivery/dev-delivery-landing-terminal-evidence.js} +0 -0
- /package/packages/core/{dev-delivery-landing-testing-port.js → dev-delivery/dev-delivery-landing-testing-port.js} +0 -0
- /package/packages/core/{dev-delivery-native-execution.js → dev-delivery/dev-delivery-native-execution.js} +0 -0
- /package/packages/core/{dev-delivery-process-boundary.js → dev-delivery/dev-delivery-process-boundary.js} +0 -0
- /package/packages/core/{dev-delivery-provider-attempt.js → dev-delivery/dev-delivery-provider-attempt.js} +0 -0
- /package/packages/core/{dev-delivery-provider-heartbeat.js → dev-delivery/dev-delivery-provider-heartbeat.js} +0 -0
- /package/packages/core/{dev-delivery-warrant-cancellation.js → dev-delivery/dev-delivery-warrant-cancellation.js} +0 -0
- /package/packages/core/{dev-delivery-warrant-qualification.js → dev-delivery/dev-delivery-warrant-qualification.js} +0 -0
- /package/packages/core/{dev-delivery-warrant-settlement.js → dev-delivery/dev-delivery-warrant-settlement.js} +0 -0
- /package/packages/core/{dev-delivery-writer-protocol-transition.js → dev-delivery/dev-delivery-writer-protocol-transition.js} +0 -0
- /package/packages/core/{engineering-housekeeper-github-client.js → governance/engineering-housekeeper-github-client.js} +0 -0
- /package/packages/core/{engineering-housekeeper-github.js → governance/engineering-housekeeper-github.js} +0 -0
- /package/packages/core/{engineering-housekeeper.js → governance/engineering-housekeeper.js} +0 -0
- /package/packages/core/{issue-reporting.js → governance/issue-reporting.js} +0 -0
- /package/packages/core/{cache-evidence.js → observability/cache-evidence.js} +0 -0
- /package/packages/core/{candidate-timeline.js → observability/candidate-timeline.js} +0 -0
- /package/packages/core/{logging.js → observability/logging.js} +0 -0
- /package/packages/core/{paper-work.js → paper/paper-work.js} +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-macos-jit-controller-core.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-macos-jit-controller.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-macos-jit-core.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-macos-jit-job-controller.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-macos-jit.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-windows-jit-campaign-core.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-windows-jit-controller-core.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-windows-jit-core.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/aws-windows-jit.mjs +0 -0
- /package/{scripts → packages/core/providers/commands}/github-output.mjs +0 -0
- /package/packages/core/{oci-publication-graph.js → publication/oci-publication-graph.js} +0 -0
- /package/packages/core/{publication-control-plane-audit.js → publication/publication-control-plane-audit.js} +0 -0
- /package/packages/core/{publication-qualification.js → publication/publication-qualification.js} +0 -0
- /package/packages/core/{publication-rehearsal-provider-bindings.js → publication/publication-rehearsal-provider-bindings.js} +0 -0
- /package/packages/core/{publication-sealed-bundle.js → publication/publication-sealed-bundle.js} +0 -0
- /package/packages/core/{channel-candidate.js → release/channel-candidate.js} +0 -0
- /package/packages/core/{channel-promotion-baseline.js → release/channel-promotion-baseline.js} +0 -0
- /package/{scripts → packages/core/release/commands}/promotion-routing-evidence.mjs +0 -0
- /package/packages/core/{dev-alpha-active-release-train.js → release/dev-alpha-active-release-train.js} +0 -0
- /package/packages/core/{dev-alpha-candidate-selection.js → release/dev-alpha-candidate-selection.js} +0 -0
- /package/packages/core/{next-development-candidate-reservation.js → release/next-development-candidate-reservation.js} +0 -0
- /package/packages/core/{next-development-controller.js → release/next-development-controller.js} +0 -0
- /package/packages/core/{publish-transaction.js → release/publish-transaction.js} +0 -0
- /package/packages/core/{release-activation-transaction.js → release/release-activation-transaction.js} +0 -0
- /package/packages/core/{release-propagation-agent-entry.js → release/release-propagation-agent-entry.js} +0 -0
- /package/packages/core/{release-propagation-capture.js → release/release-propagation-capture.js} +0 -0
- /package/packages/core/{release-propagation-common.js → release/release-propagation-common.js} +0 -0
- /package/packages/core/{release-propagation-execution-profile.js → release/release-propagation-execution-profile.js} +0 -0
- /package/packages/core/{release-propagation-pickup.js → release/release-propagation-pickup.js} +0 -0
- /package/packages/core/{release-propagation-push.js → release/release-propagation-push.js} +0 -0
- /package/packages/core/{release-propagation-release.js → release/release-propagation-release.js} +0 -0
- /package/packages/core/{release-propagation-stage-evidence.js → release/release-propagation-stage-evidence.js} +0 -0
- /package/packages/core/{release-propagation-work-capture.js → release/release-propagation-work-capture.js} +0 -0
- /package/packages/core/{release-propagation-work-constants.js → release/release-propagation-work-constants.js} +0 -0
- /package/packages/core/{release-propagation-work-control.js → release/release-propagation-work-control.js} +0 -0
- /package/packages/core/{release-propagation-work-transitions.js → release/release-propagation-work-transitions.js} +0 -0
- /package/packages/core/{release-propagation-work.js → release/release-propagation-work.js} +0 -0
- /package/packages/core/{release-propagation.js → release/release-propagation.js} +0 -0
- /package/packages/core/{release-tail-product-capabilities.js → release/release-tail-product-capabilities.js} +0 -0
- /package/packages/core/{release-train.js → release/release-train.js} +0 -0
- /package/packages/core/{self-dogfood-version.js → release/self-dogfood-version.js} +0 -0
- /package/packages/core/{stable-candidate-ledger.js → release/stable-candidate-ledger.js} +0 -0
- /package/packages/core/{stable-release-gate.js → release/stable-release-gate.js} +0 -0
- /package/packages/core/{tail-reseal-contract.js → release/tail-reseal-contract.js} +0 -0
- /package/packages/core/{domain-wasm.js → runtime/domain-wasm.js} +0 -0
- /package/packages/core/{spawn-command.js → runtime/spawn-command.js} +0 -0
- /package/packages/core/{badges.js → web/badges.js} +0 -0
- /package/{scripts → packages/core/web/commands}/web-surface-cloudfront-rewrite.mjs +0 -0
- /package/{scripts → packages/core/web/commands}/web-surface-immutable-object.mjs +0 -0
- /package/{scripts → packages/core/web/commands}/web-surface-routing.mjs +0 -0
|
@@ -0,0 +1,1825 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { isDeepStrictEqual } from "node:util";
|
|
5
|
+
import { parse } from "smol-toml";
|
|
6
|
+
import {
|
|
7
|
+
BUILDCHAIN_CONFIG_PATH,
|
|
8
|
+
resolveBuildchainConfigPath,
|
|
9
|
+
} from "../contracts/buildchain-layout.js";
|
|
10
|
+
import { runShellCommandSync } from "../runtime/spawn-command.js";
|
|
11
|
+
import { normalizeBuildConfiguration } from "../build/build-configuration.js";
|
|
12
|
+
|
|
13
|
+
const CONFIG_FILE = BUILDCHAIN_CONFIG_PATH;
|
|
14
|
+
const RESERVED_LIFECYCLE_KEYS = new Set(["env", "shell"]);
|
|
15
|
+
const SUPPORTED_VERSION_FILE_TYPES = new Set(["json", "toml", "regex"]);
|
|
16
|
+
const SUPPORTED_VERSION_STRATEGIES = new Set(["semver", "anchored"]);
|
|
17
|
+
const SUPPORTED_VERSION_NEXT = new Set(["auto", "manual"]);
|
|
18
|
+
const SUPPORTED_PROJECT_TYPES = new Set(["package", "web-surface", "infra-contract", "distribution-index", "publication-artifact"]);
|
|
19
|
+
const SUPPORTED_PUBLISH_MODES = new Set(["publish-final-version", "promote-existing-version"]);
|
|
20
|
+
const SUPPORTED_PUBLISH_AUTH = new Set(["trusted-publishing", "npm-token"]);
|
|
21
|
+
const SUPPORTED_PUBLISH_KINDS = new Set(["npm-package", "npm-paper-package"]);
|
|
22
|
+
const SUPPORTED_PACKAGE_SET_ORDER = new Set(["as-provided", "platforms-first-main-last"]);
|
|
23
|
+
const SUPPORTED_STABLE_RELEASE_STRATEGIES = new Set(["manual", "latest-qualified-alpha"]);
|
|
24
|
+
const SUPPORTED_MERGE_QUEUE_MODES = new Set(["inherit", "enabled", "disabled"]);
|
|
25
|
+
const SUPPORTED_NATIVE_COMPILER_CACHE = new Set(["auto", "ccache", "sccache", "none"]);
|
|
26
|
+
const WEB_SURFACE_CHANNELS = ["preview", "staging", "production"];
|
|
27
|
+
const SUPPORTED_CHANNEL_VISIBILITY = new Set(["ephemeral", "protected", "public", "internal"]);
|
|
28
|
+
const SUPPORTED_ACCESS_CONTROL = new Set(["none", "managed-network", "edge-basic-auth", "oidc", "app-auth"]);
|
|
29
|
+
const SUPPORTED_EDGE_AUTH = new Set(["none", "cloudfront-basic-auth", "oidc", "app-auth"]);
|
|
30
|
+
const SUPPORTED_DEPLOY_ADAPTERS = new Set([
|
|
31
|
+
"aws-s3-cloudfront",
|
|
32
|
+
"aws-elastic-beanstalk",
|
|
33
|
+
"aws-ecs-service",
|
|
34
|
+
]);
|
|
35
|
+
const SUPPORTED_DIRECTORY_INDEX_REWRITE = new Set(["buildchain", "external"]);
|
|
36
|
+
const SUPPORTED_HEALTH_STRATEGIES = new Set(["http", "s3-object"]);
|
|
37
|
+
const SUPPORTED_INFRA_ADAPTERS = new Set([
|
|
38
|
+
"manual-observed",
|
|
39
|
+
"aws-cloudformation",
|
|
40
|
+
"terraform",
|
|
41
|
+
"opentofu",
|
|
42
|
+
"pulumi",
|
|
43
|
+
"aws-cdk",
|
|
44
|
+
"aws-cli",
|
|
45
|
+
"custom-command",
|
|
46
|
+
]);
|
|
47
|
+
const SUPPORTED_INFRA_ADOPTION_MODES = new Set([
|
|
48
|
+
"validate-only",
|
|
49
|
+
"plan-only",
|
|
50
|
+
"observe-only",
|
|
51
|
+
"manual-observed",
|
|
52
|
+
"import-planned",
|
|
53
|
+
"managed-apply",
|
|
54
|
+
]);
|
|
55
|
+
const SUPPORTED_INFRA_APPLY_MODES = new Set(["disabled", "manual-approval", "environment-approval"]);
|
|
56
|
+
const SUPPORTED_FACT_VERSION_SOURCE_TYPES = new Set(["static", "json", "toml", "regex", "command"]);
|
|
57
|
+
const SUPPORTED_PUBLICATION_TOOLCHAINS = new Set(["custom-command", "latex-docker"]);
|
|
58
|
+
const SUPPORTED_SIGNING_PROFILES = new Set([
|
|
59
|
+
"auto",
|
|
60
|
+
"apple-developer-id",
|
|
61
|
+
"windows-authenticode",
|
|
62
|
+
"detached-signature-v1",
|
|
63
|
+
]);
|
|
64
|
+
const SUPPORTED_SIGNING_ENTITLEMENTS_PROFILES = new Set([
|
|
65
|
+
"none",
|
|
66
|
+
"jit-executable-v1",
|
|
67
|
+
]);
|
|
68
|
+
const SUPPORTED_SIGNING_ARTIFACT_KINDS = new Set([
|
|
69
|
+
"auto", "binary", "archive", "blob", "directory", "mach-o", "app-bundle",
|
|
70
|
+
"framework-bundle", "plugin-bundle", "xpc-bundle", "dylib", "pkg", "dmg",
|
|
71
|
+
"pe",
|
|
72
|
+
]);
|
|
73
|
+
|
|
74
|
+
function posixPath(value) {
|
|
75
|
+
return String(value || "").split(path.sep).join("/");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function assertPlainObject(value, label) {
|
|
79
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
80
|
+
throw new Error(`${label} must be a table`);
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function assertString(value, label) {
|
|
86
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
87
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
88
|
+
}
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function optionalBoolean(value, fallback) {
|
|
93
|
+
return value === undefined ? fallback : Boolean(value);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function normalizeStringArray(value, label) {
|
|
97
|
+
if (value === undefined) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
if (!Array.isArray(value)) {
|
|
101
|
+
throw new Error(`${label} must be an array of strings`);
|
|
102
|
+
}
|
|
103
|
+
return value.map((entry, index) => assertString(entry, `${label}[${index}]`));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function normalizeSigningEntitlementsPaths(value, label) {
|
|
107
|
+
const paths = normalizeStringArray(value, label);
|
|
108
|
+
for (const [index, entry] of paths.entries()) {
|
|
109
|
+
const parts = entry.split("/");
|
|
110
|
+
if (
|
|
111
|
+
entry.startsWith("/") ||
|
|
112
|
+
entry.includes("\\") ||
|
|
113
|
+
entry.includes(",") ||
|
|
114
|
+
parts.some((part) => part === "" || part === "." || part === "..")
|
|
115
|
+
) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
`${label}[${index}] must be a safe archive-relative path`,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (new Set(paths).size !== paths.length) {
|
|
122
|
+
throw new Error(`${label} must not contain duplicate paths`);
|
|
123
|
+
}
|
|
124
|
+
return paths;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getByDottedKey(target, key) {
|
|
128
|
+
return String(key)
|
|
129
|
+
.split(".")
|
|
130
|
+
.reduce((current, segment) => current?.[segment], target);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function setByDottedKey(target, key, value) {
|
|
134
|
+
const segments = String(key).split(".");
|
|
135
|
+
let current = target;
|
|
136
|
+
for (const segment of segments.slice(0, -1)) {
|
|
137
|
+
if (!current[segment] || typeof current[segment] !== "object" || Array.isArray(current[segment])) {
|
|
138
|
+
current[segment] = {};
|
|
139
|
+
}
|
|
140
|
+
current = current[segment];
|
|
141
|
+
}
|
|
142
|
+
current[segments[segments.length - 1]] = value;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function updateTomlStringValuePreservingSource({ source, content, key, value, filePath }) {
|
|
146
|
+
const currentValue = getByDottedKey(content, key);
|
|
147
|
+
if (currentValue === value) {
|
|
148
|
+
return source;
|
|
149
|
+
}
|
|
150
|
+
if (typeof currentValue !== "string" || currentValue.length === 0) {
|
|
151
|
+
throw new Error(`Configured TOML version key is missing or empty: ${filePath}:${key}`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const expected = structuredClone(content);
|
|
155
|
+
setByDottedKey(expected, key, value);
|
|
156
|
+
const candidates = [];
|
|
157
|
+
let offset = 0;
|
|
158
|
+
while (offset <= source.length - currentValue.length) {
|
|
159
|
+
const index = source.indexOf(currentValue, offset);
|
|
160
|
+
if (index === -1) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
const candidate = `${source.slice(0, index)}${value}${source.slice(index + currentValue.length)}`;
|
|
164
|
+
try {
|
|
165
|
+
if (isDeepStrictEqual(parse(candidate), expected)) {
|
|
166
|
+
candidates.push(candidate);
|
|
167
|
+
}
|
|
168
|
+
} catch {
|
|
169
|
+
// Keep searching. Only a parser-confirmed single-field update is safe.
|
|
170
|
+
}
|
|
171
|
+
offset = index + currentValue.length;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (candidates.length !== 1) {
|
|
175
|
+
throw new Error(
|
|
176
|
+
`Configured TOML version key cannot be updated losslessly: ${filePath}:${key} ` +
|
|
177
|
+
`(matching candidates: ${candidates.length})`,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return candidates[0];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function loadBuildchainConfig(cwd = process.cwd()) {
|
|
184
|
+
const configPath = resolveBuildchainConfigPath(cwd);
|
|
185
|
+
const filePath = path.join(cwd, configPath);
|
|
186
|
+
if (!fs.existsSync(filePath)) {
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
const source = fs.readFileSync(filePath, "utf8");
|
|
190
|
+
let config;
|
|
191
|
+
try {
|
|
192
|
+
config = parse(source);
|
|
193
|
+
} catch (error) {
|
|
194
|
+
throw new Error(`${configPath} parse failed: ${error.message}`);
|
|
195
|
+
}
|
|
196
|
+
if (config.schema !== 1) {
|
|
197
|
+
throw new Error(`${configPath} schema must be 1`);
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
path: configPath,
|
|
201
|
+
filePath,
|
|
202
|
+
config: normalizeBuildchainConfig(config),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function normalizeBuildchainConfig(config) {
|
|
207
|
+
assertPlainObject(config, CONFIG_FILE);
|
|
208
|
+
const normalized = { ...config };
|
|
209
|
+
if (normalized.build !== undefined) normalized.build = normalizeBuildConfiguration(normalized.build);
|
|
210
|
+
if (normalized.project !== undefined) {
|
|
211
|
+
normalized.project = normalizeProjectSection(normalized.project);
|
|
212
|
+
}
|
|
213
|
+
if (normalized.version !== undefined) {
|
|
214
|
+
normalized.version = normalizeVersionSection(normalized.version);
|
|
215
|
+
}
|
|
216
|
+
if (normalized.lifecycle !== undefined) {
|
|
217
|
+
normalized.lifecycle = normalizeLifecycleSection(normalized.lifecycle);
|
|
218
|
+
}
|
|
219
|
+
if (normalized.publish !== undefined) {
|
|
220
|
+
normalized.publish = normalizePublishSection(normalized.publish);
|
|
221
|
+
}
|
|
222
|
+
if (normalized.release !== undefined) {
|
|
223
|
+
normalized.release = normalizeReleaseSection(normalized.release);
|
|
224
|
+
}
|
|
225
|
+
if (normalized.governance !== undefined) {
|
|
226
|
+
normalized.governance = normalizeGovernanceSection(normalized.governance);
|
|
227
|
+
}
|
|
228
|
+
if (normalized.channels !== undefined) {
|
|
229
|
+
normalized.channels = normalizeChannelsSection(normalized.channels, normalized.project);
|
|
230
|
+
}
|
|
231
|
+
if (normalized.deploy !== undefined) {
|
|
232
|
+
normalized.deploy = normalizeDeploySection(normalized.deploy, normalized.project);
|
|
233
|
+
}
|
|
234
|
+
if (normalized.infra !== undefined) {
|
|
235
|
+
normalized.infra = normalizeInfraSection(normalized.infra);
|
|
236
|
+
}
|
|
237
|
+
if (normalized.publication !== undefined) {
|
|
238
|
+
normalized.publication = normalizePublicationSection(normalized.publication);
|
|
239
|
+
}
|
|
240
|
+
if (normalized.publication_rehearsal !== undefined) {
|
|
241
|
+
normalized.publication_rehearsal = normalizePublicationRehearsalSection(
|
|
242
|
+
normalized.publication_rehearsal,
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
if (normalized.adopter_delivery !== undefined) {
|
|
246
|
+
throw new Error("Adopter Delivery configuration belongs in its closed JSON request");
|
|
247
|
+
}
|
|
248
|
+
if (normalized.consumers !== undefined) {
|
|
249
|
+
normalized.consumers = normalizeConsumersSection(normalized.consumers);
|
|
250
|
+
}
|
|
251
|
+
if (normalized.surfaces !== undefined) {
|
|
252
|
+
normalized.surfaces = normalizeSurfacesSection(normalized.surfaces);
|
|
253
|
+
}
|
|
254
|
+
if (normalized.retention !== undefined) {
|
|
255
|
+
normalized.retention = normalizeRetentionSection(normalized.retention);
|
|
256
|
+
}
|
|
257
|
+
if (normalized.security !== undefined) {
|
|
258
|
+
normalized.security = normalizeSecuritySection(normalized.security);
|
|
259
|
+
}
|
|
260
|
+
if (normalized.diagnostics !== undefined) {
|
|
261
|
+
normalized.diagnostics = normalizeDiagnosticsSection(normalized.diagnostics);
|
|
262
|
+
}
|
|
263
|
+
if (normalized.facts !== undefined) {
|
|
264
|
+
normalized.facts = normalizeFactsSection(normalized.facts);
|
|
265
|
+
}
|
|
266
|
+
if (normalized.signing !== undefined) {
|
|
267
|
+
normalized.signing = normalizeSigningSection(normalized.signing);
|
|
268
|
+
}
|
|
269
|
+
validateWebSurfaceConfig(normalized);
|
|
270
|
+
validateInfraContractConfig(normalized);
|
|
271
|
+
validateAnchoredDerivedVersionMaterialConfig(normalized);
|
|
272
|
+
return normalized;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function normalizeGovernanceSection(governance) {
|
|
276
|
+
assertPlainObject(governance, "governance");
|
|
277
|
+
const normalized = { ...governance };
|
|
278
|
+
if (governance.dev !== undefined) {
|
|
279
|
+
assertPlainObject(governance.dev, "governance.dev");
|
|
280
|
+
normalized.dev = { ...governance.dev };
|
|
281
|
+
if (governance.dev.merge_queue !== undefined) {
|
|
282
|
+
const mergeQueue = assertPlainObject(governance.dev.merge_queue, "governance.dev.merge_queue");
|
|
283
|
+
const mode = mergeQueue.mode === undefined
|
|
284
|
+
? "inherit"
|
|
285
|
+
: assertString(mergeQueue.mode, "governance.dev.merge_queue.mode");
|
|
286
|
+
if (!SUPPORTED_MERGE_QUEUE_MODES.has(mode)) {
|
|
287
|
+
throw new Error("governance.dev.merge_queue.mode must be one of inherit, enabled, or disabled");
|
|
288
|
+
}
|
|
289
|
+
const checkResponseTimeoutMinutes = mergeQueue.check_response_timeout_minutes === undefined
|
|
290
|
+
? 120
|
|
291
|
+
: Number(mergeQueue.check_response_timeout_minutes);
|
|
292
|
+
const maxEntriesToBuild = mergeQueue.max_entries_to_build === undefined
|
|
293
|
+
? 1
|
|
294
|
+
: Number(mergeQueue.max_entries_to_build);
|
|
295
|
+
if (!Number.isInteger(checkResponseTimeoutMinutes) || checkResponseTimeoutMinutes < 1) {
|
|
296
|
+
throw new Error("governance.dev.merge_queue.check_response_timeout_minutes must be a positive integer");
|
|
297
|
+
}
|
|
298
|
+
if (!Number.isInteger(maxEntriesToBuild) || maxEntriesToBuild < 1) {
|
|
299
|
+
throw new Error("governance.dev.merge_queue.max_entries_to_build must be a positive integer");
|
|
300
|
+
}
|
|
301
|
+
normalized.dev = {
|
|
302
|
+
...governance.dev,
|
|
303
|
+
mergeQueue: {
|
|
304
|
+
mode,
|
|
305
|
+
requiredWorkflows: normalizeStringArray(
|
|
306
|
+
mergeQueue.required_workflows,
|
|
307
|
+
"governance.dev.merge_queue.required_workflows",
|
|
308
|
+
),
|
|
309
|
+
checkResponseTimeoutMinutes,
|
|
310
|
+
maxEntriesToBuild,
|
|
311
|
+
bypassApps: normalizeStringArray(mergeQueue.bypass_apps, "governance.dev.merge_queue.bypass_apps"),
|
|
312
|
+
bypassUsers: normalizeStringArray(mergeQueue.bypass_users, "governance.dev.merge_queue.bypass_users"),
|
|
313
|
+
bypassTeams: normalizeStringArray(mergeQueue.bypass_teams, "governance.dev.merge_queue.bypass_teams"),
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
delete normalized.dev.merge_queue;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return normalized;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function normalizeReleaseSection(release) {
|
|
323
|
+
assertPlainObject(release, "release");
|
|
324
|
+
const normalized = { ...release };
|
|
325
|
+
if (release.stable !== undefined) {
|
|
326
|
+
assertPlainObject(release.stable, "release.stable");
|
|
327
|
+
const strategy = release.stable.strategy === undefined
|
|
328
|
+
? "manual"
|
|
329
|
+
: assertString(release.stable.strategy, "release.stable.strategy");
|
|
330
|
+
if (!SUPPORTED_STABLE_RELEASE_STRATEGIES.has(strategy)) {
|
|
331
|
+
throw new Error("release.stable.strategy must be one of manual or latest-qualified-alpha");
|
|
332
|
+
}
|
|
333
|
+
const minimumSoakSeconds = release.stable.minimum_soak_seconds === undefined
|
|
334
|
+
? 3600
|
|
335
|
+
: Number(release.stable.minimum_soak_seconds);
|
|
336
|
+
if (!Number.isInteger(minimumSoakSeconds) || minimumSoakSeconds < 0) {
|
|
337
|
+
throw new Error("release.stable.minimum_soak_seconds must be a non-negative integer");
|
|
338
|
+
}
|
|
339
|
+
normalized.stable = {
|
|
340
|
+
strategy,
|
|
341
|
+
timezone: release.stable.timezone === undefined
|
|
342
|
+
? "UTC"
|
|
343
|
+
: assertString(release.stable.timezone, "release.stable.timezone"),
|
|
344
|
+
publishAt: release.stable.publish_at === undefined
|
|
345
|
+
? "03:00"
|
|
346
|
+
: assertString(release.stable.publish_at, "release.stable.publish_at"),
|
|
347
|
+
minimumSoakSeconds,
|
|
348
|
+
requiredChecks: normalizeStringArray(release.stable.required_checks, "release.stable.required_checks"),
|
|
349
|
+
ledgerRef: release.stable.ledger_ref === undefined
|
|
350
|
+
? ""
|
|
351
|
+
: assertString(release.stable.ledger_ref, "release.stable.ledger_ref"),
|
|
352
|
+
autoPromote: optionalBoolean(release.stable.auto_promote, strategy === "latest-qualified-alpha"),
|
|
353
|
+
autoMerge: optionalBoolean(release.stable.auto_merge, false),
|
|
354
|
+
};
|
|
355
|
+
if (!/^([01]\d|2[0-3]):[0-5]\d$/.test(normalized.stable.publishAt)) {
|
|
356
|
+
throw new Error("release.stable.publish_at must be HH:MM in 24-hour time");
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return normalized;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export function getStableReleasePolicy(loadedConfig) {
|
|
363
|
+
return loadedConfig?.config?.release?.stable || {
|
|
364
|
+
strategy: "manual",
|
|
365
|
+
timezone: "UTC",
|
|
366
|
+
publishAt: "03:00",
|
|
367
|
+
minimumSoakSeconds: 3600,
|
|
368
|
+
requiredChecks: [],
|
|
369
|
+
ledgerRef: "",
|
|
370
|
+
autoPromote: false,
|
|
371
|
+
autoMerge: false,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function normalizeFactsSection(facts) {
|
|
376
|
+
assertPlainObject(facts, "facts");
|
|
377
|
+
for (const key of Object.keys(facts)) {
|
|
378
|
+
if (!["output_dir", "version_sources", "modules", "products"].includes(key)) throw new Error(`unsupported facts field: ${key}`);
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
outputDir: facts.output_dir === undefined ? ".buildchain/facts" : posixPath(assertString(facts.output_dir, "facts.output_dir")),
|
|
382
|
+
versionSources: normalizeFactVersionSources(facts.version_sources),
|
|
383
|
+
modules: normalizeFactModules(facts.modules),
|
|
384
|
+
products: normalizeFactProducts(facts.products),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function normalizeSigningSection(signing) {
|
|
389
|
+
assertPlainObject(signing, "signing");
|
|
390
|
+
for (const key of Object.keys(signing)) {
|
|
391
|
+
if (key !== "artifacts") {
|
|
392
|
+
throw new Error(`signing.${key} is not supported; consumer signing declarations cannot configure credentials or authority infrastructure`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (!Array.isArray(signing.artifacts) || signing.artifacts.length === 0) {
|
|
396
|
+
throw new Error("signing.artifacts must declare at least one artifact");
|
|
397
|
+
}
|
|
398
|
+
const artifacts = signing.artifacts.map((artifact, index) => {
|
|
399
|
+
const label = `signing.artifacts[${index}]`;
|
|
400
|
+
assertPlainObject(artifact, label);
|
|
401
|
+
const allowedKeys = new Set([
|
|
402
|
+
"id",
|
|
403
|
+
"path",
|
|
404
|
+
"profile",
|
|
405
|
+
"entitlements_profile",
|
|
406
|
+
"entitlements_paths",
|
|
407
|
+
"kind",
|
|
408
|
+
"platforms",
|
|
409
|
+
"required",
|
|
410
|
+
]);
|
|
411
|
+
for (const key of Object.keys(artifact)) {
|
|
412
|
+
if (!allowedKeys.has(key)) {
|
|
413
|
+
throw new Error(`${label}.${key} is not supported; declare desired signature state only`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
const artifactPath = posixPath(assertString(artifact.path, `${label}.path`));
|
|
417
|
+
const profile = artifact.profile === undefined ? "auto" : assertString(artifact.profile, `${label}.profile`);
|
|
418
|
+
if (!SUPPORTED_SIGNING_PROFILES.has(profile)) {
|
|
419
|
+
throw new Error(`${label}.profile must be one of auto, apple-developer-id, windows-authenticode, or detached-signature-v1`);
|
|
420
|
+
}
|
|
421
|
+
const kind = artifact.kind === undefined ? "auto" : assertString(artifact.kind, `${label}.kind`);
|
|
422
|
+
if (!SUPPORTED_SIGNING_ARTIFACT_KINDS.has(kind)) {
|
|
423
|
+
throw new Error(`${label}.kind is not a supported signing artifact kind`);
|
|
424
|
+
}
|
|
425
|
+
const entitlementsProfile =
|
|
426
|
+
artifact.entitlements_profile === undefined
|
|
427
|
+
? "none"
|
|
428
|
+
: assertString(
|
|
429
|
+
artifact.entitlements_profile,
|
|
430
|
+
`${label}.entitlements_profile`,
|
|
431
|
+
);
|
|
432
|
+
if (!SUPPORTED_SIGNING_ENTITLEMENTS_PROFILES.has(entitlementsProfile)) {
|
|
433
|
+
throw new Error(
|
|
434
|
+
`${label}.entitlements_profile must be one of none or jit-executable-v1`,
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
if (entitlementsProfile !== "none" && kind !== "archive") {
|
|
438
|
+
throw new Error(
|
|
439
|
+
`${label}.entitlements_profile ${entitlementsProfile} requires kind = "archive"`,
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
const entitlementsPaths = normalizeSigningEntitlementsPaths(
|
|
443
|
+
artifact.entitlements_paths,
|
|
444
|
+
`${label}.entitlements_paths`,
|
|
445
|
+
);
|
|
446
|
+
if (
|
|
447
|
+
(entitlementsProfile === "none" && entitlementsPaths.length !== 0) ||
|
|
448
|
+
(entitlementsProfile !== "none" && entitlementsPaths.length === 0)
|
|
449
|
+
) {
|
|
450
|
+
throw new Error(
|
|
451
|
+
`${label}.entitlements_paths must be non-empty exactly when entitlements_profile is enabled`,
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
return {
|
|
455
|
+
id: artifact.id === undefined ? artifactPath : assertString(artifact.id, `${label}.id`),
|
|
456
|
+
path: artifactPath,
|
|
457
|
+
profile,
|
|
458
|
+
entitlementsProfile,
|
|
459
|
+
entitlementsPaths,
|
|
460
|
+
kind,
|
|
461
|
+
platforms: normalizeStringArray(artifact.platforms, `${label}.platforms`),
|
|
462
|
+
required: optionalBoolean(artifact.required, true),
|
|
463
|
+
};
|
|
464
|
+
});
|
|
465
|
+
if (new Set(artifacts.map((artifact) => artifact.id)).size !== artifacts.length) {
|
|
466
|
+
throw new Error("signing.artifacts must use unique ids");
|
|
467
|
+
}
|
|
468
|
+
return { artifacts };
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function normalizeFactVersionSources(sources = []) {
|
|
472
|
+
if (sources === undefined) {
|
|
473
|
+
return [];
|
|
474
|
+
}
|
|
475
|
+
if (!Array.isArray(sources)) {
|
|
476
|
+
throw new Error("facts.version_sources must be an array of tables");
|
|
477
|
+
}
|
|
478
|
+
return sources.map((source, index) => {
|
|
479
|
+
assertPlainObject(source, `facts.version_sources[${index}]`);
|
|
480
|
+
const id = assertString(source.id, `facts.version_sources[${index}].id`);
|
|
481
|
+
const type = source.type === undefined ? "static" : assertString(source.type, `facts.version_sources[${index}].type`);
|
|
482
|
+
if (!SUPPORTED_FACT_VERSION_SOURCE_TYPES.has(type)) {
|
|
483
|
+
throw new Error("facts.version_sources[].type must be one of static, json, toml, regex, or command");
|
|
484
|
+
}
|
|
485
|
+
if (["json", "toml", "regex"].includes(type) && source.path === undefined) {
|
|
486
|
+
throw new Error(`facts.version_sources[${index}].path is required for ${type}`);
|
|
487
|
+
}
|
|
488
|
+
if (["json", "toml"].includes(type) && source.key === undefined) {
|
|
489
|
+
throw new Error(`facts.version_sources[${index}].key is required for ${type}`);
|
|
490
|
+
}
|
|
491
|
+
if (type === "regex" && source.pattern === undefined) {
|
|
492
|
+
throw new Error(`facts.version_sources[${index}].pattern is required for regex`);
|
|
493
|
+
}
|
|
494
|
+
if (type === "command" && source.command === undefined) {
|
|
495
|
+
throw new Error(`facts.version_sources[${index}].command is required for command`);
|
|
496
|
+
}
|
|
497
|
+
return {
|
|
498
|
+
id,
|
|
499
|
+
type,
|
|
500
|
+
value: source.value === undefined ? undefined : String(source.value),
|
|
501
|
+
path: source.path === undefined ? "" : posixPath(assertString(source.path, `facts.version_sources[${index}].path`)),
|
|
502
|
+
key: source.key === undefined ? "" : assertString(source.key, `facts.version_sources[${index}].key`),
|
|
503
|
+
pattern: source.pattern === undefined ? "" : assertString(source.pattern, `facts.version_sources[${index}].pattern`),
|
|
504
|
+
command: source.command === undefined ? "" : assertString(source.command, `facts.version_sources[${index}].command`),
|
|
505
|
+
trust: source.trust === undefined ? "" : assertString(source.trust, `facts.version_sources[${index}].trust`),
|
|
506
|
+
reproducible: optionalBoolean(source.reproducible, type !== "command"),
|
|
507
|
+
};
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function normalizeFactModules(modules = []) {
|
|
512
|
+
if (modules === undefined) {
|
|
513
|
+
return [];
|
|
514
|
+
}
|
|
515
|
+
if (!Array.isArray(modules)) {
|
|
516
|
+
throw new Error("facts.modules must be an array of tables");
|
|
517
|
+
}
|
|
518
|
+
return modules.map((module, index) => {
|
|
519
|
+
assertPlainObject(module, `facts.modules[${index}]`);
|
|
520
|
+
return {
|
|
521
|
+
id: assertString(module.id, `facts.modules[${index}].id`),
|
|
522
|
+
root: module.root === undefined ? "." : posixPath(assertString(module.root, `facts.modules[${index}].root`)),
|
|
523
|
+
scope: module.scope === undefined ? "" : assertString(module.scope, `facts.modules[${index}].scope`),
|
|
524
|
+
versionSource: module.version_source === undefined ? "" : assertString(module.version_source, `facts.modules[${index}].version_source`),
|
|
525
|
+
lifecycle: module.lifecycle === undefined ? "" : assertString(module.lifecycle, `facts.modules[${index}].lifecycle`),
|
|
526
|
+
outputs: normalizeStringArray(module.outputs, `facts.modules[${index}].outputs`).map(posixPath),
|
|
527
|
+
};
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function normalizeFactProducts(products = []) {
|
|
532
|
+
if (products === undefined) {
|
|
533
|
+
return [];
|
|
534
|
+
}
|
|
535
|
+
if (!Array.isArray(products)) {
|
|
536
|
+
throw new Error("facts.products must be an array of tables");
|
|
537
|
+
}
|
|
538
|
+
return products.map((product, index) => {
|
|
539
|
+
assertPlainObject(product, `facts.products[${index}]`);
|
|
540
|
+
return {
|
|
541
|
+
id: assertString(product.id, `facts.products[${index}].id`),
|
|
542
|
+
moduleFacts: normalizeStringArray(product.module_facts, `facts.products[${index}].module_facts`).map(posixPath),
|
|
543
|
+
artifacts: normalizeStringArray(product.artifacts, `facts.products[${index}].artifacts`).map(posixPath),
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function normalizeDiagnosticsSection(diagnostics) {
|
|
549
|
+
assertPlainObject(diagnostics, "diagnostics");
|
|
550
|
+
const normalized = { ...diagnostics };
|
|
551
|
+
if (diagnostics.native !== undefined) {
|
|
552
|
+
normalized.native = normalizeNativeDiagnosticsProfile(diagnostics.native);
|
|
553
|
+
}
|
|
554
|
+
return normalized;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function normalizeNativeDiagnosticsProfile(native) {
|
|
558
|
+
assertPlainObject(native, "diagnostics.native");
|
|
559
|
+
const compilerCache = native.compiler_cache === undefined
|
|
560
|
+
? "auto"
|
|
561
|
+
: assertString(native.compiler_cache, "diagnostics.native.compiler_cache");
|
|
562
|
+
if (!SUPPORTED_NATIVE_COMPILER_CACHE.has(compilerCache)) {
|
|
563
|
+
throw new Error("diagnostics.native.compiler_cache must be one of auto, ccache, sccache, or none");
|
|
564
|
+
}
|
|
565
|
+
return {
|
|
566
|
+
enabled: optionalBoolean(native.enabled, false),
|
|
567
|
+
sampleProcessTree: optionalBoolean(native.sample_process_tree, false),
|
|
568
|
+
compilerCache,
|
|
569
|
+
expectedTools: normalizeStringArray(native.expected_tools, "diagnostics.native.expected_tools"),
|
|
570
|
+
artifactDirs: normalizeStringArray(native.artifact_dirs, "diagnostics.native.artifact_dirs").map(posixPath),
|
|
571
|
+
cacheDirs: normalizeStringArray(native.cache_dirs, "diagnostics.native.cache_dirs").map(posixPath),
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export function getNativeDiagnosticsProfile(loadedConfig) {
|
|
576
|
+
return loadedConfig?.config?.diagnostics?.native || {
|
|
577
|
+
enabled: false,
|
|
578
|
+
sampleProcessTree: false,
|
|
579
|
+
compilerCache: "auto",
|
|
580
|
+
expectedTools: [],
|
|
581
|
+
artifactDirs: [],
|
|
582
|
+
cacheDirs: [],
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function normalizePublishSection(publish) {
|
|
587
|
+
assertPlainObject(publish, "publish");
|
|
588
|
+
const mode = publish.mode === undefined
|
|
589
|
+
? "publish-final-version"
|
|
590
|
+
: assertString(publish.mode, "publish.mode");
|
|
591
|
+
if (!SUPPORTED_PUBLISH_MODES.has(mode)) {
|
|
592
|
+
throw new Error("publish.mode must be one of publish-final-version or promote-existing-version");
|
|
593
|
+
}
|
|
594
|
+
const auth = publish.auth === undefined
|
|
595
|
+
? "trusted-publishing"
|
|
596
|
+
: assertString(publish.auth, "publish.auth");
|
|
597
|
+
if (!SUPPORTED_PUBLISH_AUTH.has(auth)) {
|
|
598
|
+
throw new Error("publish.auth must be one of trusted-publishing or npm-token");
|
|
599
|
+
}
|
|
600
|
+
if (mode === "promote-existing-version" && auth !== "npm-token") {
|
|
601
|
+
throw new Error('publish.mode = "promote-existing-version" requires publish.auth = "npm-token"');
|
|
602
|
+
}
|
|
603
|
+
const kind = publish.kind === undefined
|
|
604
|
+
? ""
|
|
605
|
+
: assertString(publish.kind, "publish.kind");
|
|
606
|
+
if (kind && !SUPPORTED_PUBLISH_KINDS.has(kind)) {
|
|
607
|
+
throw new Error("publish.kind must be one of npm-package or npm-paper-package");
|
|
608
|
+
}
|
|
609
|
+
const packageSetOrder = publish.package_set_order === undefined
|
|
610
|
+
? "as-provided"
|
|
611
|
+
: assertString(publish.package_set_order, "publish.package_set_order");
|
|
612
|
+
if (!SUPPORTED_PACKAGE_SET_ORDER.has(packageSetOrder)) {
|
|
613
|
+
throw new Error("publish.package_set_order must be one of as-provided or platforms-first-main-last");
|
|
614
|
+
}
|
|
615
|
+
const normalized = {
|
|
616
|
+
mode,
|
|
617
|
+
auth,
|
|
618
|
+
distTag: publish.dist_tag === undefined
|
|
619
|
+
? undefined
|
|
620
|
+
: assertString(publish.dist_tag, "publish.dist_tag"),
|
|
621
|
+
packageSetOrder,
|
|
622
|
+
mainPackage: publish.main_package === undefined
|
|
623
|
+
? ""
|
|
624
|
+
: assertString(publish.main_package, "publish.main_package"),
|
|
625
|
+
};
|
|
626
|
+
if (publish.shared_alpha_authority_major !== undefined) {
|
|
627
|
+
const sharedAlphaAuthorityMajor = Number(
|
|
628
|
+
publish.shared_alpha_authority_major,
|
|
629
|
+
);
|
|
630
|
+
if (
|
|
631
|
+
!Number.isSafeInteger(sharedAlphaAuthorityMajor) ||
|
|
632
|
+
sharedAlphaAuthorityMajor < 1
|
|
633
|
+
) {
|
|
634
|
+
throw new Error(
|
|
635
|
+
"publish.shared_alpha_authority_major must be a positive integer",
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
normalized.sharedAlphaAuthorityMajor = sharedAlphaAuthorityMajor;
|
|
639
|
+
}
|
|
640
|
+
if (publish.kind !== undefined) {
|
|
641
|
+
normalized.kind = kind;
|
|
642
|
+
}
|
|
643
|
+
if (publish.package !== undefined) {
|
|
644
|
+
normalized.package = assertString(publish.package, "publish.package");
|
|
645
|
+
}
|
|
646
|
+
return normalized;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function normalizeProjectSection(project) {
|
|
650
|
+
assertPlainObject(project, "project");
|
|
651
|
+
const type = assertString(project.type, "project.type");
|
|
652
|
+
if (!SUPPORTED_PROJECT_TYPES.has(type)) {
|
|
653
|
+
throw new Error("project.type must be one of package, web-surface, infra-contract, distribution-index, or publication-artifact");
|
|
654
|
+
}
|
|
655
|
+
const normalized = { type };
|
|
656
|
+
for (const key of ["name", "site"]) {
|
|
657
|
+
if (project[key] !== undefined) {
|
|
658
|
+
normalized[key] = assertString(project[key], `project.${key}`);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return normalized;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function normalizePublicationSection(publication) {
|
|
665
|
+
assertPlainObject(publication, "publication");
|
|
666
|
+
const kind = publication.kind === undefined ? "paper" : assertString(publication.kind, "publication.kind");
|
|
667
|
+
if (!["paper", "report", "specification", "article", "dataset-note"].includes(kind)) {
|
|
668
|
+
throw new Error("publication.kind must be one of paper, report, specification, article, or dataset-note");
|
|
669
|
+
}
|
|
670
|
+
const primaryArtifact = posixPath(assertString(publication.primary_artifact, "publication.primary_artifact"));
|
|
671
|
+
return {
|
|
672
|
+
kind,
|
|
673
|
+
title: assertString(publication.title, "publication.title"),
|
|
674
|
+
primaryArtifact,
|
|
675
|
+
version: publication.version === undefined ? "" : assertString(publication.version, "publication.version"),
|
|
676
|
+
abstract: publication.abstract === undefined ? "" : assertString(publication.abstract, "publication.abstract"),
|
|
677
|
+
authors: normalizeStringArray(publication.authors, "publication.authors"),
|
|
678
|
+
artifactPaths: normalizeStringArray(publication.artifact_paths, "publication.artifact_paths").map(posixPath),
|
|
679
|
+
metadataPaths: normalizeStringArray(publication.metadata_paths, "publication.metadata_paths").map(posixPath),
|
|
680
|
+
sourcePaths: normalizeStringArray(publication.source_paths, "publication.source_paths").map(posixPath),
|
|
681
|
+
siteConsumers: normalizeStringArray(publication.site_consumers, "publication.site_consumers"),
|
|
682
|
+
toolchain: normalizePublicationToolchain(publication.toolchain),
|
|
683
|
+
manifestPath: publication.manifest_path === undefined
|
|
684
|
+
? ".buildchain/publication/publication-artifact.json"
|
|
685
|
+
: posixPath(assertString(publication.manifest_path, "publication.manifest_path")),
|
|
686
|
+
sourceBundlePath: publication.source_bundle_path === undefined
|
|
687
|
+
? ".buildchain/publication/source.tar.gz"
|
|
688
|
+
: posixPath(assertString(publication.source_bundle_path, "publication.source_bundle_path")),
|
|
689
|
+
archive: normalizePublicationArchive(publication.archive),
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
function normalizePublicationRehearsalSection(rehearsal) {
|
|
694
|
+
assertPlainObject(rehearsal, "publication_rehearsal");
|
|
695
|
+
const allowed = ["contract", "capsule_path", "candidate_root", "state_path", "evidence_path", "effect_default"];
|
|
696
|
+
const unknown = Object.keys(rehearsal).filter((key) => !allowed.includes(key));
|
|
697
|
+
if (unknown.length > 0) {
|
|
698
|
+
throw new Error(`publication_rehearsal contains unsupported fields: ${unknown.join(", ")}`);
|
|
699
|
+
}
|
|
700
|
+
const normalized = {
|
|
701
|
+
contract: assertString(rehearsal.contract, "publication_rehearsal.contract"),
|
|
702
|
+
capsulePath: posixPath(assertString(rehearsal.capsule_path, "publication_rehearsal.capsule_path")),
|
|
703
|
+
candidateRoot: posixPath(assertString(rehearsal.candidate_root, "publication_rehearsal.candidate_root")),
|
|
704
|
+
statePath: posixPath(assertString(rehearsal.state_path, "publication_rehearsal.state_path")),
|
|
705
|
+
evidencePath: posixPath(assertString(rehearsal.evidence_path, "publication_rehearsal.evidence_path")),
|
|
706
|
+
effectDefault: assertString(rehearsal.effect_default, "publication_rehearsal.effect_default"),
|
|
707
|
+
};
|
|
708
|
+
if (
|
|
709
|
+
normalized.contract !== "buildchain-v4-publication-rehearsal-capsule/v1" ||
|
|
710
|
+
normalized.effectDefault !== "disabled"
|
|
711
|
+
) {
|
|
712
|
+
throw new Error("publication_rehearsal must use the v4 capsule contract with effect_default = disabled");
|
|
713
|
+
}
|
|
714
|
+
for (const [key, value] of Object.entries({
|
|
715
|
+
capsule_path: normalized.capsulePath,
|
|
716
|
+
candidate_root: normalized.candidateRoot,
|
|
717
|
+
state_path: normalized.statePath,
|
|
718
|
+
evidence_path: normalized.evidencePath,
|
|
719
|
+
})) {
|
|
720
|
+
if (value.startsWith("/") || value.includes("\\") || value.split("/").includes("..")) {
|
|
721
|
+
throw new Error(`publication_rehearsal.${key} must be repository-relative`);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return normalized;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function normalizePublicationArchive(archive = undefined) {
|
|
728
|
+
if (archive === undefined) {
|
|
729
|
+
return undefined;
|
|
730
|
+
}
|
|
731
|
+
assertPlainObject(archive, "publication.archive");
|
|
732
|
+
const immutableUrlPrefix = archive.immutable_url_prefix === undefined
|
|
733
|
+
? ""
|
|
734
|
+
: assertString(archive.immutable_url_prefix, "publication.archive.immutable_url_prefix");
|
|
735
|
+
const immutableBaseUrl = archive.immutable_base_url === undefined
|
|
736
|
+
? ""
|
|
737
|
+
: assertString(archive.immutable_base_url, "publication.archive.immutable_base_url");
|
|
738
|
+
if (!immutableUrlPrefix && !immutableBaseUrl) {
|
|
739
|
+
throw new Error("publication.archive requires immutable_url_prefix or immutable_base_url");
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
id: archive.id === undefined ? "" : assertString(archive.id, "publication.archive.id"),
|
|
743
|
+
canonicalUrl: assertString(archive.canonical_url, "publication.archive.canonical_url"),
|
|
744
|
+
latestUrl: archive.latest_url === undefined
|
|
745
|
+
? ""
|
|
746
|
+
: assertString(archive.latest_url, "publication.archive.latest_url"),
|
|
747
|
+
latestEvidenceUrl: archive.latest_evidence_url === undefined
|
|
748
|
+
? ""
|
|
749
|
+
: assertString(archive.latest_evidence_url, "publication.archive.latest_evidence_url"),
|
|
750
|
+
immutableBaseUrl,
|
|
751
|
+
immutableUrlPrefix,
|
|
752
|
+
artifactUrlPrefix: archive.artifact_url_prefix === undefined
|
|
753
|
+
? ""
|
|
754
|
+
: assertString(archive.artifact_url_prefix, "publication.archive.artifact_url_prefix"),
|
|
755
|
+
registryPath: archive.registry_path === undefined
|
|
756
|
+
? ".buildchain/publication/publication-registry.json"
|
|
757
|
+
: posixPath(assertString(archive.registry_path, "publication.archive.registry_path")),
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
function normalizePublicationToolchain(toolchain = undefined) {
|
|
762
|
+
if (toolchain === undefined) {
|
|
763
|
+
return {
|
|
764
|
+
type: "custom-command",
|
|
765
|
+
image: "",
|
|
766
|
+
digest: "",
|
|
767
|
+
command: "",
|
|
768
|
+
trustClassification: "custom-command",
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
assertPlainObject(toolchain, "publication.toolchain");
|
|
772
|
+
const type = toolchain.type === undefined
|
|
773
|
+
? "custom-command"
|
|
774
|
+
: assertString(toolchain.type, "publication.toolchain.type");
|
|
775
|
+
if (!SUPPORTED_PUBLICATION_TOOLCHAINS.has(type)) {
|
|
776
|
+
throw new Error("publication.toolchain.type must be one of custom-command or latex-docker");
|
|
777
|
+
}
|
|
778
|
+
const command = toolchain.command === undefined
|
|
779
|
+
? ""
|
|
780
|
+
: assertString(toolchain.command, "publication.toolchain.command");
|
|
781
|
+
const image = toolchain.image === undefined
|
|
782
|
+
? ""
|
|
783
|
+
: assertString(toolchain.image, "publication.toolchain.image");
|
|
784
|
+
const digest = toolchain.digest === undefined
|
|
785
|
+
? ""
|
|
786
|
+
: assertString(toolchain.digest, "publication.toolchain.digest");
|
|
787
|
+
if (type === "latex-docker") {
|
|
788
|
+
if (!image) throw new Error("publication.toolchain.image is required for latex-docker");
|
|
789
|
+
if (!digest) throw new Error("publication.toolchain.digest is required for latex-docker");
|
|
790
|
+
if (!/^sha256:[0-9a-f]{64}$/i.test(digest)) {
|
|
791
|
+
throw new Error("publication.toolchain.digest must be a sha256:<64 hex> image digest");
|
|
792
|
+
}
|
|
793
|
+
if (!command) throw new Error("publication.toolchain.command is required for latex-docker");
|
|
794
|
+
}
|
|
795
|
+
return {
|
|
796
|
+
type,
|
|
797
|
+
image,
|
|
798
|
+
digest,
|
|
799
|
+
command,
|
|
800
|
+
trustClassification: type === "latex-docker" ? "pinned-docker-toolchain" : "custom-command",
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
function normalizeInfraSection(infra) {
|
|
805
|
+
assertPlainObject(infra, "infra");
|
|
806
|
+
const adapter = assertString(infra.adapter, "infra.adapter");
|
|
807
|
+
if (!SUPPORTED_INFRA_ADAPTERS.has(adapter)) {
|
|
808
|
+
throw new Error(
|
|
809
|
+
"infra.adapter must be one of manual-observed, aws-cloudformation, terraform, opentofu, pulumi, aws-cdk, aws-cli, or custom-command",
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
const adoptionMode = infra.adoption_mode === undefined
|
|
813
|
+
? (adapter === "manual-observed" ? "manual-observed" : "validate-only")
|
|
814
|
+
: assertString(infra.adoption_mode, "infra.adoption_mode");
|
|
815
|
+
if (!SUPPORTED_INFRA_ADOPTION_MODES.has(adoptionMode)) {
|
|
816
|
+
throw new Error(
|
|
817
|
+
"infra.adoption_mode must be one of validate-only, plan-only, observe-only, manual-observed, import-planned, or managed-apply",
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
const applyMode = infra.apply === undefined
|
|
821
|
+
? "disabled"
|
|
822
|
+
: assertString(infra.apply, "infra.apply");
|
|
823
|
+
if (!SUPPORTED_INFRA_APPLY_MODES.has(applyMode)) {
|
|
824
|
+
throw new Error("infra.apply must be one of disabled, manual-approval, or environment-approval");
|
|
825
|
+
}
|
|
826
|
+
const normalized = {
|
|
827
|
+
adapter,
|
|
828
|
+
adoptionMode,
|
|
829
|
+
applyMode,
|
|
830
|
+
environment: infra.environment === undefined ? "" : assertString(infra.environment, "infra.environment"),
|
|
831
|
+
identityRef: infra.identity_ref === undefined ? "" : assertString(infra.identity_ref, "infra.identity_ref"),
|
|
832
|
+
desired: normalizeStringArray(infra.desired, "infra.desired").map(posixPath),
|
|
833
|
+
contract: normalizeStringArray(infra.contract, "infra.contract").map(posixPath),
|
|
834
|
+
secretRefs: normalizeStringArray(infra.secret_refs, "infra.secret_refs"),
|
|
835
|
+
};
|
|
836
|
+
if (infra.commands !== undefined) {
|
|
837
|
+
normalized.commands = normalizeInfraCommands(infra.commands);
|
|
838
|
+
}
|
|
839
|
+
assertNoInlineSecretValues(infra, "infra", new Set(["secret_refs", "commands"]));
|
|
840
|
+
return normalized;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
function normalizeInfraCommands(commands) {
|
|
844
|
+
assertPlainObject(commands, "infra.commands");
|
|
845
|
+
const normalized = {};
|
|
846
|
+
for (const stage of ["validate", "plan", "apply", "observe"]) {
|
|
847
|
+
if (commands[stage] !== undefined) {
|
|
848
|
+
normalized[stage] = assertString(commands[stage], `infra.commands.${stage}`);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return normalized;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
function normalizeConsumersSection(consumers) {
|
|
855
|
+
if (!Array.isArray(consumers)) {
|
|
856
|
+
throw new Error("consumers must be an array of tables");
|
|
857
|
+
}
|
|
858
|
+
return consumers.map((consumer, index) => normalizeConsumerConfig(consumer, index));
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
function normalizeConsumerConfig(consumer, index) {
|
|
862
|
+
assertPlainObject(consumer, `consumers[${index}]`);
|
|
863
|
+
return {
|
|
864
|
+
repo: assertString(consumer.repo, `consumers[${index}].repo`),
|
|
865
|
+
path: posixPath(assertString(consumer.path, `consumers[${index}].path`)),
|
|
866
|
+
source: posixPath(assertString(consumer.source, `consumers[${index}].source`)),
|
|
867
|
+
branch: consumer.branch === undefined ? "" : assertString(consumer.branch, `consumers[${index}].branch`),
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
function normalizeChannelsSection(channels) {
|
|
872
|
+
assertPlainObject(channels, "channels");
|
|
873
|
+
return Object.fromEntries(
|
|
874
|
+
Object.entries(channels).map(([name, channel]) => [
|
|
875
|
+
name,
|
|
876
|
+
normalizeChannelConfig(name, channel),
|
|
877
|
+
]),
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function normalizeChannelConfig(name, channel) {
|
|
882
|
+
assertPlainObject(channel, `channels.${name}`);
|
|
883
|
+
const hasUrl = channel.url !== undefined;
|
|
884
|
+
const hasUrlPattern = channel.url_pattern !== undefined;
|
|
885
|
+
if (hasUrl && hasUrlPattern) {
|
|
886
|
+
throw new Error(`channels.${name} must define only one of url or url_pattern`);
|
|
887
|
+
}
|
|
888
|
+
if (!hasUrl && !hasUrlPattern) {
|
|
889
|
+
throw new Error(`channels.${name} must define url or url_pattern`);
|
|
890
|
+
}
|
|
891
|
+
const visibility = channel.visibility === undefined
|
|
892
|
+
? defaultChannelVisibility(name)
|
|
893
|
+
: assertString(channel.visibility, `channels.${name}.visibility`);
|
|
894
|
+
if (!SUPPORTED_CHANNEL_VISIBILITY.has(visibility)) {
|
|
895
|
+
throw new Error(`channels.${name}.visibility must be one of ephemeral, protected, public, or internal`);
|
|
896
|
+
}
|
|
897
|
+
const accessControl = normalizeAccessControl(channel, name);
|
|
898
|
+
const edgeAuth = normalizeEdgeAuth(channel, name, accessControl);
|
|
899
|
+
const normalized = {
|
|
900
|
+
name,
|
|
901
|
+
visibility,
|
|
902
|
+
requiresAuth: optionalBoolean(channel.requires_auth, accessControl !== "none"),
|
|
903
|
+
requiresControlledAccess: accessControl !== "none",
|
|
904
|
+
noindex: optionalBoolean(channel.noindex, name !== "production"),
|
|
905
|
+
promotable: optionalBoolean(channel.promotable, name === "staging"),
|
|
906
|
+
canonical: optionalBoolean(channel.canonical, name === "production"),
|
|
907
|
+
accessControl,
|
|
908
|
+
edgeAuth,
|
|
909
|
+
};
|
|
910
|
+
if (hasUrl) {
|
|
911
|
+
normalized.url = assertString(channel.url, `channels.${name}.url`);
|
|
912
|
+
}
|
|
913
|
+
if (hasUrlPattern) {
|
|
914
|
+
normalized.urlPattern = assertString(channel.url_pattern, `channels.${name}.url_pattern`);
|
|
915
|
+
}
|
|
916
|
+
return normalized;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
function normalizeAccessControl(channel, name) {
|
|
920
|
+
if (channel.access_control !== undefined) {
|
|
921
|
+
const accessControl = assertString(channel.access_control, `channels.${name}.access_control`);
|
|
922
|
+
if (!SUPPORTED_ACCESS_CONTROL.has(accessControl)) {
|
|
923
|
+
throw new Error(`channels.${name}.access_control must be one of none, managed-network, edge-basic-auth, oidc, or app-auth`);
|
|
924
|
+
}
|
|
925
|
+
return accessControl;
|
|
926
|
+
}
|
|
927
|
+
if (name === "staging") {
|
|
928
|
+
return "edge-basic-auth";
|
|
929
|
+
}
|
|
930
|
+
if (name === "production") {
|
|
931
|
+
return "none";
|
|
932
|
+
}
|
|
933
|
+
return "none";
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function normalizeEdgeAuth(channel, name, accessControl) {
|
|
937
|
+
if (channel.edge_auth !== undefined) {
|
|
938
|
+
const edgeAuth = assertString(channel.edge_auth, `channels.${name}.edge_auth`);
|
|
939
|
+
if (!SUPPORTED_EDGE_AUTH.has(edgeAuth)) {
|
|
940
|
+
throw new Error(`channels.${name}.edge_auth must be one of none, cloudfront-basic-auth, oidc, or app-auth`);
|
|
941
|
+
}
|
|
942
|
+
return edgeAuth;
|
|
943
|
+
}
|
|
944
|
+
return accessControl === "edge-basic-auth"
|
|
945
|
+
? "cloudfront-basic-auth"
|
|
946
|
+
: "none";
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function defaultChannelVisibility(name) {
|
|
950
|
+
if (name === "preview") {
|
|
951
|
+
return "ephemeral";
|
|
952
|
+
}
|
|
953
|
+
if (name === "staging") {
|
|
954
|
+
return "protected";
|
|
955
|
+
}
|
|
956
|
+
if (name === "production") {
|
|
957
|
+
return "public";
|
|
958
|
+
}
|
|
959
|
+
return "internal";
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
function normalizeDeploySection(deploy) {
|
|
963
|
+
assertPlainObject(deploy, "deploy");
|
|
964
|
+
return Object.fromEntries(
|
|
965
|
+
Object.entries(deploy).map(([name, config]) => [
|
|
966
|
+
name,
|
|
967
|
+
normalizeDeployConfig(name, config),
|
|
968
|
+
]),
|
|
969
|
+
);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
function normalizeDeployConfig(name, config) {
|
|
973
|
+
assertPlainObject(config, `deploy.${name}`);
|
|
974
|
+
const adapter = assertString(config.adapter, `deploy.${name}.adapter`);
|
|
975
|
+
if (!SUPPORTED_DEPLOY_ADAPTERS.has(adapter)) {
|
|
976
|
+
throw new Error(`deploy.${name}.adapter must be one of aws-s3-cloudfront, aws-elastic-beanstalk, or aws-ecs-service`);
|
|
977
|
+
}
|
|
978
|
+
const directoryIndexRewrite = config.directory_index_rewrite === undefined
|
|
979
|
+
? "buildchain"
|
|
980
|
+
: assertString(config.directory_index_rewrite, `deploy.${name}.directory_index_rewrite`);
|
|
981
|
+
if (!SUPPORTED_DIRECTORY_INDEX_REWRITE.has(directoryIndexRewrite)) {
|
|
982
|
+
throw new Error(`deploy.${name}.directory_index_rewrite must be one of buildchain or external`);
|
|
983
|
+
}
|
|
984
|
+
const healthStrategy = config.health_strategy === undefined
|
|
985
|
+
? undefined
|
|
986
|
+
: assertString(config.health_strategy, `deploy.${name}.health_strategy`);
|
|
987
|
+
if (healthStrategy !== undefined && !SUPPORTED_HEALTH_STRATEGIES.has(healthStrategy)) {
|
|
988
|
+
throw new Error(`deploy.${name}.health_strategy must be one of http or s3-object`);
|
|
989
|
+
}
|
|
990
|
+
const cacheControl = normalizeWebSurfaceCacheControl(config, `deploy.${name}`);
|
|
991
|
+
const normalized = {
|
|
992
|
+
...config,
|
|
993
|
+
adapter,
|
|
994
|
+
directoryIndexRewrite,
|
|
995
|
+
healthStrategy,
|
|
996
|
+
cacheControl,
|
|
997
|
+
artifactPath: config.artifact_path === undefined
|
|
998
|
+
? undefined
|
|
999
|
+
: posixPath(assertString(config.artifact_path, `deploy.${name}.artifact_path`)),
|
|
1000
|
+
secretRefs: normalizeStringArray(config.secret_refs, `deploy.${name}.secret_refs`),
|
|
1001
|
+
surfaces: config.surfaces === undefined
|
|
1002
|
+
? undefined
|
|
1003
|
+
: normalizeDeploySurfaceOverrides(name, config.surfaces),
|
|
1004
|
+
};
|
|
1005
|
+
delete normalized.directory_index_rewrite;
|
|
1006
|
+
delete normalized.health_strategy;
|
|
1007
|
+
delete normalized.cache_control_default;
|
|
1008
|
+
delete normalized.cache_control_mutable;
|
|
1009
|
+
delete normalized.cache_control_immutable;
|
|
1010
|
+
delete normalized.artifact_path;
|
|
1011
|
+
delete normalized.secret_refs;
|
|
1012
|
+
if (normalized.healthStrategy === undefined) {
|
|
1013
|
+
delete normalized.healthStrategy;
|
|
1014
|
+
}
|
|
1015
|
+
if (normalized.cacheControl === undefined) {
|
|
1016
|
+
delete normalized.cacheControl;
|
|
1017
|
+
}
|
|
1018
|
+
if (normalized.surfaces === undefined) {
|
|
1019
|
+
delete normalized.surfaces;
|
|
1020
|
+
}
|
|
1021
|
+
assertNoInlineSecretValues(config, `deploy.${name}`, new Set(["secret_refs", "surfaces"]));
|
|
1022
|
+
return normalized;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
function normalizeWebSurfaceCacheControl(config, label) {
|
|
1026
|
+
const entries = [
|
|
1027
|
+
["default", "cache_control_default"],
|
|
1028
|
+
["mutable", "cache_control_mutable"],
|
|
1029
|
+
["immutable", "cache_control_immutable"],
|
|
1030
|
+
].flatMap(([normalizedKey, sourceKey]) => (
|
|
1031
|
+
config[sourceKey] === undefined
|
|
1032
|
+
? []
|
|
1033
|
+
: [[normalizedKey, assertString(config[sourceKey], `${label}.${sourceKey}`)]]
|
|
1034
|
+
));
|
|
1035
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
function normalizeDeploySurfaceOverrides(channelName, surfaces) {
|
|
1039
|
+
assertPlainObject(surfaces, `deploy.${channelName}.surfaces`);
|
|
1040
|
+
return Object.fromEntries(
|
|
1041
|
+
Object.entries(surfaces).map(([surfaceName, override]) => [
|
|
1042
|
+
surfaceName,
|
|
1043
|
+
normalizeDeploySurfaceOverride(channelName, surfaceName, override),
|
|
1044
|
+
]),
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
function normalizeDeploySurfaceOverride(channelName, surfaceName, override) {
|
|
1049
|
+
assertPlainObject(override, `deploy.${channelName}.surfaces.${surfaceName}`);
|
|
1050
|
+
const label = `deploy.${channelName}.surfaces.${surfaceName}`;
|
|
1051
|
+
const directoryIndexRewrite = override.directory_index_rewrite === undefined
|
|
1052
|
+
? undefined
|
|
1053
|
+
: assertString(override.directory_index_rewrite, `${label}.directory_index_rewrite`);
|
|
1054
|
+
if (directoryIndexRewrite !== undefined && !SUPPORTED_DIRECTORY_INDEX_REWRITE.has(directoryIndexRewrite)) {
|
|
1055
|
+
throw new Error(`${label}.directory_index_rewrite must be one of buildchain or external`);
|
|
1056
|
+
}
|
|
1057
|
+
const healthStrategy = override.health_strategy === undefined
|
|
1058
|
+
? undefined
|
|
1059
|
+
: assertString(override.health_strategy, `${label}.health_strategy`);
|
|
1060
|
+
if (healthStrategy !== undefined && !SUPPORTED_HEALTH_STRATEGIES.has(healthStrategy)) {
|
|
1061
|
+
throw new Error(`${label}.health_strategy must be one of http or s3-object`);
|
|
1062
|
+
}
|
|
1063
|
+
const cacheControl = normalizeWebSurfaceCacheControl(override, label);
|
|
1064
|
+
const normalized = {
|
|
1065
|
+
...override,
|
|
1066
|
+
directoryIndexRewrite,
|
|
1067
|
+
healthStrategy,
|
|
1068
|
+
cacheControl,
|
|
1069
|
+
artifactPath: override.artifact_path === undefined
|
|
1070
|
+
? undefined
|
|
1071
|
+
: posixPath(assertString(override.artifact_path, `${label}.artifact_path`)),
|
|
1072
|
+
originPath: override.origin_path === undefined
|
|
1073
|
+
? undefined
|
|
1074
|
+
: assertString(override.origin_path, `${label}.origin_path`),
|
|
1075
|
+
secretRefs: normalizeStringArray(override.secret_refs, `${label}.secret_refs`),
|
|
1076
|
+
};
|
|
1077
|
+
delete normalized.directory_index_rewrite;
|
|
1078
|
+
delete normalized.health_strategy;
|
|
1079
|
+
delete normalized.cache_control_default;
|
|
1080
|
+
delete normalized.cache_control_mutable;
|
|
1081
|
+
delete normalized.cache_control_immutable;
|
|
1082
|
+
delete normalized.artifact_path;
|
|
1083
|
+
delete normalized.origin_path;
|
|
1084
|
+
delete normalized.secret_refs;
|
|
1085
|
+
if (normalized.artifactPath === undefined) {
|
|
1086
|
+
delete normalized.artifactPath;
|
|
1087
|
+
}
|
|
1088
|
+
if (normalized.originPath === undefined) {
|
|
1089
|
+
delete normalized.originPath;
|
|
1090
|
+
}
|
|
1091
|
+
if (normalized.secretRefs.length === 0) {
|
|
1092
|
+
delete normalized.secretRefs;
|
|
1093
|
+
}
|
|
1094
|
+
if (normalized.directoryIndexRewrite === undefined) {
|
|
1095
|
+
delete normalized.directoryIndexRewrite;
|
|
1096
|
+
}
|
|
1097
|
+
if (normalized.healthStrategy === undefined) {
|
|
1098
|
+
delete normalized.healthStrategy;
|
|
1099
|
+
}
|
|
1100
|
+
if (normalized.cacheControl === undefined) {
|
|
1101
|
+
delete normalized.cacheControl;
|
|
1102
|
+
}
|
|
1103
|
+
assertNoInlineSecretValues(override, label, new Set(["secret_refs"]));
|
|
1104
|
+
return normalized;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
function assertNoInlineSecretValues(config, label, ignoredKeys = new Set()) {
|
|
1108
|
+
for (const [key, value] of Object.entries(config)) {
|
|
1109
|
+
if (ignoredKeys.has(key) || key.endsWith("_ref") || key.endsWith("_refs")) {
|
|
1110
|
+
continue;
|
|
1111
|
+
}
|
|
1112
|
+
if (/(secret|token|password)/i.test(key) && value !== undefined) {
|
|
1113
|
+
throw new Error(`${label}.${key} must be declared as a secret reference, not a secret value`);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
function normalizeSurfacesSection(surfaces) {
|
|
1119
|
+
assertPlainObject(surfaces, "surfaces");
|
|
1120
|
+
const entries = Object.entries(surfaces);
|
|
1121
|
+
if (entries.length === 0) {
|
|
1122
|
+
throw new Error("surfaces must declare at least one surface");
|
|
1123
|
+
}
|
|
1124
|
+
return Object.fromEntries(
|
|
1125
|
+
entries.map(([name, surface]) => [
|
|
1126
|
+
name,
|
|
1127
|
+
normalizeSurfaceConfig(name, surface),
|
|
1128
|
+
]),
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function normalizeSurfaceConfig(name, surface) {
|
|
1133
|
+
assertPlainObject(surface, `surfaces.${name}`);
|
|
1134
|
+
const normalized = {
|
|
1135
|
+
name,
|
|
1136
|
+
path: surface.path === undefined
|
|
1137
|
+
? "/"
|
|
1138
|
+
: normalizeSurfacePath(assertString(surface.path, `surfaces.${name}.path`)),
|
|
1139
|
+
pathOnly: optionalBoolean(surface.path_only, false),
|
|
1140
|
+
canonical: optionalBoolean(surface.canonical, name === "default" || name === "hub"),
|
|
1141
|
+
};
|
|
1142
|
+
if (surface.preview_url_pattern !== undefined) {
|
|
1143
|
+
normalized.previewUrlPattern = assertString(surface.preview_url_pattern, `surfaces.${name}.preview_url_pattern`);
|
|
1144
|
+
}
|
|
1145
|
+
if (surface.staging_url !== undefined) {
|
|
1146
|
+
normalized.stagingUrl = assertString(surface.staging_url, `surfaces.${name}.staging_url`);
|
|
1147
|
+
}
|
|
1148
|
+
if (surface.production_url !== undefined) {
|
|
1149
|
+
normalized.productionUrl = assertString(surface.production_url, `surfaces.${name}.production_url`);
|
|
1150
|
+
}
|
|
1151
|
+
return normalized;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
function normalizeSurfacePath(value) {
|
|
1155
|
+
const normalized = `/${String(value).replace(/^\/+/, "")}`.replace(/\/{2,}/g, "/");
|
|
1156
|
+
if (normalized === "/") {
|
|
1157
|
+
return normalized;
|
|
1158
|
+
}
|
|
1159
|
+
return normalized.endsWith("/") ? normalized : `${normalized}/`;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
function normalizeRetentionSection(retention) {
|
|
1163
|
+
assertPlainObject(retention, "retention");
|
|
1164
|
+
return Object.fromEntries(
|
|
1165
|
+
Object.entries(retention).map(([name, config]) => [
|
|
1166
|
+
name,
|
|
1167
|
+
normalizeRetentionConfig(name, config),
|
|
1168
|
+
]),
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
function normalizeRetentionConfig(name, config) {
|
|
1173
|
+
assertPlainObject(config, `retention.${name}`);
|
|
1174
|
+
const normalized = {};
|
|
1175
|
+
for (const [key, value] of Object.entries(config)) {
|
|
1176
|
+
const numberValue = Number(value);
|
|
1177
|
+
if (!Number.isInteger(numberValue) || numberValue < 0) {
|
|
1178
|
+
throw new Error(`retention.${name}.${key} must be a non-negative integer`);
|
|
1179
|
+
}
|
|
1180
|
+
normalized[key] = numberValue;
|
|
1181
|
+
}
|
|
1182
|
+
return normalized;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
function normalizeSecuritySection(security) {
|
|
1186
|
+
assertPlainObject(security, "security");
|
|
1187
|
+
return Object.fromEntries(
|
|
1188
|
+
Object.entries(security).map(([name, config]) => [
|
|
1189
|
+
name,
|
|
1190
|
+
normalizeSecurityConfig(name, config),
|
|
1191
|
+
]),
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
function normalizeSecurityConfig(name, config) {
|
|
1196
|
+
assertPlainObject(config, `security.${name}`);
|
|
1197
|
+
return {
|
|
1198
|
+
requiresAuth: optionalBoolean(config.requires_auth, undefined),
|
|
1199
|
+
noindex: optionalBoolean(config.noindex, undefined),
|
|
1200
|
+
isolatedProviders: optionalBoolean(config.isolated_providers, undefined),
|
|
1201
|
+
sandboxData: optionalBoolean(config.sandbox_data, undefined),
|
|
1202
|
+
secretRefs: normalizeStringArray(config.secret_refs, `security.${name}.secret_refs`),
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
function validateWebSurfaceConfig(config) {
|
|
1207
|
+
if (config.project?.type !== "web-surface") {
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
for (const name of WEB_SURFACE_CHANNELS) {
|
|
1211
|
+
if (!config.channels?.[name]) {
|
|
1212
|
+
throw new Error(`project.type = "web-surface" requires channels.${name}`);
|
|
1213
|
+
}
|
|
1214
|
+
if (!config.deploy?.[name]) {
|
|
1215
|
+
throw new Error(`project.type = "web-surface" requires deploy.${name}`);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
if (!config.channels.preview.urlPattern) {
|
|
1219
|
+
throw new Error("channels.preview.url_pattern is required for web-surface preview aliases");
|
|
1220
|
+
}
|
|
1221
|
+
for (const name of ["staging", "production"]) {
|
|
1222
|
+
if (!config.channels[name].url) {
|
|
1223
|
+
throw new Error(`channels.${name}.url is required for web-surface`);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
if (config.channels.staging.visibility === "public") {
|
|
1227
|
+
throw new Error("channels.staging.visibility must not be public for web-surface");
|
|
1228
|
+
}
|
|
1229
|
+
if (config.channels.staging.accessControl === "none") {
|
|
1230
|
+
throw new Error("channels.staging.access_control must protect staging for web-surface");
|
|
1231
|
+
}
|
|
1232
|
+
if (config.channels.staging.accessControl === "edge-basic-auth" && config.channels.staging.edgeAuth === "none") {
|
|
1233
|
+
throw new Error("channels.staging.edge_auth must not be none when access_control = edge-basic-auth");
|
|
1234
|
+
}
|
|
1235
|
+
if (!config.channels.staging.noindex) {
|
|
1236
|
+
throw new Error("channels.staging.noindex must be true for web-surface");
|
|
1237
|
+
}
|
|
1238
|
+
const stagingSecurity = config.security?.staging;
|
|
1239
|
+
if (stagingSecurity) {
|
|
1240
|
+
if (stagingSecurity.noindex === false) {
|
|
1241
|
+
throw new Error("security.staging.noindex must not disable staging noindex");
|
|
1242
|
+
}
|
|
1243
|
+
if (stagingSecurity.isolatedProviders === false) {
|
|
1244
|
+
throw new Error("security.staging.isolated_providers must not be false for web-surface");
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
validateWebSurfaceSurfaces(config);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
function validateInfraContractConfig(config) {
|
|
1251
|
+
if (config.project?.type !== "infra-contract") {
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
if (!config.infra) {
|
|
1255
|
+
throw new Error('project.type = "infra-contract" requires [infra]');
|
|
1256
|
+
}
|
|
1257
|
+
if (config.infra.desired.length === 0) {
|
|
1258
|
+
throw new Error('project.type = "infra-contract" requires infra.desired');
|
|
1259
|
+
}
|
|
1260
|
+
if (config.infra.contract.length === 0) {
|
|
1261
|
+
throw new Error('project.type = "infra-contract" requires infra.contract');
|
|
1262
|
+
}
|
|
1263
|
+
if (!Array.isArray(config.consumers) || config.consumers.length === 0) {
|
|
1264
|
+
throw new Error('project.type = "infra-contract" requires at least one [[consumers]] entry');
|
|
1265
|
+
}
|
|
1266
|
+
if (config.infra.applyMode !== "disabled" && config.infra.adoptionMode !== "managed-apply") {
|
|
1267
|
+
throw new Error("infra.apply requires infra.adoption_mode = managed-apply");
|
|
1268
|
+
}
|
|
1269
|
+
if (config.infra.applyMode !== "disabled" && !config.infra.environment) {
|
|
1270
|
+
throw new Error("infra.apply requires infra.environment");
|
|
1271
|
+
}
|
|
1272
|
+
if (config.infra.applyMode !== "disabled" && !config.infra.identityRef) {
|
|
1273
|
+
throw new Error("infra.apply requires infra.identity_ref");
|
|
1274
|
+
}
|
|
1275
|
+
if (config.infra.adapter === "manual-observed" && config.infra.applyMode !== "disabled") {
|
|
1276
|
+
throw new Error('infra.adapter = "manual-observed" requires infra.apply = "disabled"');
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
function validateAnchoredDerivedVersionMaterialConfig(config) {
|
|
1281
|
+
const derivedFiles = config.version?.derivedFiles || [];
|
|
1282
|
+
if (derivedFiles.length === 0) {
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
const versionState =
|
|
1286
|
+
config.lifecycle?.["version-state"];
|
|
1287
|
+
if (!versionState) {
|
|
1288
|
+
throw new Error(
|
|
1289
|
+
"version.derived_files requires lifecycle.version-state to regenerate declared material",
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
if (!config.lifecycle?.verify) {
|
|
1293
|
+
throw new Error(
|
|
1294
|
+
"version.derived_files requires lifecycle.verify to validate regenerated material",
|
|
1295
|
+
);
|
|
1296
|
+
}
|
|
1297
|
+
const versionPaths = new Set((config.version.files || []).map((file) => file.path));
|
|
1298
|
+
if (config.version.manifest) {
|
|
1299
|
+
versionPaths.add(config.version.manifest);
|
|
1300
|
+
}
|
|
1301
|
+
for (const filePath of derivedFiles) {
|
|
1302
|
+
if (versionPaths.has(filePath)) {
|
|
1303
|
+
throw new Error(
|
|
1304
|
+
`version.derived_files must not repeat version.files or version.manifest: ${filePath}`,
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
function validateWebSurfaceSurfaces(config) {
|
|
1311
|
+
const surfaces = config.surfaces || {};
|
|
1312
|
+
for (const [name, surface] of Object.entries(surfaces)) {
|
|
1313
|
+
if (!surface.pathOnly && !surface.previewUrlPattern) {
|
|
1314
|
+
throw new Error(`surfaces.${name}.preview_url_pattern is required unless path_only = true`);
|
|
1315
|
+
}
|
|
1316
|
+
if (!surface.pathOnly && !surface.stagingUrl) {
|
|
1317
|
+
throw new Error(`surfaces.${name}.staging_url is required unless path_only = true`);
|
|
1318
|
+
}
|
|
1319
|
+
if (!surface.pathOnly && !surface.productionUrl) {
|
|
1320
|
+
throw new Error(`surfaces.${name}.production_url is required unless path_only = true`);
|
|
1321
|
+
}
|
|
1322
|
+
if (surface.productionUrl && !surface.pathOnly && !surface.stagingUrl) {
|
|
1323
|
+
throw new Error(`surfaces.${name}.staging_url is required when production_url declares a first-class host`);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
function normalizeVersionSection(version) {
|
|
1329
|
+
assertPlainObject(version, "version");
|
|
1330
|
+
const files = version.files === undefined ? [] : version.files;
|
|
1331
|
+
if (!Array.isArray(files)) {
|
|
1332
|
+
throw new Error("version.files must be an array of tables");
|
|
1333
|
+
}
|
|
1334
|
+
const strategy = version.strategy === undefined
|
|
1335
|
+
? "semver"
|
|
1336
|
+
: assertString(version.strategy, "version.strategy");
|
|
1337
|
+
if (!SUPPORTED_VERSION_STRATEGIES.has(strategy)) {
|
|
1338
|
+
throw new Error("version.strategy must be one of semver or anchored");
|
|
1339
|
+
}
|
|
1340
|
+
const next = version.next === undefined
|
|
1341
|
+
? "auto"
|
|
1342
|
+
: assertString(version.next, "version.next");
|
|
1343
|
+
if (!SUPPORTED_VERSION_NEXT.has(next)) {
|
|
1344
|
+
throw new Error("version.next must be one of auto or manual");
|
|
1345
|
+
}
|
|
1346
|
+
if (strategy === "semver" && next !== "auto") {
|
|
1347
|
+
throw new Error('version.next = "manual" requires version.strategy = "anchored"');
|
|
1348
|
+
}
|
|
1349
|
+
if (strategy === "anchored" && next !== "manual") {
|
|
1350
|
+
throw new Error('version.strategy = "anchored" requires version.next = "manual"');
|
|
1351
|
+
}
|
|
1352
|
+
const derivedFiles = normalizeStringArray(
|
|
1353
|
+
version.derived_files,
|
|
1354
|
+
"version.derived_files",
|
|
1355
|
+
).map((filePath) => posixPath(filePath));
|
|
1356
|
+
if (new Set(derivedFiles).size !== derivedFiles.length) {
|
|
1357
|
+
throw new Error("version.derived_files must not contain duplicate paths");
|
|
1358
|
+
}
|
|
1359
|
+
return {
|
|
1360
|
+
required: version.required === undefined ? false : Boolean(version.required),
|
|
1361
|
+
strategy,
|
|
1362
|
+
next,
|
|
1363
|
+
manifest: version.manifest === undefined
|
|
1364
|
+
? undefined
|
|
1365
|
+
: posixPath(assertString(version.manifest, "version.manifest")),
|
|
1366
|
+
files: files.map((file, index) => normalizeVersionFile(file, index)),
|
|
1367
|
+
derivedFiles,
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
function normalizeVersionFile(file, index) {
|
|
1372
|
+
assertPlainObject(file, `version.files[${index}]`);
|
|
1373
|
+
const type = assertString(file.type, `version.files[${index}].type`);
|
|
1374
|
+
if (!SUPPORTED_VERSION_FILE_TYPES.has(type)) {
|
|
1375
|
+
throw new Error(`version.files[${index}].type must be one of json, toml, or regex`);
|
|
1376
|
+
}
|
|
1377
|
+
const normalized = {
|
|
1378
|
+
type,
|
|
1379
|
+
path: posixPath(assertString(file.path, `version.files[${index}].path`)),
|
|
1380
|
+
};
|
|
1381
|
+
if (type === "json" || type === "toml") {
|
|
1382
|
+
normalized.key = assertString(file.key, `version.files[${index}].key`);
|
|
1383
|
+
}
|
|
1384
|
+
if (type === "regex") {
|
|
1385
|
+
normalized.pattern = assertString(file.pattern, `version.files[${index}].pattern`);
|
|
1386
|
+
normalized.replacement = assertString(file.replacement, `version.files[${index}].replacement`);
|
|
1387
|
+
}
|
|
1388
|
+
return normalized;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
function normalizeLifecycleSection(lifecycle) {
|
|
1392
|
+
assertPlainObject(lifecycle, "lifecycle");
|
|
1393
|
+
const normalized = {};
|
|
1394
|
+
if (lifecycle.shell !== undefined) {
|
|
1395
|
+
normalized.shell = assertString(lifecycle.shell, "lifecycle.shell");
|
|
1396
|
+
}
|
|
1397
|
+
if (lifecycle.env !== undefined) {
|
|
1398
|
+
normalized.env = normalizeEnv(lifecycle.env, "lifecycle.env");
|
|
1399
|
+
}
|
|
1400
|
+
for (const [name, value] of Object.entries(lifecycle)) {
|
|
1401
|
+
if (!/^[a-z][a-z0-9-]*$/.test(name)) throw new Error(`unsupported lifecycle stage name: ${name}`);
|
|
1402
|
+
if (RESERVED_LIFECYCLE_KEYS.has(name)) {
|
|
1403
|
+
continue;
|
|
1404
|
+
}
|
|
1405
|
+
normalized[name] = normalizeLifecycleStage(value, `lifecycle.${name}`, normalized);
|
|
1406
|
+
}
|
|
1407
|
+
return normalized;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
function normalizeEnv(env, label) {
|
|
1411
|
+
assertPlainObject(env, label);
|
|
1412
|
+
return Object.fromEntries(
|
|
1413
|
+
Object.entries(env).map(([key, value]) => [key, String(value)]),
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
export function normalizeLifecycleStage(stage, label = "lifecycle stage", lifecycle = {}) {
|
|
1418
|
+
assertPlainObject(stage, label);
|
|
1419
|
+
const hasCommand = stage.command !== undefined;
|
|
1420
|
+
const hasCommands = stage.commands !== undefined;
|
|
1421
|
+
const hasScript = stage.script !== undefined;
|
|
1422
|
+
const modeCount = [hasCommand, hasCommands, hasScript].filter(Boolean).length;
|
|
1423
|
+
if (modeCount !== 1) {
|
|
1424
|
+
throw new Error(`${label} must define exactly one of command, commands, or script`);
|
|
1425
|
+
}
|
|
1426
|
+
const normalized = {
|
|
1427
|
+
shell: stage.shell === undefined ? lifecycle.shell : assertString(stage.shell, `${label}.shell`),
|
|
1428
|
+
env: stage.env === undefined ? undefined : normalizeEnv(stage.env, `${label}.env`),
|
|
1429
|
+
timeoutMinutes: stage.timeout_minutes === undefined ? undefined : Number(stage.timeout_minutes),
|
|
1430
|
+
retries: stage.retries === undefined ? 1 : Number(stage.retries),
|
|
1431
|
+
};
|
|
1432
|
+
if (normalized.timeoutMinutes !== undefined && (!Number.isFinite(normalized.timeoutMinutes) || normalized.timeoutMinutes <= 0)) {
|
|
1433
|
+
throw new Error(`${label}.timeout_minutes must be a positive number`);
|
|
1434
|
+
}
|
|
1435
|
+
if (!Number.isInteger(normalized.retries) || normalized.retries < 1) {
|
|
1436
|
+
throw new Error(`${label}.retries must be a positive integer`);
|
|
1437
|
+
}
|
|
1438
|
+
if (hasCommand) {
|
|
1439
|
+
normalized.commands = [assertString(stage.command, `${label}.command`)];
|
|
1440
|
+
normalized.mode = "command";
|
|
1441
|
+
} else if (hasCommands) {
|
|
1442
|
+
if (!Array.isArray(stage.commands) || stage.commands.length === 0) {
|
|
1443
|
+
throw new Error(`${label}.commands must be a non-empty array`);
|
|
1444
|
+
}
|
|
1445
|
+
normalized.commands = stage.commands.map((command, index) =>
|
|
1446
|
+
assertString(command, `${label}.commands[${index}]`),
|
|
1447
|
+
);
|
|
1448
|
+
normalized.mode = "commands";
|
|
1449
|
+
} else {
|
|
1450
|
+
normalized.script = assertString(stage.script, `${label}.script`);
|
|
1451
|
+
normalized.mode = "script";
|
|
1452
|
+
}
|
|
1453
|
+
return normalized;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
export function getLifecycleStage(loadedConfig, name) {
|
|
1457
|
+
return loadedConfig?.config?.lifecycle?.[name];
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
export function getPublishContract(loadedConfig) {
|
|
1461
|
+
return loadedConfig?.config?.publish;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
export function runLifecycleStage({ cwd = process.cwd(), loadedConfig, name, stage, env: extraEnv, baseEnv = process.env, timeoutMinutes }) {
|
|
1465
|
+
const lifecycle = loadedConfig?.config?.lifecycle || {};
|
|
1466
|
+
const selected = stage || getLifecycleStage(loadedConfig, name);
|
|
1467
|
+
if (!selected) {
|
|
1468
|
+
return false;
|
|
1469
|
+
}
|
|
1470
|
+
const env = {
|
|
1471
|
+
...baseEnv,
|
|
1472
|
+
...(lifecycle.env || {}),
|
|
1473
|
+
...(selected.env || {}),
|
|
1474
|
+
...(extraEnv || {}),
|
|
1475
|
+
};
|
|
1476
|
+
const effectiveTimeoutMinutes = selected.timeoutMinutes ?? timeoutMinutes;
|
|
1477
|
+
if (effectiveTimeoutMinutes !== undefined && (!Number.isFinite(effectiveTimeoutMinutes) || effectiveTimeoutMinutes <= 0)) {
|
|
1478
|
+
throw new Error("lifecycle timeoutMinutes must be a positive number");
|
|
1479
|
+
}
|
|
1480
|
+
const timeout = effectiveTimeoutMinutes ? effectiveTimeoutMinutes * 60_000 : undefined;
|
|
1481
|
+
const execOptions = {
|
|
1482
|
+
cwd,
|
|
1483
|
+
env,
|
|
1484
|
+
stdio: "inherit",
|
|
1485
|
+
shell: selected.shell || true,
|
|
1486
|
+
timeout,
|
|
1487
|
+
};
|
|
1488
|
+
const runOnce = () => {
|
|
1489
|
+
if (selected.mode === "script") {
|
|
1490
|
+
runShellCommandSync(selected.script, execOptions);
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
for (const command of selected.commands) {
|
|
1494
|
+
runShellCommandSync(command, execOptions);
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
let lastError;
|
|
1498
|
+
for (let attempt = 1; attempt <= selected.retries; attempt += 1) {
|
|
1499
|
+
try {
|
|
1500
|
+
runOnce();
|
|
1501
|
+
return true;
|
|
1502
|
+
} catch (error) {
|
|
1503
|
+
lastError = error;
|
|
1504
|
+
if (attempt < selected.retries) {
|
|
1505
|
+
console.log(`> lifecycle ${name || "stage"} failed, retry ${attempt + 1}/${selected.retries}`);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
throw lastError;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
export function discoverConfiguredVersionStateFiles(cwd = process.cwd(), loadedConfig = loadBuildchainConfig(cwd)) {
|
|
1513
|
+
const configured = loadedConfig?.config?.version?.files || [];
|
|
1514
|
+
const files = configured.map((entry) => {
|
|
1515
|
+
const filePath = path.join(cwd, entry.path);
|
|
1516
|
+
if (!fs.existsSync(filePath)) {
|
|
1517
|
+
throw new Error(`Configured version file does not exist: ${entry.path}`);
|
|
1518
|
+
}
|
|
1519
|
+
const source = fs.readFileSync(filePath, "utf8");
|
|
1520
|
+
const file = { ...entry, source };
|
|
1521
|
+
if (entry.type === "json") {
|
|
1522
|
+
const content = JSON.parse(source);
|
|
1523
|
+
if (typeof getByDottedKey(content, entry.key) !== "string") {
|
|
1524
|
+
throw new Error(`Configured JSON version key is missing or not a string: ${entry.path}:${entry.key}`);
|
|
1525
|
+
}
|
|
1526
|
+
return { ...file, content };
|
|
1527
|
+
}
|
|
1528
|
+
if (entry.type === "toml") {
|
|
1529
|
+
const content = parse(source);
|
|
1530
|
+
if (typeof getByDottedKey(content, entry.key) !== "string") {
|
|
1531
|
+
throw new Error(`Configured TOML version key is missing or not a string: ${entry.path}:${entry.key}`);
|
|
1532
|
+
}
|
|
1533
|
+
return { ...file, content };
|
|
1534
|
+
}
|
|
1535
|
+
const pattern = new RegExp(entry.pattern, "m");
|
|
1536
|
+
const match = source.match(pattern);
|
|
1537
|
+
if (!match) {
|
|
1538
|
+
throw new Error(`Configured regex version pattern did not match: ${entry.path}`);
|
|
1539
|
+
}
|
|
1540
|
+
if (typeof match.groups?.version !== "string") {
|
|
1541
|
+
throw new Error(`Configured regex version pattern must define a named capture group called version: ${entry.path}`);
|
|
1542
|
+
}
|
|
1543
|
+
return { ...file, pattern };
|
|
1544
|
+
});
|
|
1545
|
+
if (loadedConfig?.config?.version?.required && files.length === 0) {
|
|
1546
|
+
throw new Error("version.required is true but no version.files are configured");
|
|
1547
|
+
}
|
|
1548
|
+
return files;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
export function discoverConfiguredDerivedVersionMaterial(
|
|
1552
|
+
cwd = process.cwd(),
|
|
1553
|
+
loadedConfig = loadBuildchainConfig(cwd),
|
|
1554
|
+
) {
|
|
1555
|
+
const configured = loadedConfig?.config?.version?.derivedFiles || [];
|
|
1556
|
+
return configured.map((filePath) => {
|
|
1557
|
+
const absolutePath = path.join(cwd, filePath);
|
|
1558
|
+
if (!fs.existsSync(absolutePath)) {
|
|
1559
|
+
throw new Error(`Configured derived version material does not exist: ${filePath}`);
|
|
1560
|
+
}
|
|
1561
|
+
if (!fs.statSync(absolutePath).isFile()) {
|
|
1562
|
+
throw new Error(`Configured derived version material must be a file: ${filePath}`);
|
|
1563
|
+
}
|
|
1564
|
+
return {
|
|
1565
|
+
path: filePath,
|
|
1566
|
+
filePath: absolutePath,
|
|
1567
|
+
content: fs.readFileSync(absolutePath),
|
|
1568
|
+
};
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
function summarizeManifestFields(content) {
|
|
1573
|
+
assertPlainObject(content, "version.manifest content");
|
|
1574
|
+
return Object.fromEntries(
|
|
1575
|
+
Object.entries(content).map(([key, value]) => {
|
|
1576
|
+
if (value === null || ["string", "number", "boolean"].includes(typeof value)) {
|
|
1577
|
+
return [key, value];
|
|
1578
|
+
}
|
|
1579
|
+
return [key, JSON.stringify(value)];
|
|
1580
|
+
}),
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
export function getVersionStrategy(loadedConfig) {
|
|
1585
|
+
const version = loadedConfig?.config?.version;
|
|
1586
|
+
return {
|
|
1587
|
+
strategy: version?.strategy || "semver",
|
|
1588
|
+
next: version?.next || "auto",
|
|
1589
|
+
manifest: version?.manifest,
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
export function loadConfiguredAnchorManifest(cwd = process.cwd(), loadedConfig = loadBuildchainConfig(cwd)) {
|
|
1594
|
+
const manifest = loadedConfig?.config?.version?.manifest;
|
|
1595
|
+
if (!manifest) {
|
|
1596
|
+
return undefined;
|
|
1597
|
+
}
|
|
1598
|
+
const filePath = path.join(cwd, manifest);
|
|
1599
|
+
if (!fs.existsSync(filePath)) {
|
|
1600
|
+
throw new Error(`Configured anchor manifest does not exist: ${manifest}`);
|
|
1601
|
+
}
|
|
1602
|
+
const source = fs.readFileSync(filePath, "utf8");
|
|
1603
|
+
let content;
|
|
1604
|
+
if (manifest.endsWith(".json")) {
|
|
1605
|
+
content = JSON.parse(source);
|
|
1606
|
+
} else if (manifest.endsWith(".toml")) {
|
|
1607
|
+
content = parse(source);
|
|
1608
|
+
} else {
|
|
1609
|
+
throw new Error("version.manifest must point to a .json or .toml file");
|
|
1610
|
+
}
|
|
1611
|
+
return {
|
|
1612
|
+
path: manifest,
|
|
1613
|
+
filePath,
|
|
1614
|
+
fields: summarizeManifestFields(content),
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
function configuredLifecycleStages(loadedConfig) {
|
|
1619
|
+
const lifecycle = loadedConfig?.config?.lifecycle || {};
|
|
1620
|
+
return Object.entries(lifecycle)
|
|
1621
|
+
.filter(([, stage]) => stage && typeof stage === "object" && typeof stage.mode === "string")
|
|
1622
|
+
.map(([name, stage]) => ({
|
|
1623
|
+
name,
|
|
1624
|
+
mode: stage.mode,
|
|
1625
|
+
timeoutMinutes: stage.timeoutMinutes,
|
|
1626
|
+
retries: stage.retries,
|
|
1627
|
+
commandCount: stage.mode === "script" ? 1 : stage.commands.length,
|
|
1628
|
+
}));
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
export function validateBuildchainConfig(
|
|
1632
|
+
cwd = process.cwd(),
|
|
1633
|
+
{
|
|
1634
|
+
requireConfig = true,
|
|
1635
|
+
requireVersionState = false,
|
|
1636
|
+
requireLifecycleStages = [],
|
|
1637
|
+
} = {},
|
|
1638
|
+
) {
|
|
1639
|
+
const loadedConfig = loadBuildchainConfig(cwd);
|
|
1640
|
+
if (!loadedConfig) {
|
|
1641
|
+
if (requireConfig) {
|
|
1642
|
+
throw new Error(`${CONFIG_FILE} is required`);
|
|
1643
|
+
}
|
|
1644
|
+
return {
|
|
1645
|
+
config: undefined,
|
|
1646
|
+
versionFiles: [],
|
|
1647
|
+
lifecycleStages: [],
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
const versionFiles = loadedConfig.config.version
|
|
1652
|
+
? discoverConfiguredVersionStateFiles(cwd, loadedConfig)
|
|
1653
|
+
: [];
|
|
1654
|
+
const anchorManifest = loadConfiguredAnchorManifest(cwd, loadedConfig);
|
|
1655
|
+
if (requireVersionState && versionFiles.length === 0) {
|
|
1656
|
+
throw new Error("version state is required but no version.files are configured");
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
const lifecycleStages = configuredLifecycleStages(loadedConfig);
|
|
1660
|
+
const stageNames = new Set(lifecycleStages.map((stage) => stage.name));
|
|
1661
|
+
const missingStages = requireLifecycleStages.filter((stage) => !stageNames.has(stage));
|
|
1662
|
+
if (missingStages.length > 0) {
|
|
1663
|
+
throw new Error(`required lifecycle stage missing: ${missingStages.join(", ")}`);
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
return {
|
|
1667
|
+
config: {
|
|
1668
|
+
path: loadedConfig.path,
|
|
1669
|
+
filePath: loadedConfig.filePath,
|
|
1670
|
+
schema: loadedConfig.config.schema,
|
|
1671
|
+
},
|
|
1672
|
+
project: loadedConfig.config.project,
|
|
1673
|
+
channels: loadedConfig.config.channels
|
|
1674
|
+
? Object.fromEntries(
|
|
1675
|
+
Object.entries(loadedConfig.config.channels).map(([name, channel]) => [
|
|
1676
|
+
name,
|
|
1677
|
+
{
|
|
1678
|
+
visibility: channel.visibility,
|
|
1679
|
+
requiresAuth: channel.requiresAuth,
|
|
1680
|
+
requiresControlledAccess: channel.requiresControlledAccess,
|
|
1681
|
+
accessControl: channel.accessControl,
|
|
1682
|
+
edgeAuth: channel.edgeAuth,
|
|
1683
|
+
noindex: channel.noindex,
|
|
1684
|
+
promotable: channel.promotable,
|
|
1685
|
+
canonical: channel.canonical,
|
|
1686
|
+
url: channel.url,
|
|
1687
|
+
urlPattern: channel.urlPattern,
|
|
1688
|
+
},
|
|
1689
|
+
]),
|
|
1690
|
+
)
|
|
1691
|
+
: undefined,
|
|
1692
|
+
deploy: loadedConfig.config.deploy
|
|
1693
|
+
? Object.fromEntries(
|
|
1694
|
+
Object.entries(loadedConfig.config.deploy).map(([name, deploy]) => [
|
|
1695
|
+
name,
|
|
1696
|
+
{
|
|
1697
|
+
adapter: deploy.adapter,
|
|
1698
|
+
artifactPath: deploy.artifactPath,
|
|
1699
|
+
directoryIndexRewrite: deploy.directoryIndexRewrite,
|
|
1700
|
+
healthStrategy: deploy.healthStrategy,
|
|
1701
|
+
secretRefs: deploy.secretRefs,
|
|
1702
|
+
},
|
|
1703
|
+
]),
|
|
1704
|
+
)
|
|
1705
|
+
: undefined,
|
|
1706
|
+
infra: loadedConfig.config.infra
|
|
1707
|
+
? {
|
|
1708
|
+
adapter: loadedConfig.config.infra.adapter,
|
|
1709
|
+
adoptionMode: loadedConfig.config.infra.adoptionMode,
|
|
1710
|
+
applyMode: loadedConfig.config.infra.applyMode,
|
|
1711
|
+
environment: loadedConfig.config.infra.environment,
|
|
1712
|
+
identityRef: loadedConfig.config.infra.identityRef,
|
|
1713
|
+
desired: loadedConfig.config.infra.desired,
|
|
1714
|
+
contract: loadedConfig.config.infra.contract,
|
|
1715
|
+
secretRefs: loadedConfig.config.infra.secretRefs,
|
|
1716
|
+
commands: loadedConfig.config.infra.commands,
|
|
1717
|
+
}
|
|
1718
|
+
: undefined,
|
|
1719
|
+
consumers: loadedConfig.config.consumers,
|
|
1720
|
+
surfaces: loadedConfig.config.surfaces
|
|
1721
|
+
? Object.fromEntries(
|
|
1722
|
+
Object.entries(loadedConfig.config.surfaces).map(([name, surface]) => [
|
|
1723
|
+
name,
|
|
1724
|
+
{
|
|
1725
|
+
path: surface.path,
|
|
1726
|
+
pathOnly: surface.pathOnly,
|
|
1727
|
+
canonical: surface.canonical,
|
|
1728
|
+
previewUrlPattern: surface.previewUrlPattern,
|
|
1729
|
+
stagingUrl: surface.stagingUrl,
|
|
1730
|
+
productionUrl: surface.productionUrl,
|
|
1731
|
+
},
|
|
1732
|
+
]),
|
|
1733
|
+
)
|
|
1734
|
+
: undefined,
|
|
1735
|
+
retention: loadedConfig.config.retention,
|
|
1736
|
+
security: loadedConfig.config.security,
|
|
1737
|
+
version: loadedConfig.config.version
|
|
1738
|
+
? getVersionStrategy(loadedConfig)
|
|
1739
|
+
: undefined,
|
|
1740
|
+
anchorManifest: anchorManifest
|
|
1741
|
+
? {
|
|
1742
|
+
path: anchorManifest.path,
|
|
1743
|
+
fields: anchorManifest.fields,
|
|
1744
|
+
}
|
|
1745
|
+
: undefined,
|
|
1746
|
+
versionFiles: versionFiles.map((file) => ({
|
|
1747
|
+
path: file.path,
|
|
1748
|
+
type: file.type,
|
|
1749
|
+
key: file.key,
|
|
1750
|
+
pattern: file.pattern?.source,
|
|
1751
|
+
})),
|
|
1752
|
+
derivedVersionMaterial: discoverConfiguredDerivedVersionMaterial(cwd, loadedConfig)
|
|
1753
|
+
.map((file) => ({ path: file.path })),
|
|
1754
|
+
lifecycleStages,
|
|
1755
|
+
publish: loadedConfig.config.publish,
|
|
1756
|
+
release: loadedConfig.config.release,
|
|
1757
|
+
governance: loadedConfig.config.governance,
|
|
1758
|
+
facts: loadedConfig.config.facts,
|
|
1759
|
+
signing: loadedConfig.config.signing,
|
|
1760
|
+
publication: loadedConfig.config.publication,
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
export function updateConfiguredVersionStateContents(files, version) {
|
|
1765
|
+
return files
|
|
1766
|
+
.map((file) => {
|
|
1767
|
+
let content;
|
|
1768
|
+
if (
|
|
1769
|
+
(file.type === "json" || file.type === "toml") &&
|
|
1770
|
+
getByDottedKey(file.content, file.key) === version
|
|
1771
|
+
) {
|
|
1772
|
+
content = file.source;
|
|
1773
|
+
} else if (file.type === "json") {
|
|
1774
|
+
const next = structuredClone(file.content);
|
|
1775
|
+
setByDottedKey(next, file.key, version);
|
|
1776
|
+
content = `${JSON.stringify(next, null, 2)}\n`;
|
|
1777
|
+
} else if (file.type === "toml") {
|
|
1778
|
+
content = updateTomlStringValuePreservingSource({
|
|
1779
|
+
source: file.source,
|
|
1780
|
+
content: file.content,
|
|
1781
|
+
key: file.key,
|
|
1782
|
+
value: version,
|
|
1783
|
+
filePath: file.path,
|
|
1784
|
+
});
|
|
1785
|
+
} else if (file.type === "regex") {
|
|
1786
|
+
content = file.source.replace(file.pattern, (...args) => {
|
|
1787
|
+
const groups = args.at(-1) || {};
|
|
1788
|
+
const current = groups.version;
|
|
1789
|
+
if (typeof current !== "string") {
|
|
1790
|
+
throw new Error(`Configured regex version pattern must define a named capture group called version: ${file.path}`);
|
|
1791
|
+
}
|
|
1792
|
+
return args[0].replace(current, file.replacement.replaceAll("${version}", version));
|
|
1793
|
+
});
|
|
1794
|
+
} else {
|
|
1795
|
+
throw new Error(`Unsupported configured version file type: ${file.type}`);
|
|
1796
|
+
}
|
|
1797
|
+
return {
|
|
1798
|
+
path: file.path,
|
|
1799
|
+
kind: file.type,
|
|
1800
|
+
changed: content !== file.source,
|
|
1801
|
+
content,
|
|
1802
|
+
};
|
|
1803
|
+
})
|
|
1804
|
+
.filter((file) => file.changed);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
export function writeLifecycleScriptFixture(cwd, name, script) {
|
|
1808
|
+
const filePath = path.join(cwd, `${name}-${Date.now()}.sh`);
|
|
1809
|
+
fs.writeFileSync(filePath, script.replace(/\$\{TMPDIR\}/g, os.tmpdir()));
|
|
1810
|
+
return filePath;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
export default {
|
|
1814
|
+
discoverConfiguredVersionStateFiles,
|
|
1815
|
+
getVersionStrategy,
|
|
1816
|
+
getLifecycleStage,
|
|
1817
|
+
loadConfiguredAnchorManifest,
|
|
1818
|
+
loadBuildchainConfig,
|
|
1819
|
+
normalizeBuildchainConfig,
|
|
1820
|
+
normalizeLifecycleStage,
|
|
1821
|
+
runLifecycleStage,
|
|
1822
|
+
updateConfiguredVersionStateContents,
|
|
1823
|
+
validateBuildchainConfig,
|
|
1824
|
+
writeLifecycleScriptFixture,
|
|
1825
|
+
};
|