@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
|
@@ -1,1904 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
import crypto from "node:crypto";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import {
|
|
7
|
-
discoverConfiguredVersionStateFiles,
|
|
8
|
-
getNativeDiagnosticsProfile,
|
|
9
|
-
getLifecycleStage,
|
|
10
|
-
getPublishContract,
|
|
11
|
-
getVersionStrategy,
|
|
12
|
-
loadBuildchainConfig,
|
|
13
|
-
loadConfiguredAnchorManifest,
|
|
14
|
-
validateBuildchainConfig,
|
|
15
|
-
} from "./buildchain-config.js";
|
|
16
|
-
import { detectPackageManager, getWorkspaceInfo } from "./package-manager.js";
|
|
17
|
-
import {
|
|
18
|
-
BUILDCHAIN_LOG_EVENT_CONTRACT,
|
|
19
|
-
readBuildchainLogEvents,
|
|
20
|
-
summarizeBuildchainLogEvents,
|
|
21
|
-
} from "./logging.js";
|
|
22
|
-
import {
|
|
23
|
-
cacheEvidenceDigest,
|
|
24
|
-
createCacheEvidenceSet,
|
|
25
|
-
createCacheOperationReceipt,
|
|
26
|
-
} from "./cache-evidence.js";
|
|
27
|
-
|
|
28
|
-
export const BUILDCHAIN_DIAGNOSTICS_CONTRACT = "kungfu-buildchain-diagnostics";
|
|
29
|
-
export const BUILDCHAIN_LIFECYCLE_OBSERVABILITY_CONTRACT =
|
|
30
|
-
"kungfu-buildchain-lifecycle-observability";
|
|
31
|
-
export const BUILDCHAIN_ANCHORED_PACKAGE_RELEASE_VALIDATION_CONTRACT =
|
|
32
|
-
"kungfu-buildchain-anchored-package-release-validation";
|
|
33
|
-
export const BUILDCHAIN_DIAGNOSTICS_MANIFEST_CONTRACT =
|
|
34
|
-
"kungfu-buildchain-diagnostics-manifest";
|
|
35
|
-
export const BUILDCHAIN_DIAGNOSTICS_SUMMARY_CONTRACT =
|
|
36
|
-
"kungfu-buildchain-diagnostics-summary";
|
|
37
|
-
export const BUILDCHAIN_PROCESS_SAMPLE_REPORT_CONTRACT =
|
|
38
|
-
"kungfu-buildchain-process-sample-report";
|
|
39
|
-
export const BUILDCHAIN_PROCESS_SAMPLE_SUMMARY_CONTRACT =
|
|
40
|
-
"kungfu-buildchain-process-sample-summary";
|
|
41
|
-
export const BUILDCHAIN_LOCKED_SOURCE_CHECKOUT_CONTRACT =
|
|
42
|
-
"kungfu-buildchain-locked-source-checkout-cache";
|
|
43
|
-
|
|
44
|
-
const DEFAULT_SECRET_KEY_PATTERN =
|
|
45
|
-
/(authorization|cookie|credential|password|passwd|private[_-]?key|secret|token|api[_-]?key)/i;
|
|
46
|
-
|
|
47
|
-
function posixPath(value) {
|
|
48
|
-
return String(value || "").split(path.sep).join("/");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function safeReadJson(filePath) {
|
|
52
|
-
try {
|
|
53
|
-
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
54
|
-
} catch {
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function readJsonResult(filePath) {
|
|
60
|
-
try {
|
|
61
|
-
return { value: JSON.parse(fs.readFileSync(filePath, "utf8")) };
|
|
62
|
-
} catch (error) {
|
|
63
|
-
return { error };
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function sha256File(filePath) {
|
|
68
|
-
return crypto.createHash("sha256").update(fs.readFileSync(filePath)).digest("hex");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function fileStats(cwd, entries = []) {
|
|
72
|
-
return entries.map((entry) => {
|
|
73
|
-
const filePath = path.resolve(cwd, entry);
|
|
74
|
-
if (!fs.existsSync(filePath)) {
|
|
75
|
-
return { path: posixPath(entry), exists: false };
|
|
76
|
-
}
|
|
77
|
-
const stat = fs.statSync(filePath);
|
|
78
|
-
return {
|
|
79
|
-
path: posixPath(entry),
|
|
80
|
-
exists: true,
|
|
81
|
-
type: stat.isDirectory() ? "directory" : stat.isFile() ? "file" : "other",
|
|
82
|
-
bytes: stat.size,
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function commandVersion(command, args = ["--version"], cwd = process.cwd()) {
|
|
88
|
-
try {
|
|
89
|
-
return execFileSync(command, args, {
|
|
90
|
-
cwd,
|
|
91
|
-
encoding: "utf8",
|
|
92
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
93
|
-
timeout: 5000,
|
|
94
|
-
}).trim().split(/\r?\n/)[0] || "";
|
|
95
|
-
} catch {
|
|
96
|
-
return "";
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function defaultDiagnosticCommandRunner(command, args = [], { cwd = process.cwd(), timeoutMs = 5000 } = {}) {
|
|
101
|
-
return execFileSync(command, args, {
|
|
102
|
-
cwd,
|
|
103
|
-
encoding: "utf8",
|
|
104
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
105
|
-
timeout: timeoutMs,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function gitField(cwd, args) {
|
|
110
|
-
try {
|
|
111
|
-
return execFileSync("git", args, {
|
|
112
|
-
cwd,
|
|
113
|
-
encoding: "utf8",
|
|
114
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
115
|
-
timeout: 5000,
|
|
116
|
-
}).trim();
|
|
117
|
-
} catch {
|
|
118
|
-
return "";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function safeAnchorManifest(cwd, loadedConfig) {
|
|
123
|
-
try {
|
|
124
|
-
return loadConfiguredAnchorManifest(cwd, loadedConfig);
|
|
125
|
-
} catch (error) {
|
|
126
|
-
return { error: error.message };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function check(ok, id, message, details = {}) {
|
|
131
|
-
return { id, status: ok ? "pass" : "fail", message, details };
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function normalizePublishSourceRef(value = "") {
|
|
135
|
-
return String(value || "")
|
|
136
|
-
.trim()
|
|
137
|
-
.replace(/^refs\/heads\//, "")
|
|
138
|
-
.replace(/^refs\/tags\//, "");
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function parsePublishGateSourceRef(value = "") {
|
|
142
|
-
const sourceRef = normalizePublishSourceRef(value);
|
|
143
|
-
if (sourceRef === "publish-gate/major") {
|
|
144
|
-
return { sourceRef, channel: "major", line: "", consumerVersion: "" };
|
|
145
|
-
}
|
|
146
|
-
if (sourceRef === "publish-gate/anchor") {
|
|
147
|
-
return { sourceRef, channel: "anchor", line: "", consumerVersion: "" };
|
|
148
|
-
}
|
|
149
|
-
const match = sourceRef.match(/^publish-gate\/(alpha|release)\/(.+)\/([^/]+)$/);
|
|
150
|
-
if (!match) {
|
|
151
|
-
return { sourceRef, channel: "", line: "", consumerVersion: "" };
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
sourceRef,
|
|
155
|
-
channel: match[1],
|
|
156
|
-
line: match[2],
|
|
157
|
-
consumerVersion: match[3],
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function versionFileValue(file) {
|
|
162
|
-
if (file.type === "json" || file.type === "toml") {
|
|
163
|
-
return String(file.key || "")
|
|
164
|
-
.split(".")
|
|
165
|
-
.reduce((current, segment) => current?.[segment], file.content);
|
|
166
|
-
}
|
|
167
|
-
return file.source.match(file.pattern)?.groups?.version;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function defaultPublishSourceFromEnv(env = process.env) {
|
|
171
|
-
return {
|
|
172
|
-
sourceRef: env.BUILDCHAIN_PUBLISH_SOURCE_REF || "",
|
|
173
|
-
sourceSha: env.BUILDCHAIN_PUBLISH_SOURCE_SHA || "",
|
|
174
|
-
sourceLocked: env.BUILDCHAIN_PUBLISH_SOURCE_LOCKED || "",
|
|
175
|
-
channel: env.BUILDCHAIN_PUBLISH_SOURCE_CHANNEL || "",
|
|
176
|
-
consumerVersion: env.BUILDCHAIN_PUBLISH_SOURCE_CONSUMER_VERSION || "",
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function lifecycleTimingFromEvents(events = []) {
|
|
181
|
-
const stages = {};
|
|
182
|
-
const spans = [];
|
|
183
|
-
let warningCount = 0;
|
|
184
|
-
let errorCount = 0;
|
|
185
|
-
for (const event of events) {
|
|
186
|
-
if (event.level === "warn") {
|
|
187
|
-
warningCount += 1;
|
|
188
|
-
}
|
|
189
|
-
if (event.level === "error") {
|
|
190
|
-
errorCount += 1;
|
|
191
|
-
}
|
|
192
|
-
const stage = event.attributes?.stage || event.phase || "unknown";
|
|
193
|
-
const durationMs = Number(event.durationMs || 0);
|
|
194
|
-
if (durationMs > 0) {
|
|
195
|
-
stages[stage] = stages[stage] || { durationMs: 0, eventCount: 0 };
|
|
196
|
-
stages[stage].durationMs += durationMs;
|
|
197
|
-
spans.push({
|
|
198
|
-
event: event.event,
|
|
199
|
-
source: event.source || "",
|
|
200
|
-
component: event.component || "",
|
|
201
|
-
stage,
|
|
202
|
-
phase: event.phase || "",
|
|
203
|
-
durationMs,
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
if (stage) {
|
|
207
|
-
stages[stage] = stages[stage] || { durationMs: 0, eventCount: 0 };
|
|
208
|
-
stages[stage].eventCount += 1;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
stages: Object.fromEntries(Object.entries(stages).sort(([left], [right]) => left.localeCompare(right))),
|
|
213
|
-
topSlowSpans: spans.sort((left, right) => right.durationMs - left.durationMs).slice(0, 10),
|
|
214
|
-
warningCount,
|
|
215
|
-
errorCount,
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export function summarizeLifecycleObservability({
|
|
220
|
-
events = [],
|
|
221
|
-
logPath = "",
|
|
222
|
-
artifactScanDurationMs = 0,
|
|
223
|
-
artifactUploadDurationMs = 0,
|
|
224
|
-
totalBytes = 0,
|
|
225
|
-
fileCount = 0,
|
|
226
|
-
} = {}) {
|
|
227
|
-
const resolvedEvents = events.length ? events : readBuildchainLogEvents(logPath);
|
|
228
|
-
const timing = lifecycleTimingFromEvents(resolvedEvents);
|
|
229
|
-
return {
|
|
230
|
-
schemaVersion: 1,
|
|
231
|
-
contract: BUILDCHAIN_LIFECYCLE_OBSERVABILITY_CONTRACT,
|
|
232
|
-
log: {
|
|
233
|
-
contract: BUILDCHAIN_LOG_EVENT_CONTRACT,
|
|
234
|
-
path: logPath ? posixPath(logPath) : "",
|
|
235
|
-
summary: summarizeBuildchainLogEvents(resolvedEvents),
|
|
236
|
-
},
|
|
237
|
-
stages: timing.stages,
|
|
238
|
-
artifactScan: { durationMs: Math.round(Number(artifactScanDurationMs || 0)) },
|
|
239
|
-
artifactUpload: { durationMs: Math.round(Number(artifactUploadDurationMs || 0)) },
|
|
240
|
-
totalBytes: Number(totalBytes || 0),
|
|
241
|
-
fileCount: Number(fileCount || 0),
|
|
242
|
-
topSlowSpans: timing.topSlowSpans,
|
|
243
|
-
warningCount: timing.warningCount,
|
|
244
|
-
errorCount: timing.errorCount,
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function collectBuildchainDiagnostics({ cwd = process.cwd(), artifactPaths = [] } = {}) {
|
|
249
|
-
const resolvedCwd = path.resolve(cwd);
|
|
250
|
-
const loadedConfig = loadBuildchainConfig(resolvedCwd);
|
|
251
|
-
let configSummary = {};
|
|
252
|
-
try {
|
|
253
|
-
configSummary = validateBuildchainConfig(resolvedCwd);
|
|
254
|
-
} catch (error) {
|
|
255
|
-
configSummary = { ok: false, error: error.message };
|
|
256
|
-
}
|
|
257
|
-
return {
|
|
258
|
-
config: loadedConfig
|
|
259
|
-
? {
|
|
260
|
-
path: loadedConfig.path,
|
|
261
|
-
project: loadedConfig.config.project || {},
|
|
262
|
-
versionStrategy: getVersionStrategy(loadedConfig),
|
|
263
|
-
publishContract: getPublishContract(loadedConfig),
|
|
264
|
-
lifecycleStages: Object.keys(loadedConfig.config.lifecycle || {}),
|
|
265
|
-
diagnostics: {
|
|
266
|
-
native: getNativeDiagnosticsProfile(loadedConfig),
|
|
267
|
-
},
|
|
268
|
-
anchorManifest: safeAnchorManifest(resolvedCwd, loadedConfig),
|
|
269
|
-
validation: configSummary,
|
|
270
|
-
}
|
|
271
|
-
: { path: "", validation: configSummary },
|
|
272
|
-
lifecycle: Object.fromEntries(
|
|
273
|
-
["install", "build", "verify", "publish"]
|
|
274
|
-
.map((stage) => [stage, getLifecycleStage(loadedConfig, stage)])
|
|
275
|
-
.filter(([, value]) => Boolean(value)),
|
|
276
|
-
),
|
|
277
|
-
artifactPaths: fileStats(resolvedCwd, artifactPaths),
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function selectedCompilerCacheDiagnostics({ cwd, compilerCache, runCommand }) {
|
|
282
|
-
if (compilerCache === "none") {
|
|
283
|
-
return {};
|
|
284
|
-
}
|
|
285
|
-
const diagnostics = collectCompilerCacheDiagnostics({ cwd, runCommand });
|
|
286
|
-
if (compilerCache === "ccache") {
|
|
287
|
-
return { ccache: diagnostics.ccache };
|
|
288
|
-
}
|
|
289
|
-
if (compilerCache === "sccache") {
|
|
290
|
-
return { sccache: diagnostics.sccache };
|
|
291
|
-
}
|
|
292
|
-
return diagnostics;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export function collectNativeDiagnostics({
|
|
296
|
-
cwd = process.cwd(),
|
|
297
|
-
profile = undefined,
|
|
298
|
-
runCommand = defaultDiagnosticCommandRunner,
|
|
299
|
-
} = {}) {
|
|
300
|
-
const resolvedCwd = path.resolve(cwd);
|
|
301
|
-
const nativeProfile = profile || getNativeDiagnosticsProfile(loadBuildchainConfig(resolvedCwd));
|
|
302
|
-
if (!nativeProfile.enabled) {
|
|
303
|
-
return {
|
|
304
|
-
enabled: false,
|
|
305
|
-
profile: nativeProfile,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
const expectedTools = nativeProfile.expectedTools.length
|
|
309
|
-
? nativeProfile.expectedTools
|
|
310
|
-
: ["node", "pnpm", "npm", "git", "cmake", "ninja", "ccache", "sccache"];
|
|
311
|
-
return {
|
|
312
|
-
enabled: true,
|
|
313
|
-
profile: nativeProfile,
|
|
314
|
-
tools: collectToolDiagnostics({ cwd: resolvedCwd, tools: expectedTools }),
|
|
315
|
-
compilerCaches: selectedCompilerCacheDiagnostics({
|
|
316
|
-
cwd: resolvedCwd,
|
|
317
|
-
compilerCache: nativeProfile.compilerCache,
|
|
318
|
-
runCommand,
|
|
319
|
-
}),
|
|
320
|
-
artifactDirs: fileStats(resolvedCwd, nativeProfile.artifactDirs),
|
|
321
|
-
cacheDirs: fileStats(resolvedCwd, nativeProfile.cacheDirs),
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export function validateAnchoredPackageRelease({
|
|
326
|
-
cwd = process.cwd(),
|
|
327
|
-
requireManifest = true,
|
|
328
|
-
requirePackageSetOrder = "platforms-first-main-last",
|
|
329
|
-
requireTrustedPublishing = true,
|
|
330
|
-
requireLifecycleStages = ["install", "build", "verify", "publish"],
|
|
331
|
-
requirePublishGateSourceLock = false,
|
|
332
|
-
publishSource = undefined,
|
|
333
|
-
env = process.env,
|
|
334
|
-
} = {}) {
|
|
335
|
-
const resolvedCwd = path.resolve(cwd);
|
|
336
|
-
const checks = [];
|
|
337
|
-
let versionFiles = [];
|
|
338
|
-
let loadedConfig;
|
|
339
|
-
try {
|
|
340
|
-
loadedConfig = loadBuildchainConfig(resolvedCwd);
|
|
341
|
-
checks.push(check(Boolean(loadedConfig), "config.load", "buildchain.toml is readable"));
|
|
342
|
-
} catch (error) {
|
|
343
|
-
checks.push(check(false, "config.load", error.message));
|
|
344
|
-
}
|
|
345
|
-
const versionStrategy = getVersionStrategy(loadedConfig);
|
|
346
|
-
checks.push(check(
|
|
347
|
-
versionStrategy.strategy === "anchored",
|
|
348
|
-
"version.strategy",
|
|
349
|
-
"version strategy is anchored",
|
|
350
|
-
versionStrategy,
|
|
351
|
-
));
|
|
352
|
-
checks.push(check(
|
|
353
|
-
versionStrategy.next === "manual",
|
|
354
|
-
"version.next",
|
|
355
|
-
"next version strategy is manual",
|
|
356
|
-
versionStrategy,
|
|
357
|
-
));
|
|
358
|
-
const anchorManifest = safeAnchorManifest(resolvedCwd, loadedConfig);
|
|
359
|
-
checks.push(check(
|
|
360
|
-
!requireManifest || (anchorManifest && !anchorManifest.error),
|
|
361
|
-
"version.manifest",
|
|
362
|
-
anchorManifest?.error || "anchor manifest is readable",
|
|
363
|
-
{ path: anchorManifest?.path || versionStrategy.manifest || "" },
|
|
364
|
-
));
|
|
365
|
-
try {
|
|
366
|
-
versionFiles = discoverConfiguredVersionStateFiles(resolvedCwd, loadedConfig);
|
|
367
|
-
checks.push(check(versionFiles.length > 0, "version.files", "configured version files are readable", {
|
|
368
|
-
files: versionFiles.map((file) => file.path),
|
|
369
|
-
}));
|
|
370
|
-
} catch (error) {
|
|
371
|
-
checks.push(check(false, "version.files", error.message));
|
|
372
|
-
}
|
|
373
|
-
const publish = getPublishContract(loadedConfig) || {};
|
|
374
|
-
checks.push(check(
|
|
375
|
-
publish.mode === "publish-final-version",
|
|
376
|
-
"publish.mode",
|
|
377
|
-
"publish mode is compatible with anchored final-version release",
|
|
378
|
-
{ mode: publish.mode || "" },
|
|
379
|
-
));
|
|
380
|
-
if (requireTrustedPublishing) {
|
|
381
|
-
checks.push(check(
|
|
382
|
-
publish.auth === "trusted-publishing",
|
|
383
|
-
"publish.auth",
|
|
384
|
-
"trusted publishing is enabled",
|
|
385
|
-
{ auth: publish.auth || "" },
|
|
386
|
-
));
|
|
387
|
-
}
|
|
388
|
-
if (requirePackageSetOrder) {
|
|
389
|
-
checks.push(check(
|
|
390
|
-
publish.packageSetOrder === requirePackageSetOrder,
|
|
391
|
-
"publish.package_set_order",
|
|
392
|
-
`package set order is ${requirePackageSetOrder}`,
|
|
393
|
-
{ packageSetOrder: publish.packageSetOrder || "" },
|
|
394
|
-
));
|
|
395
|
-
}
|
|
396
|
-
for (const stage of requireLifecycleStages || []) {
|
|
397
|
-
checks.push(check(
|
|
398
|
-
Boolean(getLifecycleStage(loadedConfig, stage)),
|
|
399
|
-
`lifecycle.${stage}`,
|
|
400
|
-
`lifecycle stage is configured: ${stage}`,
|
|
401
|
-
));
|
|
402
|
-
}
|
|
403
|
-
const source = publishSource || defaultPublishSourceFromEnv(env);
|
|
404
|
-
const parsedSource = parsePublishGateSourceRef(source.sourceRef);
|
|
405
|
-
if (requirePublishGateSourceLock) {
|
|
406
|
-
const normalizedLocked = String(source.sourceLocked || "").toLowerCase();
|
|
407
|
-
const lockEnabled = normalizedLocked === "true" || normalizedLocked === "1" || source.sourceLocked === true;
|
|
408
|
-
checks.push(check(
|
|
409
|
-
lockEnabled,
|
|
410
|
-
"publish.source_locked",
|
|
411
|
-
"publish source lock is required before package publication",
|
|
412
|
-
{ sourceLocked: source.sourceLocked || "" },
|
|
413
|
-
));
|
|
414
|
-
checks.push(check(
|
|
415
|
-
Boolean(parsedSource.channel) && parsedSource.channel !== "anchor",
|
|
416
|
-
"publish.source_ref",
|
|
417
|
-
"publish source ref uses publish-gate/{alpha,release,major}",
|
|
418
|
-
{ sourceRef: parsedSource.sourceRef || source.sourceRef || "", channel: parsedSource.channel || "" },
|
|
419
|
-
));
|
|
420
|
-
checks.push(check(
|
|
421
|
-
/^[0-9a-f]{40}$/i.test(String(source.sourceSha || "")),
|
|
422
|
-
"publish.source_sha",
|
|
423
|
-
"publish source SHA is a 40-character Git SHA",
|
|
424
|
-
{ sourceSha: source.sourceSha || "" },
|
|
425
|
-
));
|
|
426
|
-
const consumerVersion = parsedSource.consumerVersion || source.consumerVersion || "";
|
|
427
|
-
if (consumerVersion) {
|
|
428
|
-
const mismatches = versionFiles
|
|
429
|
-
.map((file) => ({ path: file.path, version: versionFileValue(file) || "" }))
|
|
430
|
-
.filter((file) => file.version !== consumerVersion);
|
|
431
|
-
checks.push(check(
|
|
432
|
-
mismatches.length === 0,
|
|
433
|
-
"publish.source_version",
|
|
434
|
-
`publish source consumer version matches configured version files: ${consumerVersion}`,
|
|
435
|
-
{ consumerVersion, mismatches },
|
|
436
|
-
));
|
|
437
|
-
checks.push(check(
|
|
438
|
-
!anchorManifest?.fields?.npmVersion || anchorManifest.fields.npmVersion === consumerVersion,
|
|
439
|
-
"publish.anchor_version",
|
|
440
|
-
`anchor manifest npmVersion matches publish source version: ${consumerVersion}`,
|
|
441
|
-
{ consumerVersion, npmVersion: anchorManifest?.fields?.npmVersion || "" },
|
|
442
|
-
));
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return {
|
|
446
|
-
schemaVersion: 1,
|
|
447
|
-
contract: BUILDCHAIN_ANCHORED_PACKAGE_RELEASE_VALIDATION_CONTRACT,
|
|
448
|
-
cwd: resolvedCwd,
|
|
449
|
-
ok: checks.every((entry) => entry.status === "pass"),
|
|
450
|
-
checks,
|
|
451
|
-
summary: {
|
|
452
|
-
versionStrategy,
|
|
453
|
-
anchorManifest: anchorManifest?.path || "",
|
|
454
|
-
publish,
|
|
455
|
-
publishSource: {
|
|
456
|
-
sourceRef: parsedSource.sourceRef || source.sourceRef || "",
|
|
457
|
-
sourceSha: source.sourceSha || "",
|
|
458
|
-
sourceLocked: source.sourceLocked || "",
|
|
459
|
-
channel: parsedSource.channel || source.channel || "",
|
|
460
|
-
line: parsedSource.line || "",
|
|
461
|
-
consumerVersion: parsedSource.consumerVersion || source.consumerVersion || "",
|
|
462
|
-
},
|
|
463
|
-
requiredLifecycleStages: requireLifecycleStages,
|
|
464
|
-
},
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
export function collectRunnerDiagnostics() {
|
|
469
|
-
return {
|
|
470
|
-
os: {
|
|
471
|
-
platform: os.platform(),
|
|
472
|
-
release: os.release(),
|
|
473
|
-
arch: os.arch(),
|
|
474
|
-
type: os.type(),
|
|
475
|
-
},
|
|
476
|
-
cpu: {
|
|
477
|
-
logicalCount: os.cpus().length,
|
|
478
|
-
model: os.cpus()[0]?.model || "",
|
|
479
|
-
loadAverage: os.loadavg(),
|
|
480
|
-
},
|
|
481
|
-
memory: {
|
|
482
|
-
totalBytes: os.totalmem(),
|
|
483
|
-
freeBytes: os.freemem(),
|
|
484
|
-
},
|
|
485
|
-
uptimeSeconds: Math.round(os.uptime()),
|
|
486
|
-
github: {
|
|
487
|
-
actions: process.env.GITHUB_ACTIONS === "true",
|
|
488
|
-
runnerOs: process.env.RUNNER_OS || "",
|
|
489
|
-
runnerArch: process.env.RUNNER_ARCH || "",
|
|
490
|
-
runnerName: process.env.RUNNER_NAME || "",
|
|
491
|
-
},
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
export function collectToolDiagnostics({ cwd = process.cwd(), tools = ["node", "pnpm", "npm", "git", "cmake", "ninja", "ccache", "sccache"] } = {}) {
|
|
496
|
-
return Object.fromEntries(tools.map((tool) => [tool, { version: commandVersion(tool, ["--version"], cwd) }]));
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function parseJsonDiagnostics(value = "") {
|
|
500
|
-
try {
|
|
501
|
-
return JSON.parse(String(value || "").trim());
|
|
502
|
-
} catch {
|
|
503
|
-
return undefined;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
function parseTextStats(value = "") {
|
|
508
|
-
const stats = {};
|
|
509
|
-
for (const line of String(value || "").split(/\r?\n/)) {
|
|
510
|
-
const trimmed = line.trim();
|
|
511
|
-
if (!trimmed) {
|
|
512
|
-
continue;
|
|
513
|
-
}
|
|
514
|
-
const match = trimmed.match(/^(.+?)(?:\s{2,}|\t+|:\s+)([-+]?\d+(?:\.\d+)?)(?:\s|$)/);
|
|
515
|
-
if (!match) {
|
|
516
|
-
continue;
|
|
517
|
-
}
|
|
518
|
-
const key = match[1]
|
|
519
|
-
.trim()
|
|
520
|
-
.toLowerCase()
|
|
521
|
-
.replace(/[^a-z0-9]+/g, "_")
|
|
522
|
-
.replace(/^_+|_+$/g, "");
|
|
523
|
-
if (!key) {
|
|
524
|
-
continue;
|
|
525
|
-
}
|
|
526
|
-
const number = Number(match[2]);
|
|
527
|
-
stats[key] = Number.isFinite(number) ? number : match[2];
|
|
528
|
-
}
|
|
529
|
-
return stats;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function collectCompilerCacheTool({ command, attempts, cwd, runCommand }) {
|
|
533
|
-
let lastError;
|
|
534
|
-
for (const attempt of attempts) {
|
|
535
|
-
const args = attempt.args || [];
|
|
536
|
-
const expectedFormat = attempt.format || "";
|
|
537
|
-
try {
|
|
538
|
-
const output = runCommand(command, args, { cwd, timeoutMs: 5000 });
|
|
539
|
-
const text = String(output || "").trim();
|
|
540
|
-
const jsonStats = parseJsonDiagnostics(text);
|
|
541
|
-
if (jsonStats) {
|
|
542
|
-
return {
|
|
543
|
-
available: true,
|
|
544
|
-
command,
|
|
545
|
-
args,
|
|
546
|
-
format: "json",
|
|
547
|
-
stats: jsonStats,
|
|
548
|
-
rawBytes: Buffer.byteLength(text, "utf8"),
|
|
549
|
-
parseError: "",
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
const textStats = parseTextStats(text);
|
|
553
|
-
return {
|
|
554
|
-
available: true,
|
|
555
|
-
command,
|
|
556
|
-
args,
|
|
557
|
-
format: "text",
|
|
558
|
-
stats: textStats,
|
|
559
|
-
rawBytes: Buffer.byteLength(text, "utf8"),
|
|
560
|
-
parseError: Object.keys(textStats).length ? "" : `${expectedFormat || "stats"} output was not parseable`,
|
|
561
|
-
};
|
|
562
|
-
} catch (error) {
|
|
563
|
-
lastError = error;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
return {
|
|
567
|
-
available: false,
|
|
568
|
-
command,
|
|
569
|
-
error: lastError?.code || lastError?.message || "stats command failed",
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
export function collectCompilerCacheDiagnostics({
|
|
574
|
-
cwd = process.cwd(),
|
|
575
|
-
runCommand = defaultDiagnosticCommandRunner,
|
|
576
|
-
env = process.env,
|
|
577
|
-
} = {}) {
|
|
578
|
-
const resolvedCwd = path.resolve(cwd);
|
|
579
|
-
const ccache = collectCompilerCacheTool({
|
|
580
|
-
command: "ccache",
|
|
581
|
-
attempts: [
|
|
582
|
-
{ args: ["--show-stats", "--json"], format: "json" },
|
|
583
|
-
{ args: ["--show-stats"], format: "text" },
|
|
584
|
-
],
|
|
585
|
-
cwd: resolvedCwd,
|
|
586
|
-
runCommand,
|
|
587
|
-
});
|
|
588
|
-
ccache.logStats = env.CCACHE_STATSLOG
|
|
589
|
-
? collectCompilerCacheTool({
|
|
590
|
-
command: "ccache",
|
|
591
|
-
attempts: [
|
|
592
|
-
{
|
|
593
|
-
args: ["--print-log-stats", "--format", "json"],
|
|
594
|
-
format: "json",
|
|
595
|
-
},
|
|
596
|
-
],
|
|
597
|
-
cwd: resolvedCwd,
|
|
598
|
-
runCommand,
|
|
599
|
-
})
|
|
600
|
-
: {
|
|
601
|
-
available: false,
|
|
602
|
-
command: "ccache",
|
|
603
|
-
error: "CCACHE_STATSLOG is not configured",
|
|
604
|
-
};
|
|
605
|
-
return {
|
|
606
|
-
ccache,
|
|
607
|
-
sccache: collectCompilerCacheTool({
|
|
608
|
-
command: "sccache",
|
|
609
|
-
attempts: [
|
|
610
|
-
{ args: ["--show-stats", "--stats-format", "json"], format: "json" },
|
|
611
|
-
],
|
|
612
|
-
cwd: resolvedCwd,
|
|
613
|
-
runCommand,
|
|
614
|
-
}),
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
function unavailableMetric(unit, reason, source = null, evidenceRoot = null) {
|
|
619
|
-
return {
|
|
620
|
-
status: "unavailable",
|
|
621
|
-
unit,
|
|
622
|
-
value: null,
|
|
623
|
-
source,
|
|
624
|
-
reason,
|
|
625
|
-
evidenceRoot,
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
function notApplicableMetric(unit, reason) {
|
|
630
|
-
return {
|
|
631
|
-
status: "not-applicable",
|
|
632
|
-
unit,
|
|
633
|
-
value: null,
|
|
634
|
-
reason,
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
function observedMetric(unit, value, source, evidenceRoot) {
|
|
639
|
-
return {
|
|
640
|
-
status: "observed",
|
|
641
|
-
unit,
|
|
642
|
-
value: Number(value),
|
|
643
|
-
source,
|
|
644
|
-
evidenceRoot,
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
function numericTotal(value) {
|
|
649
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
650
|
-
if (value && typeof value === "object") {
|
|
651
|
-
return Object.values(value).reduce((sum, entry) => sum + numericTotal(entry), 0);
|
|
652
|
-
}
|
|
653
|
-
return 0;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
function cacheStatsCount(stats, names) {
|
|
657
|
-
return names.reduce((sum, name) => sum + numericTotal(stats?.[name]), 0);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
function compilerCacheObservation(compilerCaches, compilerCachePreparation) {
|
|
661
|
-
const preparationValid =
|
|
662
|
-
compilerCachePreparation?.contract ===
|
|
663
|
-
"kungfu-buildchain-compiler-cache-preparation" &&
|
|
664
|
-
compilerCachePreparation?.provider === "sccache" &&
|
|
665
|
-
compilerCachePreparation?.status === "prepared" &&
|
|
666
|
-
compilerCachePreparation?.action?.statsReset === true &&
|
|
667
|
-
/^sha256:[0-9a-f]{64}$/.test(compilerCachePreparation?.root || "");
|
|
668
|
-
const sccache = compilerCaches?.sccache;
|
|
669
|
-
if (preparationValid && sccache?.available && sccache.stats) {
|
|
670
|
-
const stats = sccache.stats.stats || sccache.stats;
|
|
671
|
-
return {
|
|
672
|
-
provider: "sccache",
|
|
673
|
-
producer: "sccache",
|
|
674
|
-
source: "sccache-current-run-stats",
|
|
675
|
-
stats,
|
|
676
|
-
hits: cacheStatsCount(stats, [
|
|
677
|
-
"cache_hits",
|
|
678
|
-
"cache_hit",
|
|
679
|
-
"cache_hits_count",
|
|
680
|
-
"cache_hit_count",
|
|
681
|
-
]),
|
|
682
|
-
misses: cacheStatsCount(stats, [
|
|
683
|
-
"cache_misses",
|
|
684
|
-
"cache_miss",
|
|
685
|
-
"cache_misses_count",
|
|
686
|
-
"cache_miss_count",
|
|
687
|
-
]),
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
const logStats = compilerCaches?.ccache?.logStats;
|
|
691
|
-
if (logStats?.available && logStats.stats) {
|
|
692
|
-
return {
|
|
693
|
-
provider: "ccache",
|
|
694
|
-
producer: "ccache",
|
|
695
|
-
source: "ccache-current-run-stats-log",
|
|
696
|
-
stats: logStats.stats,
|
|
697
|
-
hits: cacheStatsCount(logStats.stats, [
|
|
698
|
-
"direct_cache_hit",
|
|
699
|
-
"preprocessed_cache_hit",
|
|
700
|
-
]),
|
|
701
|
-
misses: cacheStatsCount(logStats.stats, ["cache_miss"]),
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
return {
|
|
705
|
-
provider: sccache?.available ? "sccache" : "compiler-cache",
|
|
706
|
-
producer: "unavailable",
|
|
707
|
-
source: sccache?.available ? "sccache-cumulative-stats" : "compiler-cache-diagnostics",
|
|
708
|
-
stats: undefined,
|
|
709
|
-
hits: 0,
|
|
710
|
-
misses: 0,
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
function compilerCacheOutcome(observation) {
|
|
715
|
-
if (!observation?.stats) return "unavailable";
|
|
716
|
-
if (observation.hits > 0 && observation.misses > 0) return "partial";
|
|
717
|
-
if (observation.hits > 0) return "hit";
|
|
718
|
-
if (observation.misses > 0) return "miss";
|
|
719
|
-
return "bypassed";
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
export function createStructuredCacheEvidence({
|
|
723
|
-
sourceCheckout,
|
|
724
|
-
compilerCaches,
|
|
725
|
-
compilerCachePreparation,
|
|
726
|
-
platform,
|
|
727
|
-
env = process.env,
|
|
728
|
-
}) {
|
|
729
|
-
const repository = env.GITHUB_REPOSITORY || sourceCheckout?.repository || "unknown/unknown";
|
|
730
|
-
const sourceCommit =
|
|
731
|
-
env.BUILDCHAIN_SOURCE_SHA ||
|
|
732
|
-
sourceCheckout?.source?.sha ||
|
|
733
|
-
sourceCheckout?.verification?.head ||
|
|
734
|
-
"unknown";
|
|
735
|
-
const sourceTree =
|
|
736
|
-
env.BUILDCHAIN_SOURCE_TREE_SHA ||
|
|
737
|
-
sourceCheckout?.source?.treeSha ||
|
|
738
|
-
sourceCheckout?.verification?.tree ||
|
|
739
|
-
"";
|
|
740
|
-
const runtimeCommit = env.BUILDCHAIN_RUNTIME_SHA || "";
|
|
741
|
-
const policyRoot = env.SHIFU_CACHE_PROFILE_DIGEST || "";
|
|
742
|
-
const bindings = {
|
|
743
|
-
sourceCommit,
|
|
744
|
-
...(sourceTree ? { sourceTree } : {}),
|
|
745
|
-
...(runtimeCommit ? { runtimeCommit } : {}),
|
|
746
|
-
...(env.BUILDCHAIN_DEPENDENCY_LOCK_ROOT
|
|
747
|
-
? { dependencyLockRoot: env.BUILDCHAIN_DEPENDENCY_LOCK_ROOT }
|
|
748
|
-
: {}),
|
|
749
|
-
...(env.BUILDCHAIN_TOOLCHAIN_ROOT
|
|
750
|
-
? { toolchainRoot: env.BUILDCHAIN_TOOLCHAIN_ROOT }
|
|
751
|
-
: {}),
|
|
752
|
-
...(env.BUILDCHAIN_CACHE_POLICY_ROOT
|
|
753
|
-
? { policyRoot: env.BUILDCHAIN_CACHE_POLICY_ROOT }
|
|
754
|
-
: {}),
|
|
755
|
-
...(policyRoot ? { cacheProfileRoot: policyRoot } : {}),
|
|
756
|
-
...(compilerCachePreparation?.root
|
|
757
|
-
? { compilerCachePreparationRoot: compilerCachePreparation.root }
|
|
758
|
-
: {}),
|
|
759
|
-
};
|
|
760
|
-
const operations = [];
|
|
761
|
-
if (sourceCheckout) {
|
|
762
|
-
const evidenceRoot = cacheEvidenceDigest(sourceCheckout);
|
|
763
|
-
const cache = sourceCheckout.cache || {};
|
|
764
|
-
const outcome = cache.hit
|
|
765
|
-
? "hit"
|
|
766
|
-
: cache.attempted === false || sourceCheckout.policy?.mode === "off"
|
|
767
|
-
? "bypassed"
|
|
768
|
-
: cache.fallbackUsed
|
|
769
|
-
? "miss"
|
|
770
|
-
: "unavailable";
|
|
771
|
-
operations.push(
|
|
772
|
-
createCacheOperationReceipt({
|
|
773
|
-
operationId: `source-checkout:${platform}`,
|
|
774
|
-
operation: "restore",
|
|
775
|
-
provider: `git-${cache.transport || "unknown"}`,
|
|
776
|
-
producer: "kungfu-systems/buildchain",
|
|
777
|
-
platform,
|
|
778
|
-
cacheKey: sourceCommit,
|
|
779
|
-
cacheRoot:
|
|
780
|
-
sourceCheckout.policy?.referenceRepository?.display ||
|
|
781
|
-
sourceCheckout.policy?.mirror?.display ||
|
|
782
|
-
`transport:${cache.transport || "unknown"}`,
|
|
783
|
-
outcome,
|
|
784
|
-
bindings,
|
|
785
|
-
metrics: {
|
|
786
|
-
lookupDuration:
|
|
787
|
-
cache.attempted === false
|
|
788
|
-
? notApplicableMetric("ms", "source checkout cache was disabled")
|
|
789
|
-
: observedMetric(
|
|
790
|
-
"ms",
|
|
791
|
-
cache.lookupDurationMs || 0,
|
|
792
|
-
"locked-source-checkout",
|
|
793
|
-
evidenceRoot,
|
|
794
|
-
),
|
|
795
|
-
restoreDuration: cache.hit
|
|
796
|
-
? observedMetric(
|
|
797
|
-
"ms",
|
|
798
|
-
cache.restoreDurationMs || 0,
|
|
799
|
-
"locked-source-checkout",
|
|
800
|
-
evidenceRoot,
|
|
801
|
-
)
|
|
802
|
-
: notApplicableMetric(
|
|
803
|
-
"ms",
|
|
804
|
-
"no cache payload was admitted for restore",
|
|
805
|
-
),
|
|
806
|
-
saveDuration: notApplicableMetric(
|
|
807
|
-
"ms",
|
|
808
|
-
"locked source checkout does not save cache state",
|
|
809
|
-
),
|
|
810
|
-
restoredBytes:
|
|
811
|
-
cache.restoredBytesStatus === "observed"
|
|
812
|
-
? observedMetric(
|
|
813
|
-
"bytes",
|
|
814
|
-
cache.restoredBytes || 0,
|
|
815
|
-
cache.restoredBytesMethod || "git-object-store-delta",
|
|
816
|
-
evidenceRoot,
|
|
817
|
-
)
|
|
818
|
-
: unavailableMetric(
|
|
819
|
-
"bytes",
|
|
820
|
-
"checkout provider did not expose restored byte evidence",
|
|
821
|
-
"locked-source-checkout",
|
|
822
|
-
evidenceRoot,
|
|
823
|
-
),
|
|
824
|
-
writtenBytes: notApplicableMetric(
|
|
825
|
-
"bytes",
|
|
826
|
-
"locked source checkout does not save cache state",
|
|
827
|
-
),
|
|
828
|
-
savedTime: unavailableMetric(
|
|
829
|
-
"ms",
|
|
830
|
-
"checkout provider did not report a measured cold-path comparison",
|
|
831
|
-
"locked-source-checkout",
|
|
832
|
-
evidenceRoot,
|
|
833
|
-
),
|
|
834
|
-
},
|
|
835
|
-
evidence: {
|
|
836
|
-
kind: "locked-source-checkout",
|
|
837
|
-
root: evidenceRoot,
|
|
838
|
-
locator: ".buildchain/diagnostics/source-checkout.json",
|
|
839
|
-
},
|
|
840
|
-
}),
|
|
841
|
-
);
|
|
842
|
-
}
|
|
843
|
-
const compilerObservation = compilerCacheObservation(
|
|
844
|
-
compilerCaches,
|
|
845
|
-
compilerCachePreparation,
|
|
846
|
-
);
|
|
847
|
-
const compilerEvidenceRoot = cacheEvidenceDigest({
|
|
848
|
-
compilerCaches: compilerCaches || {},
|
|
849
|
-
compilerCachePreparation: compilerCachePreparation || null,
|
|
850
|
-
});
|
|
851
|
-
const compilerMetricReason = compilerObservation.stats
|
|
852
|
-
? `${compilerObservation.provider} current-run stats do not expose this metric`
|
|
853
|
-
: compilerObservation.provider === "sccache"
|
|
854
|
-
? "sccache stats were not admitted without a current-run reset preparation receipt"
|
|
855
|
-
: "compiler cache current-run stats were unavailable";
|
|
856
|
-
operations.push(
|
|
857
|
-
createCacheOperationReceipt({
|
|
858
|
-
operationId: `compiler-cache:${platform}`,
|
|
859
|
-
operation: "restore",
|
|
860
|
-
provider: compilerObservation.provider,
|
|
861
|
-
producer: compilerObservation.producer,
|
|
862
|
-
platform,
|
|
863
|
-
cacheKey: compilerCachePreparation?.root || policyRoot || null,
|
|
864
|
-
cacheRoot: policyRoot || null,
|
|
865
|
-
outcome: compilerCacheOutcome(compilerObservation),
|
|
866
|
-
bindings,
|
|
867
|
-
metrics: {
|
|
868
|
-
lookupDuration: unavailableMetric(
|
|
869
|
-
"ms",
|
|
870
|
-
compilerMetricReason,
|
|
871
|
-
compilerObservation.source,
|
|
872
|
-
compilerEvidenceRoot,
|
|
873
|
-
),
|
|
874
|
-
restoreDuration: unavailableMetric(
|
|
875
|
-
"ms",
|
|
876
|
-
compilerMetricReason,
|
|
877
|
-
compilerObservation.source,
|
|
878
|
-
compilerEvidenceRoot,
|
|
879
|
-
),
|
|
880
|
-
saveDuration: unavailableMetric(
|
|
881
|
-
"ms",
|
|
882
|
-
compilerMetricReason,
|
|
883
|
-
compilerObservation.source,
|
|
884
|
-
compilerEvidenceRoot,
|
|
885
|
-
),
|
|
886
|
-
restoredBytes: unavailableMetric(
|
|
887
|
-
"bytes",
|
|
888
|
-
compilerMetricReason,
|
|
889
|
-
compilerObservation.source,
|
|
890
|
-
compilerEvidenceRoot,
|
|
891
|
-
),
|
|
892
|
-
writtenBytes: unavailableMetric(
|
|
893
|
-
"bytes",
|
|
894
|
-
compilerMetricReason,
|
|
895
|
-
compilerObservation.source,
|
|
896
|
-
compilerEvidenceRoot,
|
|
897
|
-
),
|
|
898
|
-
savedTime: unavailableMetric(
|
|
899
|
-
"ms",
|
|
900
|
-
compilerMetricReason,
|
|
901
|
-
compilerObservation.source,
|
|
902
|
-
compilerEvidenceRoot,
|
|
903
|
-
),
|
|
904
|
-
},
|
|
905
|
-
evidence: {
|
|
906
|
-
kind: "compiler-cache-diagnostics",
|
|
907
|
-
root: compilerEvidenceRoot,
|
|
908
|
-
locator: ".buildchain/artifacts/<platform>/diagnostics.json#compilerCaches",
|
|
909
|
-
},
|
|
910
|
-
}),
|
|
911
|
-
);
|
|
912
|
-
return createCacheEvidenceSet({
|
|
913
|
-
repository,
|
|
914
|
-
sourceCommit,
|
|
915
|
-
sourceTree,
|
|
916
|
-
runtimeCommit,
|
|
917
|
-
platform,
|
|
918
|
-
operations,
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
export function collectCacheDiagnostics({ cwd = process.cwd(), cacheDirs = [], runCommand = defaultDiagnosticCommandRunner } = {}) {
|
|
923
|
-
const resolvedCwd = path.resolve(cwd);
|
|
924
|
-
return {
|
|
925
|
-
packageManager: (() => {
|
|
926
|
-
try {
|
|
927
|
-
return detectPackageManager(resolvedCwd);
|
|
928
|
-
} catch (error) {
|
|
929
|
-
return { name: "unknown", error: error.message };
|
|
930
|
-
}
|
|
931
|
-
})(),
|
|
932
|
-
workspace: (() => {
|
|
933
|
-
try {
|
|
934
|
-
return getWorkspaceInfo(resolvedCwd);
|
|
935
|
-
} catch (error) {
|
|
936
|
-
return { error: error.message };
|
|
937
|
-
}
|
|
938
|
-
})(),
|
|
939
|
-
dirs: fileStats(resolvedCwd, cacheDirs),
|
|
940
|
-
compilerCaches: collectCompilerCacheDiagnostics({ cwd: resolvedCwd, runCommand }),
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
export function collectGitDiagnostics({ cwd = process.cwd() } = {}) {
|
|
945
|
-
return {
|
|
946
|
-
repository: gitField(cwd, ["config", "--get", "remote.origin.url"]),
|
|
947
|
-
head: gitField(cwd, ["rev-parse", "HEAD"]),
|
|
948
|
-
ref: gitField(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]),
|
|
949
|
-
dirty: gitField(cwd, ["status", "--short"]) !== "",
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
export function redactDiagnosticsValue(key, value, pattern = DEFAULT_SECRET_KEY_PATTERN) {
|
|
954
|
-
if (pattern.test(String(key || ""))) {
|
|
955
|
-
return "[REDACTED]";
|
|
956
|
-
}
|
|
957
|
-
return value;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
function processCommandFromLine(commandLine = "", fallback = "") {
|
|
961
|
-
const firstToken = shellishTokens(commandLine)[0] || fallback;
|
|
962
|
-
return String(firstToken || "")
|
|
963
|
-
.replace(/[()]/g, "")
|
|
964
|
-
.split(/[\\/]/)
|
|
965
|
-
.pop();
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
function normalizeProcessRows({ rootPid, platform, rows = [] }) {
|
|
969
|
-
const byParent = new Map();
|
|
970
|
-
const byPid = new Map();
|
|
971
|
-
for (const row of rows) {
|
|
972
|
-
byPid.set(row.pid, row);
|
|
973
|
-
byParent.set(row.ppid, [...(byParent.get(row.ppid) || []), row]);
|
|
974
|
-
}
|
|
975
|
-
const seen = new Set();
|
|
976
|
-
const stack = [String(rootPid)];
|
|
977
|
-
const processes = [];
|
|
978
|
-
while (stack.length) {
|
|
979
|
-
const current = stack.pop();
|
|
980
|
-
for (const child of byParent.get(current) || []) {
|
|
981
|
-
if (seen.has(child.pid)) {
|
|
982
|
-
continue;
|
|
983
|
-
}
|
|
984
|
-
seen.add(child.pid);
|
|
985
|
-
processes.push(child);
|
|
986
|
-
stack.push(child.pid);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
return { rootPid: String(rootPid), platform, rootProcess: byPid.get(String(rootPid)) || undefined, processes };
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
function collectWindowsProcessRows({ cwd, runCommand }) {
|
|
993
|
-
const script = [
|
|
994
|
-
"$ErrorActionPreference = 'Stop';",
|
|
995
|
-
"Get-CimInstance Win32_Process |",
|
|
996
|
-
"Select-Object ProcessId,ParentProcessId,Name,CommandLine |",
|
|
997
|
-
"ConvertTo-Json -Compress",
|
|
998
|
-
].join(" ");
|
|
999
|
-
const errors = [];
|
|
1000
|
-
let output = "";
|
|
1001
|
-
for (const command of ["powershell.exe", "powershell", "pwsh"]) {
|
|
1002
|
-
try {
|
|
1003
|
-
output = runCommand(command, ["-NoProfile", "-NonInteractive", "-Command", script], {
|
|
1004
|
-
cwd,
|
|
1005
|
-
timeoutMs: 5000,
|
|
1006
|
-
});
|
|
1007
|
-
break;
|
|
1008
|
-
} catch (error) {
|
|
1009
|
-
errors.push(`${command}: ${error.message}`);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
if (!output) {
|
|
1013
|
-
throw new Error(`Windows process sampler unavailable: ${errors.join("; ") || "no process query output"}`);
|
|
1014
|
-
}
|
|
1015
|
-
const parsed = JSON.parse(String(output || "[]"));
|
|
1016
|
-
const entries = Array.isArray(parsed) ? parsed : [parsed];
|
|
1017
|
-
return entries.map((entry) => {
|
|
1018
|
-
const commandLine = redactCommandLine(entry.CommandLine || entry.Name || "");
|
|
1019
|
-
return {
|
|
1020
|
-
pid: String(entry.ProcessId || ""),
|
|
1021
|
-
ppid: String(entry.ParentProcessId || ""),
|
|
1022
|
-
cpu: 0,
|
|
1023
|
-
command: processCommandFromLine(commandLine, entry.Name || ""),
|
|
1024
|
-
commandLine,
|
|
1025
|
-
};
|
|
1026
|
-
}).filter((entry) => entry.pid && entry.ppid);
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
export function collectProcessTreeSnapshot({
|
|
1030
|
-
rootPid = process.pid,
|
|
1031
|
-
cwd = process.cwd(),
|
|
1032
|
-
platform = process.platform,
|
|
1033
|
-
runCommand = defaultDiagnosticCommandRunner,
|
|
1034
|
-
} = {}) {
|
|
1035
|
-
const pid = String(rootPid || process.pid);
|
|
1036
|
-
if (platform === "win32") {
|
|
1037
|
-
try {
|
|
1038
|
-
return normalizeProcessRows({
|
|
1039
|
-
rootPid: pid,
|
|
1040
|
-
platform,
|
|
1041
|
-
rows: collectWindowsProcessRows({ cwd, runCommand }),
|
|
1042
|
-
});
|
|
1043
|
-
} catch (error) {
|
|
1044
|
-
return {
|
|
1045
|
-
rootPid: pid,
|
|
1046
|
-
platform,
|
|
1047
|
-
processes: [],
|
|
1048
|
-
samplerUnavailable: true,
|
|
1049
|
-
samplerUnavailableReason: error.message,
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
let lines = [];
|
|
1054
|
-
try {
|
|
1055
|
-
lines = runCommand("ps", ["-axo", "pid=,ppid=,pcpu=,args="], {
|
|
1056
|
-
cwd,
|
|
1057
|
-
timeoutMs: 5000,
|
|
1058
|
-
}).split(/\r?\n/).filter(Boolean);
|
|
1059
|
-
} catch (error) {
|
|
1060
|
-
return {
|
|
1061
|
-
rootPid: pid,
|
|
1062
|
-
platform,
|
|
1063
|
-
processes: [],
|
|
1064
|
-
samplerUnavailable: true,
|
|
1065
|
-
samplerUnavailableReason: error.message,
|
|
1066
|
-
};
|
|
1067
|
-
}
|
|
1068
|
-
const rows = lines.map((line) => {
|
|
1069
|
-
const match = line.trim().match(/^(\d+)\s+(\d+)\s+([0-9.]+)\s+(.*)$/);
|
|
1070
|
-
const args = match?.[4] || "";
|
|
1071
|
-
const commandLine = redactCommandLine(args);
|
|
1072
|
-
return match
|
|
1073
|
-
? {
|
|
1074
|
-
pid: match[1],
|
|
1075
|
-
ppid: match[2],
|
|
1076
|
-
cpu: Number(match[3]),
|
|
1077
|
-
command: processCommandFromLine(commandLine),
|
|
1078
|
-
commandLine,
|
|
1079
|
-
}
|
|
1080
|
-
: undefined;
|
|
1081
|
-
}).filter(Boolean);
|
|
1082
|
-
return normalizeProcessRows({ rootPid: pid, platform, rows });
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
export function classifyProcessCommand(command = "") {
|
|
1086
|
-
const name = String(command || "").split(/[\\/]/).pop().toLowerCase();
|
|
1087
|
-
if (/^(ccache|sccache)$/.test(name)) {
|
|
1088
|
-
return "cache";
|
|
1089
|
-
}
|
|
1090
|
-
if (/^(clang|clang\+\+|gcc|g\+\+|cc|c\+\+|cl)(\.exe)?$/.test(name)) {
|
|
1091
|
-
return "compiler";
|
|
1092
|
-
}
|
|
1093
|
-
if (/^(ld|lld|lld-link|link)(\.exe)?$/.test(name)) {
|
|
1094
|
-
return "linker";
|
|
1095
|
-
}
|
|
1096
|
-
if (/^(ar|llvm-ar|libtool|ranlib)(\.exe)?$/.test(name)) {
|
|
1097
|
-
return "archive";
|
|
1098
|
-
}
|
|
1099
|
-
if (/^(make|ninja|cmake|msbuild|vcbuild|gyp-mac-tool)(\.exe)?$/.test(name)) {
|
|
1100
|
-
return "build-tool";
|
|
1101
|
-
}
|
|
1102
|
-
if (/^(node|python|python3|bash|sh|pwsh|powershell)(\.exe)?$/.test(name)) {
|
|
1103
|
-
return "script";
|
|
1104
|
-
}
|
|
1105
|
-
return "other";
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
function firstPositiveInteger(value) {
|
|
1109
|
-
const number = Number(value);
|
|
1110
|
-
return Number.isInteger(number) && number > 0 ? number : 0;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
function commandName(value = "") {
|
|
1114
|
-
return String(value || "")
|
|
1115
|
-
.replace(/[()]/g, "")
|
|
1116
|
-
.replace(/\.exe$/i, "")
|
|
1117
|
-
.split(/[\\/]/)
|
|
1118
|
-
.pop()
|
|
1119
|
-
.toLowerCase();
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
function detectParallelismFromTokens(tokens = []) {
|
|
1123
|
-
for (let index = 0; index < tokens.length; index += 1) {
|
|
1124
|
-
const token = String(tokens[index] || "");
|
|
1125
|
-
const inlineMatch = token.match(/^(?:-j|--jobs=|--parallel=|-jobs|\/m:|\/maxcpucount:|-m:)(\d+)$/i);
|
|
1126
|
-
if (inlineMatch) {
|
|
1127
|
-
return { value: Number(inlineMatch[1]), source: "command", token };
|
|
1128
|
-
}
|
|
1129
|
-
if (/^(?:-j|--jobs|--parallel|-jobs)$/i.test(token)) {
|
|
1130
|
-
const value = firstPositiveInteger(tokens[index + 1]);
|
|
1131
|
-
if (value) {
|
|
1132
|
-
return { value, source: "command", token: `${token} ${tokens[index + 1]}` };
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
return { value: 0, source: "", token: "" };
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
function shellishTokens(command = "") {
|
|
1140
|
-
return String(command || "").match(/"[^"]+"|'[^']+'|\S+/g)?.map((token) => token.replace(/^['"]|['"]$/g, "")) || [];
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
function redactCommandLine(commandLine = "", pattern = DEFAULT_SECRET_KEY_PATTERN) {
|
|
1144
|
-
const tokens = shellishTokens(commandLine);
|
|
1145
|
-
let redactNext = false;
|
|
1146
|
-
return tokens.map((token) => {
|
|
1147
|
-
const withUrlUserInfo = token.replace(/:\/\/[^/\s:@]+:[^/\s@]+@/g, "://[REDACTED]@");
|
|
1148
|
-
if (redactNext) {
|
|
1149
|
-
redactNext = false;
|
|
1150
|
-
return "[REDACTED]";
|
|
1151
|
-
}
|
|
1152
|
-
const assignment = withUrlUserInfo.match(/^([^=\s]+)=(.*)$/);
|
|
1153
|
-
if (assignment && pattern.test(assignment[1])) {
|
|
1154
|
-
return `${assignment[1]}=[REDACTED]`;
|
|
1155
|
-
}
|
|
1156
|
-
const inlineOption = withUrlUserInfo.match(/^(--?[^=\s]+)=(.*)$/);
|
|
1157
|
-
if (inlineOption && pattern.test(inlineOption[1])) {
|
|
1158
|
-
return `${inlineOption[1]}=[REDACTED]`;
|
|
1159
|
-
}
|
|
1160
|
-
if (/^--?/.test(withUrlUserInfo) && pattern.test(withUrlUserInfo)) {
|
|
1161
|
-
redactNext = true;
|
|
1162
|
-
}
|
|
1163
|
-
return withUrlUserInfo;
|
|
1164
|
-
}).join(" ");
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
function commandLineFromProcess(entry = {}) {
|
|
1168
|
-
return [
|
|
1169
|
-
entry.commandLine,
|
|
1170
|
-
Array.isArray(entry.args) ? entry.args.join(" ") : entry.args,
|
|
1171
|
-
Array.isArray(entry.argv) ? entry.argv.join(" ") : "",
|
|
1172
|
-
entry.command,
|
|
1173
|
-
].find((value) => String(value || "").trim()) || "";
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
function parallelismCandidate({ value, source, token, entry, sample }) {
|
|
1177
|
-
return {
|
|
1178
|
-
value,
|
|
1179
|
-
source,
|
|
1180
|
-
token,
|
|
1181
|
-
pid: entry?.pid ? String(entry.pid) : "",
|
|
1182
|
-
command: commandName(entry?.command || shellishTokens(commandLineFromProcess(entry))[0] || ""),
|
|
1183
|
-
commandLine: commandLineFromProcess(entry),
|
|
1184
|
-
timestamp: sample?.timestamp || "",
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
export function detectRequestedParallelism({
|
|
1189
|
-
command = "",
|
|
1190
|
-
args = [],
|
|
1191
|
-
env = process.env,
|
|
1192
|
-
} = {}) {
|
|
1193
|
-
const commandTokens = [
|
|
1194
|
-
...shellishTokens(command),
|
|
1195
|
-
...(Array.isArray(args) ? args.map((entry) => String(entry)) : shellishTokens(args)),
|
|
1196
|
-
];
|
|
1197
|
-
const commandParallelism = detectParallelismFromTokens(commandTokens);
|
|
1198
|
-
if (commandParallelism.value) {
|
|
1199
|
-
return commandParallelism;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
const explicitEnvKeys = [
|
|
1203
|
-
"BUILDCHAIN_REQUESTED_PARALLELISM",
|
|
1204
|
-
"CMAKE_BUILD_PARALLEL_LEVEL",
|
|
1205
|
-
"NINJA_STATUS_JOBS",
|
|
1206
|
-
"npm_config_jobs",
|
|
1207
|
-
];
|
|
1208
|
-
for (const key of explicitEnvKeys) {
|
|
1209
|
-
const value = firstPositiveInteger(env?.[key]);
|
|
1210
|
-
if (value) {
|
|
1211
|
-
return { value, source: `env:${key}`, token: key };
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
const makeflags = detectParallelismFromTokens(shellishTokens(env?.MAKEFLAGS || ""));
|
|
1216
|
-
if (makeflags.value) {
|
|
1217
|
-
return { ...makeflags, source: "env:MAKEFLAGS" };
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
return { value: 0, source: "", token: "" };
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
export function detectRequestedParallelismFromProcessSamples(samples = []) {
|
|
1224
|
-
const candidates = [];
|
|
1225
|
-
const buildToolNames = new Set(["make", "ninja", "cmake", "msbuild", "xcodebuild"]);
|
|
1226
|
-
for (const sample of Array.isArray(samples) ? samples : []) {
|
|
1227
|
-
for (const entry of Array.isArray(sample?.processes) ? sample.processes : []) {
|
|
1228
|
-
const command = commandName(entry.command || shellishTokens(commandLineFromProcess(entry))[0] || "");
|
|
1229
|
-
if (!buildToolNames.has(command)) {
|
|
1230
|
-
continue;
|
|
1231
|
-
}
|
|
1232
|
-
const tokens = shellishTokens(commandLineFromProcess(entry));
|
|
1233
|
-
const detected = detectParallelismFromTokens(tokens);
|
|
1234
|
-
if (detected.value) {
|
|
1235
|
-
candidates.push(parallelismCandidate({
|
|
1236
|
-
...detected,
|
|
1237
|
-
source: "process-tree",
|
|
1238
|
-
entry,
|
|
1239
|
-
sample,
|
|
1240
|
-
}));
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
candidates.sort((left, right) => right.value - left.value || left.command.localeCompare(right.command));
|
|
1245
|
-
return {
|
|
1246
|
-
value: candidates[0]?.value || 0,
|
|
1247
|
-
source: candidates[0] ? "process-tree" : "",
|
|
1248
|
-
token: candidates[0]?.token || "",
|
|
1249
|
-
evidence: candidates[0] || undefined,
|
|
1250
|
-
candidates,
|
|
1251
|
-
};
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
export function summarizeProcessSamples({
|
|
1255
|
-
samples = [],
|
|
1256
|
-
requestedParallelism = 0,
|
|
1257
|
-
command = "",
|
|
1258
|
-
args = [],
|
|
1259
|
-
env = process.env,
|
|
1260
|
-
activeCpuThreshold = 0.1,
|
|
1261
|
-
} = {}) {
|
|
1262
|
-
const normalizedSamples = Array.isArray(samples) ? samples : [];
|
|
1263
|
-
const unavailableSamples = normalizedSamples.filter((sample) => sample?.samplerUnavailable);
|
|
1264
|
-
const activeCounts = [];
|
|
1265
|
-
const cpuTotals = [];
|
|
1266
|
-
const categoryMax = {};
|
|
1267
|
-
const commandStats = new Map();
|
|
1268
|
-
const threshold = Number(activeCpuThreshold || 0);
|
|
1269
|
-
|
|
1270
|
-
for (const sample of normalizedSamples) {
|
|
1271
|
-
const processes = Array.isArray(sample?.processes) ? sample.processes : [];
|
|
1272
|
-
const active = processes.filter((entry) => Number(entry.cpu || 0) >= threshold);
|
|
1273
|
-
activeCounts.push(active.length);
|
|
1274
|
-
cpuTotals.push(processes.reduce((sum, entry) => sum + Number(entry.cpu || 0), 0));
|
|
1275
|
-
|
|
1276
|
-
const categoryCounts = {};
|
|
1277
|
-
for (const entry of active) {
|
|
1278
|
-
const command = path.basename(String(entry.command || "unknown"));
|
|
1279
|
-
const category = classifyProcessCommand(command);
|
|
1280
|
-
categoryCounts[category] = (categoryCounts[category] || 0) + 1;
|
|
1281
|
-
const stats = commandStats.get(command) || {
|
|
1282
|
-
command,
|
|
1283
|
-
category,
|
|
1284
|
-
samples: 0,
|
|
1285
|
-
maxConcurrent: 0,
|
|
1286
|
-
maxCpu: 0,
|
|
1287
|
-
};
|
|
1288
|
-
stats.samples += 1;
|
|
1289
|
-
stats.maxCpu = Math.max(stats.maxCpu, Number(entry.cpu || 0));
|
|
1290
|
-
commandStats.set(command, stats);
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
const commandCounts = {};
|
|
1294
|
-
for (const entry of active) {
|
|
1295
|
-
const command = path.basename(String(entry.command || "unknown"));
|
|
1296
|
-
commandCounts[command] = (commandCounts[command] || 0) + 1;
|
|
1297
|
-
}
|
|
1298
|
-
for (const [command, count] of Object.entries(commandCounts)) {
|
|
1299
|
-
const stats = commandStats.get(command);
|
|
1300
|
-
if (stats) {
|
|
1301
|
-
stats.maxConcurrent = Math.max(stats.maxConcurrent, count);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
for (const [category, count] of Object.entries(categoryCounts)) {
|
|
1305
|
-
categoryMax[category] = Math.max(categoryMax[category] || 0, count);
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
const observedMax = activeCounts.length ? Math.max(...activeCounts) : 0;
|
|
1310
|
-
const observedAverage = activeCounts.length
|
|
1311
|
-
? activeCounts.reduce((sum, value) => sum + value, 0) / activeCounts.length
|
|
1312
|
-
: 0;
|
|
1313
|
-
const totalCpuMax = cpuTotals.length ? Math.max(...cpuTotals) : 0;
|
|
1314
|
-
const totalCpuAverage = cpuTotals.length
|
|
1315
|
-
? cpuTotals.reduce((sum, value) => sum + value, 0) / cpuTotals.length
|
|
1316
|
-
: 0;
|
|
1317
|
-
const explicitRequested = firstPositiveInteger(requestedParallelism);
|
|
1318
|
-
const commandParallelism = detectRequestedParallelism({ command, args, env });
|
|
1319
|
-
const sampledParallelism = detectRequestedParallelismFromProcessSamples(normalizedSamples);
|
|
1320
|
-
const requested = explicitRequested || sampledParallelism.value || commandParallelism.value;
|
|
1321
|
-
const requestedSource = explicitRequested
|
|
1322
|
-
? "explicit"
|
|
1323
|
-
: sampledParallelism.source || commandParallelism.source;
|
|
1324
|
-
const requestedEvidence = explicitRequested
|
|
1325
|
-
? { value: explicitRequested, source: "explicit" }
|
|
1326
|
-
: sampledParallelism.evidence || (commandParallelism.value ? commandParallelism : undefined);
|
|
1327
|
-
|
|
1328
|
-
return {
|
|
1329
|
-
schemaVersion: 1,
|
|
1330
|
-
contract: BUILDCHAIN_PROCESS_SAMPLE_SUMMARY_CONTRACT,
|
|
1331
|
-
sampleCount: normalizedSamples.length,
|
|
1332
|
-
sampler: {
|
|
1333
|
-
unavailable: unavailableSamples.length > 0,
|
|
1334
|
-
unavailableSamples: unavailableSamples.length,
|
|
1335
|
-
unavailableReasons: [...new Set(
|
|
1336
|
-
unavailableSamples
|
|
1337
|
-
.map((sample) => String(sample.samplerUnavailableReason || "").trim())
|
|
1338
|
-
.filter(Boolean),
|
|
1339
|
-
)].slice(0, 5),
|
|
1340
|
-
},
|
|
1341
|
-
activeCpuThreshold: threshold,
|
|
1342
|
-
requestedParallelism: requested,
|
|
1343
|
-
requestedParallelismSource: requestedSource,
|
|
1344
|
-
requestedParallelismEvidence: requestedEvidence || {},
|
|
1345
|
-
requestedParallelismCandidates: sampledParallelism.candidates.slice(0, 10),
|
|
1346
|
-
observedConcurrency: {
|
|
1347
|
-
max: observedMax,
|
|
1348
|
-
average: Number(observedAverage.toFixed(2)),
|
|
1349
|
-
ratioToRequestedMax: requested > 0 ? Number((observedMax / requested).toFixed(3)) : 0,
|
|
1350
|
-
},
|
|
1351
|
-
cpu: {
|
|
1352
|
-
totalMax: Number(totalCpuMax.toFixed(2)),
|
|
1353
|
-
totalAverage: Number(totalCpuAverage.toFixed(2)),
|
|
1354
|
-
},
|
|
1355
|
-
categories: Object.fromEntries(Object.entries(categoryMax).sort(([left], [right]) => left.localeCompare(right))),
|
|
1356
|
-
topCommands: [...commandStats.values()]
|
|
1357
|
-
.sort((left, right) => right.maxConcurrent - left.maxConcurrent || right.maxCpu - left.maxCpu)
|
|
1358
|
-
.slice(0, 10),
|
|
1359
|
-
};
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
export function startProcessSampler({
|
|
1363
|
-
rootPid = process.pid,
|
|
1364
|
-
intervalMs = 15000,
|
|
1365
|
-
label = "",
|
|
1366
|
-
command = "",
|
|
1367
|
-
args = [],
|
|
1368
|
-
env = process.env,
|
|
1369
|
-
requestedParallelism = 0,
|
|
1370
|
-
onSample = () => undefined,
|
|
1371
|
-
cwd = process.cwd(),
|
|
1372
|
-
} = {}) {
|
|
1373
|
-
const samples = [];
|
|
1374
|
-
const startedAt = Date.now();
|
|
1375
|
-
const explicitRequested = firstPositiveInteger(requestedParallelism);
|
|
1376
|
-
const detectedParallelism = detectRequestedParallelism({ command, args, env });
|
|
1377
|
-
const requested = explicitRequested || detectedParallelism.value;
|
|
1378
|
-
const sample = () => {
|
|
1379
|
-
const snapshot = {
|
|
1380
|
-
timestamp: new Date().toISOString(),
|
|
1381
|
-
label,
|
|
1382
|
-
elapsedMs: Date.now() - startedAt,
|
|
1383
|
-
requestedParallelism: requested,
|
|
1384
|
-
requestedParallelismSource: explicitRequested ? "explicit" : detectedParallelism.source,
|
|
1385
|
-
...collectProcessTreeSnapshot({ rootPid, cwd }),
|
|
1386
|
-
};
|
|
1387
|
-
samples.push(snapshot);
|
|
1388
|
-
onSample(snapshot);
|
|
1389
|
-
return snapshot;
|
|
1390
|
-
};
|
|
1391
|
-
sample();
|
|
1392
|
-
const interval = Math.max(1000, Number(intervalMs || 15000));
|
|
1393
|
-
const earlyDelay = Math.min(1000, interval);
|
|
1394
|
-
const earlyTimer = interval > earlyDelay ? setTimeout(sample, earlyDelay) : undefined;
|
|
1395
|
-
const timer = setInterval(sample, interval);
|
|
1396
|
-
return {
|
|
1397
|
-
samples,
|
|
1398
|
-
stop() {
|
|
1399
|
-
if (earlyTimer) {
|
|
1400
|
-
clearTimeout(earlyTimer);
|
|
1401
|
-
}
|
|
1402
|
-
clearInterval(timer);
|
|
1403
|
-
return samples;
|
|
1404
|
-
},
|
|
1405
|
-
};
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
export function createDiagnosticsArtifact({
|
|
1409
|
-
cwd = process.cwd(),
|
|
1410
|
-
logPath = "",
|
|
1411
|
-
artifactPaths = [],
|
|
1412
|
-
cacheDirs = [],
|
|
1413
|
-
lifecycleObservability = undefined,
|
|
1414
|
-
processSamples = [],
|
|
1415
|
-
processSummary = undefined,
|
|
1416
|
-
requestedParallelism = 0,
|
|
1417
|
-
sourceCheckout = undefined,
|
|
1418
|
-
compilerCachePreparation = undefined,
|
|
1419
|
-
links = {},
|
|
1420
|
-
} = {}) {
|
|
1421
|
-
const resolvedCwd = path.resolve(cwd);
|
|
1422
|
-
const events = logPath ? readBuildchainLogEvents(logPath) : [];
|
|
1423
|
-
const loadedConfig = loadBuildchainConfig(resolvedCwd);
|
|
1424
|
-
const nativeProfile = getNativeDiagnosticsProfile(loadedConfig);
|
|
1425
|
-
const native = collectNativeDiagnostics({ cwd: resolvedCwd, profile: nativeProfile });
|
|
1426
|
-
const cache = collectCacheDiagnostics({ cwd: resolvedCwd, cacheDirs });
|
|
1427
|
-
const compilerCaches = native.compilerCaches || cache.compilerCaches || {};
|
|
1428
|
-
const platform =
|
|
1429
|
-
links.platformId ||
|
|
1430
|
-
process.env.BUILDCHAIN_PLATFORM_ID ||
|
|
1431
|
-
`${process.env.RUNNER_OS || os.platform()}-${process.env.RUNNER_ARCH || os.arch()}`;
|
|
1432
|
-
return {
|
|
1433
|
-
schemaVersion: 1,
|
|
1434
|
-
contract: BUILDCHAIN_DIAGNOSTICS_CONTRACT,
|
|
1435
|
-
generatedAt: new Date().toISOString(),
|
|
1436
|
-
cwd: resolvedCwd,
|
|
1437
|
-
buildchain: collectBuildchainDiagnostics({ cwd: resolvedCwd, artifactPaths }),
|
|
1438
|
-
runner: collectRunnerDiagnostics(),
|
|
1439
|
-
tools: collectToolDiagnostics({ cwd: resolvedCwd }),
|
|
1440
|
-
cache,
|
|
1441
|
-
native,
|
|
1442
|
-
compilerCaches,
|
|
1443
|
-
cacheEvidence: createStructuredCacheEvidence({
|
|
1444
|
-
sourceCheckout,
|
|
1445
|
-
compilerCaches,
|
|
1446
|
-
compilerCachePreparation,
|
|
1447
|
-
platform,
|
|
1448
|
-
}),
|
|
1449
|
-
nativeCacheDirs: native.cacheDirs || [],
|
|
1450
|
-
git: collectGitDiagnostics({ cwd: resolvedCwd }),
|
|
1451
|
-
lifecycleObservability: lifecycleObservability || summarizeLifecycleObservability({ events, logPath }),
|
|
1452
|
-
process: processSummary || summarizeProcessSamples({ samples: processSamples, requestedParallelism }),
|
|
1453
|
-
...(sourceCheckout ? { sourceCheckout } : {}),
|
|
1454
|
-
...(compilerCachePreparation ? { compilerCachePreparation } : {}),
|
|
1455
|
-
links,
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
export function writeDiagnosticsArtifact(filePath, diagnostics) {
|
|
1460
|
-
if (!filePath) {
|
|
1461
|
-
return "";
|
|
1462
|
-
}
|
|
1463
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
1464
|
-
fs.writeFileSync(filePath, `${JSON.stringify(diagnostics, null, 2)}\n`);
|
|
1465
|
-
return filePath;
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
export function readDiagnosticsArtifact(filePath) {
|
|
1469
|
-
return safeReadJson(filePath);
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
function sumLifecycleDurationMs(stages = {}) {
|
|
1473
|
-
return Object.values(stages).reduce((sum, entry) => sum + Number(entry?.durationMs || 0), 0);
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
function stageDurationMs(stages = {}, stage) {
|
|
1477
|
-
return Math.round(Number(stages?.[stage]?.durationMs || 0));
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
function formatDiagnosticsDurationMs(value) {
|
|
1481
|
-
const durationMs = Math.round(Number(value || 0));
|
|
1482
|
-
if (!Number.isFinite(durationMs) || durationMs <= 0) {
|
|
1483
|
-
return "-";
|
|
1484
|
-
}
|
|
1485
|
-
if (durationMs < 1000) {
|
|
1486
|
-
return `${durationMs}ms`;
|
|
1487
|
-
}
|
|
1488
|
-
if (durationMs < 60000) {
|
|
1489
|
-
const seconds = durationMs / 1000;
|
|
1490
|
-
return `${seconds < 10 ? seconds.toFixed(1).replace(/\.0$/, "") : Math.round(seconds)}s`;
|
|
1491
|
-
}
|
|
1492
|
-
const minutes = Math.floor(durationMs / 60000);
|
|
1493
|
-
const seconds = Math.round((durationMs % 60000) / 1000);
|
|
1494
|
-
return seconds ? `${minutes}m${seconds}s` : `${minutes}m`;
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
function compactProcessSummary(process = {}) {
|
|
1498
|
-
const observedConcurrency = process?.observedConcurrency || {};
|
|
1499
|
-
const topCommands = Array.isArray(process?.topCommands)
|
|
1500
|
-
? process.topCommands.slice(0, 3).map((entry) => ({
|
|
1501
|
-
command: entry.command || "",
|
|
1502
|
-
category: entry.category || "",
|
|
1503
|
-
maxConcurrent: Number(entry.maxConcurrent || 0),
|
|
1504
|
-
maxCpu: Number(entry.maxCpu || 0),
|
|
1505
|
-
}))
|
|
1506
|
-
: [];
|
|
1507
|
-
return {
|
|
1508
|
-
requestedParallelism: Number(process?.requestedParallelism || 0),
|
|
1509
|
-
requestedParallelismSource: process?.requestedParallelismSource || "",
|
|
1510
|
-
observedConcurrencyMax: Number(observedConcurrency.max || 0),
|
|
1511
|
-
ratioToRequestedMax: Number(observedConcurrency.ratioToRequestedMax || 0),
|
|
1512
|
-
sampleCount: Number(process?.sampleCount || 0),
|
|
1513
|
-
categories: process?.categories || {},
|
|
1514
|
-
topCommands,
|
|
1515
|
-
};
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
function formatDiagnosticsProcessValue(value) {
|
|
1519
|
-
const number = Number(value || 0);
|
|
1520
|
-
return number > 0 ? String(number) : "-";
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
function compactRunnerDetails(runner = {}) {
|
|
1524
|
-
return {
|
|
1525
|
-
os: {
|
|
1526
|
-
platform: runner.os?.platform || "",
|
|
1527
|
-
release: runner.os?.release || "",
|
|
1528
|
-
arch: runner.os?.arch || "",
|
|
1529
|
-
type: runner.os?.type || "",
|
|
1530
|
-
},
|
|
1531
|
-
github: {
|
|
1532
|
-
actions: Boolean(runner.github?.actions),
|
|
1533
|
-
runnerOs: runner.github?.runnerOs || "",
|
|
1534
|
-
runnerArch: runner.github?.runnerArch || "",
|
|
1535
|
-
runnerName: runner.github?.runnerName || "",
|
|
1536
|
-
},
|
|
1537
|
-
cpu: {
|
|
1538
|
-
logicalCount: Number(runner.cpu?.logicalCount || 0),
|
|
1539
|
-
model: runner.cpu?.model || "",
|
|
1540
|
-
loadAverage: Array.isArray(runner.cpu?.loadAverage)
|
|
1541
|
-
? runner.cpu.loadAverage.map((entry) => Number(entry || 0))
|
|
1542
|
-
: [],
|
|
1543
|
-
},
|
|
1544
|
-
memory: {
|
|
1545
|
-
totalBytes: Number(runner.memory?.totalBytes || 0),
|
|
1546
|
-
freeBytes: Number(runner.memory?.freeBytes || 0),
|
|
1547
|
-
},
|
|
1548
|
-
uptimeSeconds: Number(runner.uptimeSeconds || 0),
|
|
1549
|
-
};
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
function compactToolSummary(...toolSets) {
|
|
1553
|
-
const merged = {};
|
|
1554
|
-
for (const toolSet of toolSets) {
|
|
1555
|
-
for (const [name, details] of Object.entries(toolSet || {})) {
|
|
1556
|
-
merged[name] = details || {};
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
const versions = {};
|
|
1560
|
-
const missing = [];
|
|
1561
|
-
for (const [name, details] of Object.entries(merged).sort(([left], [right]) => left.localeCompare(right))) {
|
|
1562
|
-
const version = String(details?.version || "").trim();
|
|
1563
|
-
if (version) {
|
|
1564
|
-
versions[name] = version;
|
|
1565
|
-
} else {
|
|
1566
|
-
missing.push(name);
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
return {
|
|
1570
|
-
checked: Object.keys(merged).length,
|
|
1571
|
-
available: Object.keys(versions).length,
|
|
1572
|
-
missing,
|
|
1573
|
-
versions,
|
|
1574
|
-
};
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
function compactStatsObject(stats = {}, limit = 12) {
|
|
1578
|
-
const entries = [];
|
|
1579
|
-
const visit = (prefix, value) => {
|
|
1580
|
-
if (entries.length >= limit || value === undefined || value === null) {
|
|
1581
|
-
return;
|
|
1582
|
-
}
|
|
1583
|
-
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
|
|
1584
|
-
entries.push([prefix, value]);
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
if (Array.isArray(value) || typeof value !== "object") {
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
for (const [key, nested] of Object.entries(value).sort(([left], [right]) => left.localeCompare(right))) {
|
|
1591
|
-
visit(prefix ? `${prefix}.${key}` : key, nested);
|
|
1592
|
-
if (entries.length >= limit) {
|
|
1593
|
-
break;
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
};
|
|
1597
|
-
visit("", stats);
|
|
1598
|
-
return Object.fromEntries(entries);
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
function compactCompilerCacheSummary(compilerCaches = {}) {
|
|
1602
|
-
return Object.fromEntries(
|
|
1603
|
-
Object.entries(compilerCaches || {})
|
|
1604
|
-
.sort(([left], [right]) => left.localeCompare(right))
|
|
1605
|
-
.map(([name, details]) => [name, {
|
|
1606
|
-
available: Boolean(details?.available),
|
|
1607
|
-
format: details?.format || "",
|
|
1608
|
-
rawBytes: Number(details?.rawBytes || 0),
|
|
1609
|
-
error: details?.error || "",
|
|
1610
|
-
stats: compactStatsObject(details?.stats || {}),
|
|
1611
|
-
}]),
|
|
1612
|
-
);
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
function compactCacheSummary(cache = {}, native = {}) {
|
|
1616
|
-
const workspace = cache.workspace || {};
|
|
1617
|
-
const workspacePackages = workspace && !workspace.error && !Array.isArray(workspace) && typeof workspace === "object"
|
|
1618
|
-
? Object.keys(workspace).length
|
|
1619
|
-
: 0;
|
|
1620
|
-
return {
|
|
1621
|
-
packageManager: cache.packageManager || {},
|
|
1622
|
-
workspacePackages,
|
|
1623
|
-
workspaceError: workspace.error || "",
|
|
1624
|
-
dirs: Array.isArray(cache.dirs)
|
|
1625
|
-
? cache.dirs.map((entry) => ({
|
|
1626
|
-
path: entry.path || "",
|
|
1627
|
-
exists: Boolean(entry.exists),
|
|
1628
|
-
type: entry.type || "",
|
|
1629
|
-
bytes: Number(entry.bytes || 0),
|
|
1630
|
-
}))
|
|
1631
|
-
: [],
|
|
1632
|
-
compilerCaches: compactCompilerCacheSummary({
|
|
1633
|
-
...(cache.compilerCaches || {}),
|
|
1634
|
-
...(native.compilerCaches || {}),
|
|
1635
|
-
}),
|
|
1636
|
-
nativeCacheDirs: Array.isArray(native.cacheDirs)
|
|
1637
|
-
? native.cacheDirs.map((entry) => ({
|
|
1638
|
-
path: entry.path || "",
|
|
1639
|
-
exists: Boolean(entry.exists),
|
|
1640
|
-
type: entry.type || "",
|
|
1641
|
-
bytes: Number(entry.bytes || 0),
|
|
1642
|
-
}))
|
|
1643
|
-
: [],
|
|
1644
|
-
};
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
function resolveDiagnosticsInput(entry) {
|
|
1648
|
-
if (typeof entry !== "string") {
|
|
1649
|
-
return { diagnostics: entry, sourcePath: "" };
|
|
1650
|
-
}
|
|
1651
|
-
return {
|
|
1652
|
-
diagnostics: readDiagnosticsArtifact(entry),
|
|
1653
|
-
sourcePath: path.resolve(entry),
|
|
1654
|
-
};
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
function buildchainRootForPath(filePath) {
|
|
1658
|
-
const parts = path.resolve(filePath).split(path.sep);
|
|
1659
|
-
const index = parts.lastIndexOf(".buildchain");
|
|
1660
|
-
if (index <= 0) {
|
|
1661
|
-
return "";
|
|
1662
|
-
}
|
|
1663
|
-
const rootParts = parts.slice(0, index);
|
|
1664
|
-
return rootParts.length ? rootParts.join(path.sep) || path.sep : path.sep;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
function diagnosticsManifestCandidates(diagnostics, sourcePath) {
|
|
1668
|
-
if (!sourcePath) {
|
|
1669
|
-
return [];
|
|
1670
|
-
}
|
|
1671
|
-
const candidates = [path.join(path.dirname(sourcePath), "diagnostics-manifest.json")];
|
|
1672
|
-
const linkedPath = diagnostics?.links?.diagnosticsManifest || "";
|
|
1673
|
-
if (linkedPath) {
|
|
1674
|
-
if (path.isAbsolute(linkedPath)) {
|
|
1675
|
-
candidates.push(linkedPath);
|
|
1676
|
-
} else {
|
|
1677
|
-
const buildchainRoot = buildchainRootForPath(sourcePath);
|
|
1678
|
-
if (buildchainRoot) {
|
|
1679
|
-
candidates.push(path.resolve(buildchainRoot, linkedPath));
|
|
1680
|
-
}
|
|
1681
|
-
candidates.push(path.resolve(process.cwd(), linkedPath));
|
|
1682
|
-
candidates.push(path.resolve(path.dirname(sourcePath), linkedPath));
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
return [...new Set(candidates)];
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
function compactDiagnosticsManifestFile(entry = {}) {
|
|
1689
|
-
return {
|
|
1690
|
-
kind: entry.kind || "",
|
|
1691
|
-
path: entry.path || "",
|
|
1692
|
-
bytes: Number(entry.bytes || 0),
|
|
1693
|
-
sha256: entry.sha256 || "",
|
|
1694
|
-
required: Boolean(entry.required),
|
|
1695
|
-
};
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
function summarizeDiagnosticsContract(diagnostics = {}) {
|
|
1699
|
-
const actual = diagnostics?.contract || "";
|
|
1700
|
-
const warnings = [];
|
|
1701
|
-
if (actual !== BUILDCHAIN_DIAGNOSTICS_CONTRACT) {
|
|
1702
|
-
warnings.push(`unexpected diagnostics artifact contract: ${actual || "unknown"}`);
|
|
1703
|
-
}
|
|
1704
|
-
return {
|
|
1705
|
-
status: warnings.length ? "warning" : "verified",
|
|
1706
|
-
expected: BUILDCHAIN_DIAGNOSTICS_CONTRACT,
|
|
1707
|
-
actual,
|
|
1708
|
-
warningCount: warnings.length,
|
|
1709
|
-
warnings,
|
|
1710
|
-
};
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
function summarizeDiagnosticsManifest(diagnostics, sourcePath) {
|
|
1714
|
-
if (!sourcePath) {
|
|
1715
|
-
return undefined;
|
|
1716
|
-
}
|
|
1717
|
-
const candidates = diagnosticsManifestCandidates(diagnostics, sourcePath);
|
|
1718
|
-
const manifestPath = candidates.find((candidate) => fs.existsSync(candidate)) || candidates[0] || "";
|
|
1719
|
-
const relativePath = manifestPath
|
|
1720
|
-
? posixPath(path.relative(path.dirname(sourcePath), manifestPath))
|
|
1721
|
-
: "";
|
|
1722
|
-
if (!manifestPath || !fs.existsSync(manifestPath)) {
|
|
1723
|
-
return {
|
|
1724
|
-
status: "missing",
|
|
1725
|
-
path: relativePath || "diagnostics-manifest.json",
|
|
1726
|
-
warningCount: 1,
|
|
1727
|
-
warnings: ["diagnostics sidecar manifest is missing"],
|
|
1728
|
-
};
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
const { value: manifest, error } = readJsonResult(manifestPath);
|
|
1732
|
-
if (error) {
|
|
1733
|
-
return {
|
|
1734
|
-
status: "invalid",
|
|
1735
|
-
path: relativePath,
|
|
1736
|
-
warningCount: 1,
|
|
1737
|
-
warnings: [`failed to read diagnostics sidecar manifest: ${error.message}`],
|
|
1738
|
-
};
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
const warnings = [];
|
|
1742
|
-
if (manifest?.contract !== BUILDCHAIN_DIAGNOSTICS_MANIFEST_CONTRACT) {
|
|
1743
|
-
warnings.push(`unexpected diagnostics sidecar manifest contract: ${manifest?.contract || "unknown"}`);
|
|
1744
|
-
}
|
|
1745
|
-
const files = Array.isArray(manifest?.files) ? manifest.files.map(compactDiagnosticsManifestFile) : [];
|
|
1746
|
-
if (!Array.isArray(manifest?.files)) {
|
|
1747
|
-
warnings.push("diagnostics sidecar manifest files must be an array");
|
|
1748
|
-
}
|
|
1749
|
-
const diagnosticsEntry = files.find((entry) => entry.kind === "diagnostics");
|
|
1750
|
-
if (!diagnosticsEntry) {
|
|
1751
|
-
warnings.push("diagnostics sidecar manifest does not list diagnostics.json");
|
|
1752
|
-
} else {
|
|
1753
|
-
const stat = fs.statSync(sourcePath);
|
|
1754
|
-
const digest = sha256File(sourcePath);
|
|
1755
|
-
if (diagnosticsEntry.bytes !== stat.size) {
|
|
1756
|
-
warnings.push("diagnostics sidecar manifest bytes do not match diagnostics.json");
|
|
1757
|
-
}
|
|
1758
|
-
if (diagnosticsEntry.sha256 && diagnosticsEntry.sha256 !== digest) {
|
|
1759
|
-
warnings.push("diagnostics sidecar manifest sha256 does not match diagnostics.json");
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
return {
|
|
1764
|
-
status: warnings.length ? "warning" : "verified",
|
|
1765
|
-
path: relativePath,
|
|
1766
|
-
artifactName: manifest?.artifactName || "",
|
|
1767
|
-
diagnosticsArtifactName: manifest?.diagnosticsArtifactName || "",
|
|
1768
|
-
platformId: manifest?.platformId || "",
|
|
1769
|
-
fileCount: Number(manifest?.fileCount || files.length),
|
|
1770
|
-
totalBytes: Number(manifest?.totalBytes || files.reduce((sum, entry) => sum + entry.bytes, 0)),
|
|
1771
|
-
files,
|
|
1772
|
-
warningCount: warnings.length,
|
|
1773
|
-
warnings,
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
function formatDiagnosticsSummaryRows(rows = []) {
|
|
1778
|
-
const widths = rows[0].map((_, columnIndex) => (
|
|
1779
|
-
Math.max(...rows.map((row) => String(row[columnIndex] ?? "").length))
|
|
1780
|
-
));
|
|
1781
|
-
return rows
|
|
1782
|
-
.map((row) => row.map((cell, index) => String(cell ?? "").padEnd(widths[index], " ")).join(" ").trimEnd())
|
|
1783
|
-
.join("\n");
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
export function formatDiagnosticsSummaryTable(summary = {}) {
|
|
1787
|
-
const rows = [[
|
|
1788
|
-
"platform",
|
|
1789
|
-
"head",
|
|
1790
|
-
"install",
|
|
1791
|
-
"build",
|
|
1792
|
-
"verify",
|
|
1793
|
-
"publish",
|
|
1794
|
-
"scan",
|
|
1795
|
-
"upload",
|
|
1796
|
-
"total",
|
|
1797
|
-
"jobs",
|
|
1798
|
-
"active",
|
|
1799
|
-
"warn",
|
|
1800
|
-
"err",
|
|
1801
|
-
]];
|
|
1802
|
-
for (const platform of summary.platforms || []) {
|
|
1803
|
-
const label = `${platform.runner || "unknown"}/${platform.arch || "unknown"}`;
|
|
1804
|
-
const processSummary = compactProcessSummary(platform.process);
|
|
1805
|
-
rows.push([
|
|
1806
|
-
label,
|
|
1807
|
-
platform.gitHead ? platform.gitHead.slice(0, 12) : "-",
|
|
1808
|
-
formatDiagnosticsDurationMs(stageDurationMs(platform.lifecycle, "install")),
|
|
1809
|
-
formatDiagnosticsDurationMs(stageDurationMs(platform.lifecycle, "build")),
|
|
1810
|
-
formatDiagnosticsDurationMs(stageDurationMs(platform.lifecycle, "verify")),
|
|
1811
|
-
formatDiagnosticsDurationMs(stageDurationMs(platform.lifecycle, "publish")),
|
|
1812
|
-
formatDiagnosticsDurationMs(platform.artifactScanDurationMs),
|
|
1813
|
-
formatDiagnosticsDurationMs(platform.artifactUploadDurationMs),
|
|
1814
|
-
formatDiagnosticsDurationMs(platform.totalDurationMs),
|
|
1815
|
-
formatDiagnosticsProcessValue(processSummary.requestedParallelism),
|
|
1816
|
-
formatDiagnosticsProcessValue(processSummary.observedConcurrencyMax),
|
|
1817
|
-
platform.warningCount || 0,
|
|
1818
|
-
platform.errorCount || 0,
|
|
1819
|
-
]);
|
|
1820
|
-
}
|
|
1821
|
-
return formatDiagnosticsSummaryRows(rows);
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
export function summarizeDiagnosticsArtifacts(inputs = []) {
|
|
1825
|
-
const diagnostics = inputs
|
|
1826
|
-
.map(resolveDiagnosticsInput)
|
|
1827
|
-
.filter((entry) => entry.diagnostics);
|
|
1828
|
-
const platforms = diagnostics.map(({ diagnostics: entry, sourcePath }) => {
|
|
1829
|
-
const lifecycle = entry.lifecycleObservability?.stages || {};
|
|
1830
|
-
const lifecycleTotalDurationMs = sumLifecycleDurationMs(lifecycle);
|
|
1831
|
-
const artifactScanDurationMs = Math.round(Number(entry.lifecycleObservability?.artifactScan?.durationMs || 0));
|
|
1832
|
-
const artifactUploadDurationMs = Math.round(Number(entry.lifecycleObservability?.artifactUpload?.durationMs || 0));
|
|
1833
|
-
const diagnosticsContract = summarizeDiagnosticsContract(entry);
|
|
1834
|
-
const diagnosticsManifest = summarizeDiagnosticsManifest(entry, sourcePath);
|
|
1835
|
-
return {
|
|
1836
|
-
runner: entry.runner?.github?.runnerOs || entry.runner?.os?.platform || "unknown",
|
|
1837
|
-
arch: entry.runner?.github?.runnerArch || entry.runner?.os?.arch || "unknown",
|
|
1838
|
-
gitHead: entry.git?.head || "",
|
|
1839
|
-
lifecycle,
|
|
1840
|
-
lifecycleTotalDurationMs,
|
|
1841
|
-
artifactScanDurationMs,
|
|
1842
|
-
artifactUploadDurationMs,
|
|
1843
|
-
totalDurationMs: lifecycleTotalDurationMs + artifactScanDurationMs + artifactUploadDurationMs,
|
|
1844
|
-
totalBytes: Number(entry.lifecycleObservability?.totalBytes || 0),
|
|
1845
|
-
fileCount: Number(entry.lifecycleObservability?.fileCount || 0),
|
|
1846
|
-
topSlowSpans: (entry.lifecycleObservability?.topSlowSpans || []).slice(0, 5),
|
|
1847
|
-
runnerDetails: compactRunnerDetails(entry.runner || {}),
|
|
1848
|
-
tools: compactToolSummary(entry.tools || {}, entry.native?.tools || {}),
|
|
1849
|
-
cache: compactCacheSummary(entry.cache || {}, entry.native || {}),
|
|
1850
|
-
compilerCaches: compactCompilerCacheSummary(entry.compilerCaches || entry.native?.compilerCaches || entry.cache?.compilerCaches || {}),
|
|
1851
|
-
nativeCacheDirs: Array.isArray(entry.nativeCacheDirs)
|
|
1852
|
-
? entry.nativeCacheDirs
|
|
1853
|
-
: Array.isArray(entry.native?.cacheDirs)
|
|
1854
|
-
? entry.native.cacheDirs
|
|
1855
|
-
: [],
|
|
1856
|
-
process: entry.process || {},
|
|
1857
|
-
sourceCheckout: entry.sourceCheckout
|
|
1858
|
-
? {
|
|
1859
|
-
mode: entry.sourceCheckout.policy?.mode || "",
|
|
1860
|
-
transport: entry.sourceCheckout.cache?.transport || "",
|
|
1861
|
-
hit: Boolean(entry.sourceCheckout.cache?.hit),
|
|
1862
|
-
fallbackUsed: Boolean(entry.sourceCheckout.cache?.fallbackUsed),
|
|
1863
|
-
fallbackReason: entry.sourceCheckout.cache?.fallbackReason || "",
|
|
1864
|
-
durationMs: Number(entry.sourceCheckout.durationMs || 0),
|
|
1865
|
-
headOk: Boolean(entry.sourceCheckout.verification?.headOk),
|
|
1866
|
-
treeOk: Boolean(entry.sourceCheckout.verification?.treeOk),
|
|
1867
|
-
}
|
|
1868
|
-
: undefined,
|
|
1869
|
-
diagnosticsContract,
|
|
1870
|
-
...(diagnosticsManifest ? { diagnosticsManifest } : {}),
|
|
1871
|
-
links: entry.links || {},
|
|
1872
|
-
warningCount: entry.lifecycleObservability?.warningCount || 0,
|
|
1873
|
-
errorCount: entry.lifecycleObservability?.errorCount || 0,
|
|
1874
|
-
};
|
|
1875
|
-
});
|
|
1876
|
-
return {
|
|
1877
|
-
schemaVersion: 1,
|
|
1878
|
-
contract: BUILDCHAIN_DIAGNOSTICS_SUMMARY_CONTRACT,
|
|
1879
|
-
generatedAt: new Date().toISOString(),
|
|
1880
|
-
count: diagnostics.length,
|
|
1881
|
-
totalWarningCount: platforms.reduce((sum, entry) => sum + entry.warningCount, 0),
|
|
1882
|
-
totalErrorCount: platforms.reduce((sum, entry) => sum + entry.errorCount, 0),
|
|
1883
|
-
diagnosticsManifestWarningCount: platforms.reduce(
|
|
1884
|
-
(sum, entry) => sum + Number(entry.diagnosticsManifest?.warningCount || 0),
|
|
1885
|
-
0,
|
|
1886
|
-
),
|
|
1887
|
-
diagnosticsContractWarningCount: platforms.reduce(
|
|
1888
|
-
(sum, entry) => sum + Number(entry.diagnosticsContract?.warningCount || 0),
|
|
1889
|
-
0,
|
|
1890
|
-
),
|
|
1891
|
-
slowestPlatforms: platforms
|
|
1892
|
-
.map(({ runner, arch, gitHead, lifecycleTotalDurationMs, totalDurationMs, process }) => ({
|
|
1893
|
-
runner,
|
|
1894
|
-
arch,
|
|
1895
|
-
gitHead,
|
|
1896
|
-
lifecycleTotalDurationMs,
|
|
1897
|
-
totalDurationMs,
|
|
1898
|
-
process: compactProcessSummary(process),
|
|
1899
|
-
}))
|
|
1900
|
-
.sort((left, right) => right.totalDurationMs - left.totalDurationMs)
|
|
1901
|
-
.slice(0, 10),
|
|
1902
|
-
platforms,
|
|
1903
|
-
};
|
|
1904
|
-
}
|