@empire-builder-kit/nx 1.0.0-beta.9 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +6 -0
- package/README.md +113 -3
- package/executors.json +30 -0
- package/package.json +84 -6
- package/src/api-contract/baseline-update.d.ts +82 -0
- package/src/api-contract/baseline-update.js +225 -0
- package/src/api-contract/baseline-update.js.map +1 -0
- package/src/api-contract/compatibility.d.ts +30 -0
- package/src/api-contract/compatibility.js +643 -0
- package/src/api-contract/compatibility.js.map +1 -0
- package/src/api-contract/contract-graph.d.ts +35 -0
- package/src/api-contract/contract-graph.js +141 -0
- package/src/api-contract/contract-graph.js.map +1 -0
- package/src/api-contract/evidence.d.ts +23 -0
- package/src/api-contract/evidence.js +87 -0
- package/src/api-contract/evidence.js.map +1 -0
- package/src/api-contract/index.d.ts +6 -0
- package/src/api-contract/index.js +10 -0
- package/src/api-contract/index.js.map +1 -0
- package/src/api-contract/model.d.ts +144 -0
- package/src/api-contract/model.fixtures.d.ts +2 -0
- package/src/api-contract/model.fixtures.js +81 -0
- package/src/api-contract/model.fixtures.js.map +1 -0
- package/src/api-contract/model.js +993 -0
- package/src/api-contract/model.js.map +1 -0
- package/src/api-contract/rollout.d.ts +32 -0
- package/src/api-contract/rollout.js +88 -0
- package/src/api-contract/rollout.js.map +1 -0
- package/src/authorization/compatibility.d.ts +62 -0
- package/src/authorization/compatibility.js +175 -0
- package/src/authorization/compatibility.js.map +1 -0
- package/src/authorization/index.d.ts +1 -0
- package/src/authorization/index.js +5 -0
- package/src/authorization/index.js.map +1 -0
- package/src/blueprints/execution.d.ts +25 -1
- package/src/blueprints/execution.js +246 -83
- package/src/blueprints/execution.js.map +1 -1
- package/src/blueprints/external-sandbox.d.ts +53 -0
- package/src/blueprints/external-sandbox.js +1182 -0
- package/src/blueprints/external-sandbox.js.map +1 -0
- package/src/blueprints/manifest.d.ts +42 -2
- package/src/blueprints/manifest.js +82 -27
- package/src/blueprints/manifest.js.map +1 -1
- package/src/blueprints/resolver.d.ts +14 -5
- package/src/blueprints/resolver.js +228 -68
- package/src/blueprints/resolver.js.map +1 -1
- package/src/cli/agent-command.d.ts +30 -0
- package/src/cli/agent-command.js +204 -0
- package/src/cli/agent-command.js.map +1 -0
- package/src/cli/agent-runtime.d.ts +25 -0
- package/src/cli/agent-runtime.js +488 -0
- package/src/cli/agent-runtime.js.map +1 -0
- package/src/cli/blueprint-authority.d.ts +9 -0
- package/src/cli/blueprint-authority.js +43 -0
- package/src/cli/blueprint-authority.js.map +1 -0
- package/src/cli/blueprint-command.d.ts +24 -0
- package/src/cli/blueprint-command.js +63 -0
- package/src/cli/blueprint-command.js.map +1 -0
- package/src/cli/bootstrap.d.ts +31 -0
- package/src/cli/bootstrap.js +165 -0
- package/src/cli/bootstrap.js.map +1 -0
- package/src/cli/dev-command.d.ts +92 -0
- package/src/cli/dev-command.js +561 -0
- package/src/cli/dev-command.js.map +1 -0
- package/src/cli/main.d.ts +131 -0
- package/src/cli/main.js +1199 -0
- package/src/cli/main.js.map +1 -0
- package/src/cli/output.d.ts +19 -0
- package/src/cli/output.js +51 -0
- package/src/cli/output.js.map +1 -0
- package/src/cli/personal-secret-runtime.d.ts +81 -0
- package/src/cli/personal-secret-runtime.js +567 -0
- package/src/cli/personal-secret-runtime.js.map +1 -0
- package/src/cli/secret-terminal.d.ts +12 -0
- package/src/cli/secret-terminal.js +128 -0
- package/src/cli/secret-terminal.js.map +1 -0
- package/src/container-images.d.ts +1 -0
- package/src/container-images.js +5 -0
- package/src/container-images.js.map +1 -0
- package/src/data-lifecycle/index.d.ts +3 -0
- package/src/data-lifecycle/index.js +7 -0
- package/src/data-lifecycle/index.js.map +1 -0
- package/src/data-lifecycle/model.d.ts +172 -0
- package/src/data-lifecycle/model.fixtures.d.ts +2 -0
- package/src/data-lifecycle/model.fixtures.js +244 -0
- package/src/data-lifecycle/model.fixtures.js.map +1 -0
- package/src/data-lifecycle/model.js +95 -0
- package/src/data-lifecycle/model.js.map +1 -0
- package/src/data-lifecycle/sensitive-artifacts.d.ts +28 -0
- package/src/data-lifecycle/sensitive-artifacts.js +146 -0
- package/src/data-lifecycle/sensitive-artifacts.js.map +1 -0
- package/src/data-lifecycle/validation.d.ts +32 -0
- package/src/data-lifecycle/validation.js +837 -0
- package/src/data-lifecycle/validation.js.map +1 -0
- package/src/database-retirement/contract.d.ts +68 -0
- package/src/database-retirement/contract.js +166 -0
- package/src/database-retirement/contract.js.map +1 -0
- package/src/database-retirement/index.d.ts +1 -0
- package/src/database-retirement/index.js +5 -0
- package/src/database-retirement/index.js.map +1 -0
- package/src/deterministic-order.d.ts +2 -0
- package/src/deterministic-order.js +7 -0
- package/src/deterministic-order.js.map +1 -0
- package/src/developer-agent/context.d.ts +27 -0
- package/src/developer-agent/context.js +497 -0
- package/src/developer-agent/context.js.map +1 -0
- package/src/developer-agent/generator-planning.d.ts +34 -0
- package/src/developer-agent/generator-planning.js +645 -0
- package/src/developer-agent/generator-planning.js.map +1 -0
- package/src/developer-agent/generator-preview.d.ts +8 -0
- package/src/developer-agent/generator-preview.js +650 -0
- package/src/developer-agent/generator-preview.js.map +1 -0
- package/src/developer-agent/git-inspection.d.ts +108 -0
- package/src/developer-agent/git-inspection.js +815 -0
- package/src/developer-agent/git-inspection.js.map +1 -0
- package/src/developer-agent/handoff.d.ts +43 -0
- package/src/developer-agent/handoff.js +698 -0
- package/src/developer-agent/handoff.js.map +1 -0
- package/src/developer-agent/index.d.ts +10 -0
- package/src/developer-agent/index.js +14 -0
- package/src/developer-agent/index.js.map +1 -0
- package/src/developer-agent/model.d.ts +481 -0
- package/src/developer-agent/model.js +143 -0
- package/src/developer-agent/model.js.map +1 -0
- package/src/developer-agent/operation-registry.d.ts +45 -0
- package/src/developer-agent/operation-registry.js +1255 -0
- package/src/developer-agent/operation-registry.js.map +1 -0
- package/src/developer-agent/ordering.d.ts +9 -0
- package/src/developer-agent/ordering.js +15 -0
- package/src/developer-agent/ordering.js.map +1 -0
- package/src/developer-agent/planning.d.ts +18 -0
- package/src/developer-agent/planning.js +447 -0
- package/src/developer-agent/planning.js.map +1 -0
- package/src/developer-agent/preview-changes.d.ts +26 -0
- package/src/developer-agent/preview-changes.js +203 -0
- package/src/developer-agent/preview-changes.js.map +1 -0
- package/src/developer-agent/preview-source.d.ts +2 -0
- package/src/developer-agent/preview-source.js +16 -0
- package/src/developer-agent/preview-source.js.map +1 -0
- package/src/developer-agent/validation.d.ts +18 -0
- package/src/developer-agent/validation.js +2617 -0
- package/src/developer-agent/validation.js.map +1 -0
- package/src/developer-agent/workspace-inspection.d.ts +20 -0
- package/src/developer-agent/workspace-inspection.js +1134 -0
- package/src/developer-agent/workspace-inspection.js.map +1 -0
- package/src/developer-agent/workspace-path.d.ts +6 -0
- package/src/developer-agent/workspace-path.js +22 -0
- package/src/developer-agent/workspace-path.js.map +1 -0
- package/src/executors/blueprint-trust/blueprint-trust.d.ts +29 -0
- package/src/executors/blueprint-trust/blueprint-trust.js +115 -0
- package/src/executors/blueprint-trust/blueprint-trust.js.map +1 -0
- package/src/executors/blueprint-trust/schema.json +27 -0
- package/src/executors/blueprint-verification/blueprint-verification.d.ts +13 -0
- package/src/executors/blueprint-verification/blueprint-verification.js +110 -0
- package/src/executors/blueprint-verification/blueprint-verification.js.map +1 -0
- package/src/executors/blueprint-verification/schema.json +44 -0
- package/src/executors/deployment-plan/deployment-plan.js +1 -0
- package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
- package/src/executors/dev-doctor/dev-doctor.d.ts +19 -5
- package/src/executors/dev-doctor/dev-doctor.js +186 -32
- package/src/executors/dev-doctor/dev-doctor.js.map +1 -1
- package/src/executors/dev-doctor/schema.json +1 -6
- package/src/executors/dev-setup/dev-setup.d.ts +7 -1
- package/src/executors/dev-setup/dev-setup.js +14 -3
- package/src/executors/dev-setup/dev-setup.js.map +1 -1
- package/src/executors/developer-context/developer-context.d.ts +38 -0
- package/src/executors/developer-context/developer-context.js +78 -0
- package/src/executors/developer-context/developer-context.js.map +1 -0
- package/src/executors/developer-context/schema.json +87 -0
- package/src/executors/fleet/fleet.d.ts +12 -43
- package/src/executors/fleet/fleet.js +120 -500
- package/src/executors/fleet/fleet.js.map +1 -1
- package/src/executors/fleet/schema.json +64 -14
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -1
- package/src/executors/github-bootstrap/schema.json +5 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +144 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.js +3320 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -0
- package/src/executors/infrastructure-plan/schema.json +78 -0
- package/src/executors/secret-guardrails/schema.json +6 -0
- package/src/executors/secret-guardrails/secret-guardrails.d.ts +3 -0
- package/src/executors/secret-guardrails/secret-guardrails.js +44 -0
- package/src/executors/secret-guardrails/secret-guardrails.js.map +1 -0
- package/src/executors/secret-metadata/schema.json +31 -0
- package/src/executors/secret-metadata/secret-metadata.d.ts +32 -0
- package/src/executors/secret-metadata/secret-metadata.js +131 -0
- package/src/executors/secret-metadata/secret-metadata.js.map +1 -0
- package/src/executors/sst-lifecycle/logging-preflight.d.ts +17 -0
- package/src/executors/sst-lifecycle/logging-preflight.js +196 -0
- package/src/executors/sst-lifecycle/logging-preflight.js.map +1 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +23 -3
- package/src/executors/sst-lifecycle/run-sst-command.js +113 -10
- package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
- package/src/executors/sst-lifecycle/schema.json +9 -5
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +25 -0
- package/src/executors/sst-lifecycle/secret-preflight.js +119 -0
- package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -0
- package/src/foundation/discovery.d.ts +17 -1
- package/src/foundation/discovery.js +16 -1
- package/src/foundation/discovery.js.map +1 -1
- package/src/foundation/index.d.ts +3 -0
- package/src/foundation/index.js +3 -0
- package/src/foundation/index.js.map +1 -1
- package/src/foundation/local-database-contract.d.ts +1 -0
- package/src/foundation/local-database-contract.js +3 -0
- package/src/foundation/local-database-contract.js.map +1 -1
- package/src/foundation/logging-preflight.d.ts +30 -0
- package/src/foundation/logging-preflight.js +138 -0
- package/src/foundation/logging-preflight.js.map +1 -0
- package/src/foundation/logging.d.ts +70 -0
- package/src/foundation/logging.js +133 -0
- package/src/foundation/logging.js.map +1 -0
- package/src/foundation/preflight.d.ts +9 -0
- package/src/foundation/preflight.js +58 -2
- package/src/foundation/preflight.js.map +1 -1
- package/src/foundation/provision-database-bindings.d.ts +9 -1
- package/src/foundation/provision-database-bindings.js +25 -5
- package/src/foundation/provision-database-bindings.js.map +1 -1
- package/src/foundation/provision-logical-database.d.ts +10 -2
- package/src/foundation/provision-logical-database.js +68 -113
- package/src/foundation/provision-logical-database.js.map +1 -1
- package/src/foundation/router-origin-proof.d.ts +2 -0
- package/src/foundation/router-origin-proof.js +25 -0
- package/src/foundation/router-origin-proof.js.map +1 -0
- package/src/foundation/stages.d.ts +1 -0
- package/src/foundation/stages.js +9 -1
- package/src/foundation/stages.js.map +1 -1
- package/src/frontend-security/index.d.ts +1 -0
- package/src/frontend-security/index.js +5 -0
- package/src/frontend-security/index.js.map +1 -0
- package/src/frontend-security/security-headers.d.ts +50 -0
- package/src/frontend-security/security-headers.js +418 -0
- package/src/frontend-security/security-headers.js.map +1 -0
- package/src/generators/feature-registry.d.ts +13 -0
- package/src/generators/feature-registry.js +73 -0
- package/src/generators/feature-registry.js.map +1 -0
- package/src/generators/function/function.d.ts +1 -1
- package/src/generators/function/function.js +51 -6
- package/src/generators/function/function.js.map +1 -1
- package/src/generators/function/schema.d.ts +1 -0
- package/src/generators/function/schema.json +6 -1
- package/src/generators/logging-registry.d.ts +13 -0
- package/src/generators/logging-registry.js +62 -0
- package/src/generators/logging-registry.js.map +1 -0
- package/src/generators/post-generation-install.d.ts +67 -0
- package/src/generators/post-generation-install.js +3308 -0
- package/src/generators/post-generation-install.js.map +1 -0
- package/src/generators/preset/generator.js +3 -0
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/tool-versions.d.ts +18 -0
- package/src/generators/preset/tool-versions.js +22 -0
- package/src/generators/preset/tool-versions.js.map +1 -0
- package/src/generators/preset/workspace-files-developer-agent.d.ts +14 -0
- package/src/generators/preset/workspace-files-developer-agent.js +511 -0
- package/src/generators/preset/workspace-files-developer-agent.js.map +1 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +6 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.js +406 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-cost.d.ts +66 -0
- package/src/generators/preset/workspace-files-performance-cost.js +866 -0
- package/src/generators/preset/workspace-files-performance-cost.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-load.d.ts +73 -0
- package/src/generators/preset/workspace-files-performance-load.js +801 -0
- package/src/generators/preset/workspace-files-performance-load.js.map +1 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +9 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.js +1102 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.js.map +1 -0
- package/src/generators/preset/workspace-files.d.ts +14 -1
- package/src/generators/preset/workspace-files.js +8189 -245
- package/src/generators/preset/workspace-files.js.map +1 -1
- package/src/generators/repository-policy/repository-policy.js +3 -47
- package/src/generators/repository-policy/repository-policy.js.map +1 -1
- package/src/generators/slice/built-in-plan-api-contract-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-api-contract-files.js +2656 -0
- package/src/generators/slice/built-in-plan-api-contract-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-api-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-api-files.js +1186 -0
- package/src/generators/slice/built-in-plan-api-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-async-work-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-async-work-files.js +7903 -0
- package/src/generators/slice/built-in-plan-async-work-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-authorization-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-authorization-files.js +2314 -0
- package/src/generators/slice/built-in-plan-authorization-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +559 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.js +1101 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +249 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-files.js +1530 -0
- package/src/generators/slice/built-in-plan-data-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js +750 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +828 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.js +2604 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +144 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-rights-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-rights-files.js +4628 -0
- package/src/generators/slice/built-in-plan-data-rights-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js +1901 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +485 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-foundation-files.js +184 -0
- package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-frontend-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-frontend-files.js +2233 -0
- package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js +3038 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +312 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-metadata-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-metadata-files.js +219 -0
- package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-operations-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-operations-files.js +630 -0
- package/src/generators/slice/built-in-plan-operations-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-performance-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-performance-files.js +3293 -0
- package/src/generators/slice/built-in-plan-performance-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-project-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-project-files.js +979 -0
- package/src/generators/slice/built-in-plan-project-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-release-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-release-files.js +6387 -0
- package/src/generators/slice/built-in-plan-release-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-reliability-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-reliability-files.js +4499 -0
- package/src/generators/slice/built-in-plan-reliability-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +1004 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-shared.d.ts +53 -0
- package/src/generators/slice/built-in-plan-shared.js +113 -0
- package/src/generators/slice/built-in-plan-shared.js.map +1 -0
- package/src/generators/slice/built-in-plan-testing-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-testing-files.js +2356 -0
- package/src/generators/slice/built-in-plan-testing-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-verification-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-verification-files.js +358 -0
- package/src/generators/slice/built-in-plan-verification-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-web-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-web-files.js +430 -0
- package/src/generators/slice/built-in-plan-web-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-workload-role-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-workload-role-files.js +2356 -0
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -0
- package/src/generators/slice/built-in-plan.d.ts +8 -0
- package/src/generators/slice/built-in-plan.js +264 -0
- package/src/generators/slice/built-in-plan.js.map +1 -0
- package/src/generators/slice/schema.json +1 -1
- package/src/generators/slice/slice.d.ts +1 -22
- package/src/generators/slice/slice.js +185 -1510
- package/src/generators/slice/slice.js.map +1 -1
- package/src/generators/upgrade/schema.d.ts +2 -0
- package/src/generators/upgrade/schema.json +11 -1
- package/src/generators/upgrade/upgrade.d.ts +51 -1
- package/src/generators/upgrade/upgrade.js +820 -82
- package/src/generators/upgrade/upgrade.js.map +1 -1
- package/src/generators/workload/frozen-container.d.ts +8 -0
- package/src/generators/workload/frozen-container.js +36 -0
- package/src/generators/workload/frozen-container.js.map +1 -0
- package/src/generators/workload/performance-registration.d.ts +32 -0
- package/src/generators/workload/performance-registration.js +226 -0
- package/src/generators/workload/performance-registration.js.map +1 -0
- package/src/generators/workload/reliability-registration.d.ts +16 -0
- package/src/generators/workload/reliability-registration.js +150 -0
- package/src/generators/workload/reliability-registration.js.map +1 -0
- package/src/generators/workload/schema.d.ts +1 -0
- package/src/generators/workload/schema.json +6 -1
- package/src/generators/workload/service-performance-files.d.ts +4 -0
- package/src/generators/workload/service-performance-files.js +1846 -0
- package/src/generators/workload/service-performance-files.js.map +1 -0
- package/src/generators/workload/workload.d.ts +3 -2
- package/src/generators/workload/workload.js +1083 -18
- package/src/generators/workload/workload.js.map +1 -1
- package/src/git-policy/action-pins.d.ts +10 -0
- package/src/git-policy/action-pins.js +10 -0
- package/src/git-policy/action-pins.js.map +1 -1
- package/src/git-policy/github-bootstrap.d.ts +14 -1
- package/src/git-policy/github-bootstrap.js +274 -46
- package/src/git-policy/github-bootstrap.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/infrastructure-change/convergence.d.ts +13 -0
- package/src/infrastructure-change/convergence.js +85 -0
- package/src/infrastructure-change/convergence.js.map +1 -0
- package/src/infrastructure-change/drift.d.ts +13 -0
- package/src/infrastructure-change/drift.js +112 -0
- package/src/infrastructure-change/drift.js.map +1 -0
- package/src/infrastructure-change/index.d.ts +7 -0
- package/src/infrastructure-change/index.js +11 -0
- package/src/infrastructure-change/index.js.map +1 -0
- package/src/infrastructure-change/model.d.ts +253 -0
- package/src/infrastructure-change/model.js +28 -0
- package/src/infrastructure-change/model.js.map +1 -0
- package/src/infrastructure-change/normalize.d.ts +12 -0
- package/src/infrastructure-change/normalize.js +245 -0
- package/src/infrastructure-change/normalize.js.map +1 -0
- package/src/infrastructure-change/plan.d.ts +40 -0
- package/src/infrastructure-change/plan.js +361 -0
- package/src/infrastructure-change/plan.js.map +1 -0
- package/src/infrastructure-change/risk.d.ts +7 -0
- package/src/infrastructure-change/risk.js +269 -0
- package/src/infrastructure-change/risk.js.map +1 -0
- package/src/infrastructure-change/summary.d.ts +20 -0
- package/src/infrastructure-change/summary.js +130 -0
- package/src/infrastructure-change/summary.js.map +1 -0
- package/src/local-dev/context-discovery.d.ts +2 -0
- package/src/local-dev/context-discovery.js +59 -0
- package/src/local-dev/context-discovery.js.map +1 -0
- package/src/local-dev/contract-validation.d.ts +15 -0
- package/src/local-dev/contract-validation.js +84 -0
- package/src/local-dev/contract-validation.js.map +1 -0
- package/src/local-dev/contracts.d.ts +10 -1
- package/src/local-dev/contracts.js +57 -5
- package/src/local-dev/contracts.js.map +1 -1
- package/src/local-dev/control-contract.d.ts +67 -0
- package/src/local-dev/control-contract.js +180 -0
- package/src/local-dev/control-contract.js.map +1 -0
- package/src/local-dev/dev-command-core.d.ts +60 -0
- package/src/local-dev/dev-command-core.js +89 -0
- package/src/local-dev/dev-command-core.js.map +1 -0
- package/src/local-dev/effects.d.ts +16 -0
- package/src/local-dev/effects.js +63 -0
- package/src/local-dev/effects.js.map +1 -0
- package/src/local-dev/environment-inspector.d.ts +125 -0
- package/src/local-dev/environment-inspector.js +687 -0
- package/src/local-dev/environment-inspector.js.map +1 -0
- package/src/local-dev/environment-state.d.ts +113 -0
- package/src/local-dev/environment-state.js +463 -0
- package/src/local-dev/environment-state.js.map +1 -0
- package/src/local-dev/errors.d.ts +6 -0
- package/src/local-dev/errors.js +41 -0
- package/src/local-dev/errors.js.map +1 -0
- package/src/local-dev/fleet-client.d.ts +33 -0
- package/src/local-dev/fleet-client.js +156 -0
- package/src/local-dev/fleet-client.js.map +1 -0
- package/src/local-dev/fleet-configuration.d.ts +13 -0
- package/src/local-dev/fleet-configuration.js +71 -0
- package/src/local-dev/fleet-configuration.js.map +1 -0
- package/src/local-dev/fleet-inventory.d.ts +56 -0
- package/src/local-dev/fleet-inventory.js +469 -0
- package/src/local-dev/fleet-inventory.js.map +1 -0
- package/src/local-dev/fleet-ipc.d.ts +28 -0
- package/src/local-dev/fleet-ipc.js +267 -0
- package/src/local-dev/fleet-ipc.js.map +1 -0
- package/src/local-dev/fleet-launcher.d.ts +53 -0
- package/src/local-dev/fleet-launcher.js +379 -0
- package/src/local-dev/fleet-launcher.js.map +1 -0
- package/src/local-dev/fleet-lock.d.ts +41 -0
- package/src/local-dev/fleet-lock.js +135 -0
- package/src/local-dev/fleet-lock.js.map +1 -0
- package/src/local-dev/fleet-logs.d.ts +66 -0
- package/src/local-dev/fleet-logs.js +542 -0
- package/src/local-dev/fleet-logs.js.map +1 -0
- package/src/local-dev/fleet-process.d.ts +50 -0
- package/src/local-dev/fleet-process.js +289 -0
- package/src/local-dev/fleet-process.js.map +1 -0
- package/src/local-dev/fleet-runtime.d.ts +22 -0
- package/src/local-dev/fleet-runtime.js +368 -0
- package/src/local-dev/fleet-runtime.js.map +1 -0
- package/src/local-dev/fleet-session.d.ts +70 -0
- package/src/local-dev/fleet-session.js +301 -0
- package/src/local-dev/fleet-session.js.map +1 -0
- package/src/local-dev/fleet-slice-runner-daemon.d.ts +1 -0
- package/src/local-dev/fleet-slice-runner-daemon.js +21 -0
- package/src/local-dev/fleet-slice-runner-daemon.js.map +1 -0
- package/src/local-dev/fleet-startup.d.ts +22 -0
- package/src/local-dev/fleet-startup.js +114 -0
- package/src/local-dev/fleet-startup.js.map +1 -0
- package/src/local-dev/fleet-state.d.ts +62 -0
- package/src/local-dev/fleet-state.js +297 -0
- package/src/local-dev/fleet-state.js.map +1 -0
- package/src/local-dev/fleet-supervisor-daemon.d.ts +1 -0
- package/src/local-dev/fleet-supervisor-daemon.js +41 -0
- package/src/local-dev/fleet-supervisor-daemon.js.map +1 -0
- package/src/local-dev/fleet-supervisor.d.ts +52 -0
- package/src/local-dev/fleet-supervisor.js +384 -0
- package/src/local-dev/fleet-supervisor.js.map +1 -0
- package/src/local-dev/gateway.js +1 -1
- package/src/local-dev/gateway.js.map +1 -1
- package/src/local-dev/identity.js +4 -6
- package/src/local-dev/identity.js.map +1 -1
- package/src/local-dev/index.d.ts +1 -0
- package/src/local-dev/index.js +1 -0
- package/src/local-dev/index.js.map +1 -1
- package/src/local-dev/local-context.d.ts +62 -0
- package/src/local-dev/local-context.js +299 -0
- package/src/local-dev/local-context.js.map +1 -0
- package/src/local-dev/nx-workspace.d.ts +45 -0
- package/src/local-dev/nx-workspace.js +228 -0
- package/src/local-dev/nx-workspace.js.map +1 -0
- package/src/local-dev/personal-secret-ledger.d.ts +75 -0
- package/src/local-dev/personal-secret-ledger.js +391 -0
- package/src/local-dev/personal-secret-ledger.js.map +1 -0
- package/src/local-dev/personal-stage.d.ts +18 -0
- package/src/local-dev/personal-stage.js +129 -0
- package/src/local-dev/personal-stage.js.map +1 -0
- package/src/local-dev/private-state.d.ts +17 -0
- package/src/local-dev/private-state.js +254 -0
- package/src/local-dev/private-state.js.map +1 -0
- package/src/local-dev/process-identity.d.ts +9 -0
- package/src/local-dev/process-identity.js +79 -0
- package/src/local-dev/process-identity.js.map +1 -0
- package/src/local-dev/runtime-paths.d.ts +17 -0
- package/src/local-dev/runtime-paths.js +33 -0
- package/src/local-dev/runtime-paths.js.map +1 -0
- package/src/local-dev/secret-slice-claim.d.ts +17 -0
- package/src/local-dev/secret-slice-claim.js +75 -0
- package/src/local-dev/secret-slice-claim.js.map +1 -0
- package/src/local-dev/slice-claim.d.ts +36 -0
- package/src/local-dev/slice-claim.js +199 -0
- package/src/local-dev/slice-claim.js.map +1 -0
- package/src/local-dev/slice-runner.d.ts +121 -0
- package/src/local-dev/slice-runner.js +715 -0
- package/src/local-dev/slice-runner.js.map +1 -0
- package/src/local-dev/tls.js +51 -17
- package/src/local-dev/tls.js.map +1 -1
- package/src/ownership/composition.d.ts +5 -2
- package/src/ownership/composition.js +26 -3
- package/src/ownership/composition.js.map +1 -1
- package/src/ownership/hash.d.ts +1 -1
- package/src/ownership/hash.js +3 -1
- package/src/ownership/hash.js.map +1 -1
- package/src/ownership/record.d.ts +32 -1
- package/src/ownership/record.js +139 -2
- package/src/ownership/record.js.map +1 -1
- package/src/performance/cost-collection.d.ts +225 -0
- package/src/performance/cost-collection.js +825 -0
- package/src/performance/cost-collection.js.map +1 -0
- package/src/performance/cost-controls.d.ts +131 -0
- package/src/performance/cost-controls.js +336 -0
- package/src/performance/cost-controls.js.map +1 -0
- package/src/performance/evidence.d.ts +140 -0
- package/src/performance/evidence.js +599 -0
- package/src/performance/evidence.js.map +1 -0
- package/src/performance/index.d.ts +10 -0
- package/src/performance/index.js +14 -0
- package/src/performance/index.js.map +1 -0
- package/src/performance/load-safety.d.ts +84 -0
- package/src/performance/load-safety.js +346 -0
- package/src/performance/load-safety.js.map +1 -0
- package/src/performance/model.d.ts +129 -0
- package/src/performance/model.js +452 -0
- package/src/performance/model.js.map +1 -0
- package/src/performance/pr-artifact-budget.d.ts +42 -0
- package/src/performance/pr-artifact-budget.js +151 -0
- package/src/performance/pr-artifact-budget.js.map +1 -0
- package/src/performance/runner.d.ts +75 -0
- package/src/performance/runner.js +227 -0
- package/src/performance/runner.js.map +1 -0
- package/src/performance/scenario-endpoint.d.ts +1 -0
- package/src/performance/scenario-endpoint.js +5 -0
- package/src/performance/scenario-endpoint.js.map +1 -0
- package/src/performance/scenario.d.ts +193 -0
- package/src/performance/scenario.js +736 -0
- package/src/performance/scenario.js.map +1 -0
- package/src/performance/test-fixtures.d.ts +7 -0
- package/src/performance/test-fixtures.js +169 -0
- package/src/performance/test-fixtures.js.map +1 -0
- package/src/performance/unit-cost.d.ts +105 -0
- package/src/performance/unit-cost.js +364 -0
- package/src/performance/unit-cost.js.map +1 -0
- package/src/release/index.d.ts +4 -0
- package/src/release/index.js +8 -0
- package/src/release/index.js.map +1 -0
- package/src/release/lifecycle.d.ts +132 -0
- package/src/release/lifecycle.js +411 -0
- package/src/release/lifecycle.js.map +1 -0
- package/src/release/manifest.d.ts +148 -0
- package/src/release/manifest.js +503 -0
- package/src/release/manifest.js.map +1 -0
- package/src/release/rollout.d.ts +170 -0
- package/src/release/rollout.js +578 -0
- package/src/release/rollout.js.map +1 -0
- package/src/release/source-authority.d.ts +19 -0
- package/src/release/source-authority.js +195 -0
- package/src/release/source-authority.js.map +1 -0
- package/src/repository-policy/deployment-plan.d.ts +2 -1
- package/src/repository-policy/deployment-plan.js +2 -0
- package/src/repository-policy/deployment-plan.js.map +1 -1
- package/src/repository-policy/policy.d.ts +1 -1
- package/src/repository-policy/policy.js +29 -25
- package/src/repository-policy/policy.js.map +1 -1
- package/src/schemas/aggregate-count-evidence-v1.json +135 -0
- package/src/schemas/api-contract-baseline-v1.json +674 -0
- package/src/schemas/api-contract-compatibility-report-v1.json +126 -0
- package/src/schemas/aws-billing-actual-evidence-v1.json +407 -0
- package/src/schemas/blueprint-v1.json +18 -1
- package/src/schemas/data-lifecycle-policy-v1.json +517 -0
- package/src/schemas/generated-ownership-v2.json +22 -0
- package/src/schemas/performance-policy-v1.json +335 -0
- package/src/schemas/repository-policy-v1.json +1 -0
- package/src/schemas/testing-evidence-quarantine-v1.json +168 -0
- package/src/schemas/testing-evidence-result-v1.json +319 -0
- package/src/secrets/adapters.d.ts +49 -0
- package/src/secrets/adapters.js +184 -0
- package/src/secrets/adapters.js.map +1 -0
- package/src/secrets/aws-control-plane.d.ts +20 -0
- package/src/secrets/aws-control-plane.js +255 -0
- package/src/secrets/aws-control-plane.js.map +1 -0
- package/src/secrets/declaration-verification.d.ts +11 -0
- package/src/secrets/declaration-verification.js +68 -0
- package/src/secrets/declaration-verification.js.map +1 -0
- package/src/secrets/guardrails.d.ts +26 -0
- package/src/secrets/guardrails.js +328 -0
- package/src/secrets/guardrails.js.map +1 -0
- package/src/secrets/index.d.ts +12 -0
- package/src/secrets/index.js +16 -0
- package/src/secrets/index.js.map +1 -0
- package/src/secrets/metadata.d.ts +48 -0
- package/src/secrets/metadata.js +171 -0
- package/src/secrets/metadata.js.map +1 -0
- package/src/secrets/model.d.ts +49 -0
- package/src/secrets/model.js +125 -0
- package/src/secrets/model.js.map +1 -0
- package/src/secrets/operator.d.ts +101 -0
- package/src/secrets/operator.js +229 -0
- package/src/secrets/operator.js.map +1 -0
- package/src/secrets/permissions.d.ts +34 -0
- package/src/secrets/permissions.js +86 -0
- package/src/secrets/permissions.js.map +1 -0
- package/src/secrets/personal-command.d.ts +83 -0
- package/src/secrets/personal-command.js +197 -0
- package/src/secrets/personal-command.js.map +1 -0
- package/src/secrets/personal-ledger.d.ts +21 -0
- package/src/secrets/personal-ledger.js +135 -0
- package/src/secrets/personal-ledger.js.map +1 -0
- package/src/secrets/registry.d.ts +9 -0
- package/src/secrets/registry.js +86 -0
- package/src/secrets/registry.js.map +1 -0
- package/src/secrets/verification.d.ts +18 -0
- package/src/secrets/verification.js +139 -0
- package/src/secrets/verification.js.map +1 -0
- package/src/secrets/workload-access.d.ts +46 -0
- package/src/secrets/workload-access.js +163 -0
- package/src/secrets/workload-access.js.map +1 -0
- package/src/supply-chain/action-pins.d.ts +26 -0
- package/src/supply-chain/action-pins.js +208 -0
- package/src/supply-chain/action-pins.js.map +1 -0
- package/src/supply-chain/blueprint-trust-git.d.ts +130 -0
- package/src/supply-chain/blueprint-trust-git.js +1581 -0
- package/src/supply-chain/blueprint-trust-git.js.map +1 -0
- package/src/supply-chain/blueprint-trust-process.d.ts +4 -0
- package/src/supply-chain/blueprint-trust-process.js +88 -0
- package/src/supply-chain/blueprint-trust-process.js.map +1 -0
- package/src/supply-chain/blueprint-trust.d.ts +354 -0
- package/src/supply-chain/blueprint-trust.js +1558 -0
- package/src/supply-chain/blueprint-trust.js.map +1 -0
- package/src/supply-chain/blueprint-verification-authority.d.ts +62 -0
- package/src/supply-chain/blueprint-verification-authority.js +588 -0
- package/src/supply-chain/blueprint-verification-authority.js.map +1 -0
- package/src/supply-chain/blueprint-verification-execution.d.ts +68 -0
- package/src/supply-chain/blueprint-verification-execution.js +624 -0
- package/src/supply-chain/blueprint-verification-execution.js.map +1 -0
- package/src/supply-chain/build-output.d.ts +35 -0
- package/src/supply-chain/build-output.js +398 -0
- package/src/supply-chain/build-output.js.map +1 -0
- package/src/supply-chain/common.d.ts +21 -0
- package/src/supply-chain/common.js +107 -0
- package/src/supply-chain/common.js.map +1 -0
- package/src/supply-chain/container-artifact-contract.d.ts +23 -0
- package/src/supply-chain/container-artifact-contract.js +208 -0
- package/src/supply-chain/container-artifact-contract.js.map +1 -0
- package/src/supply-chain/container-release.d.ts +119 -0
- package/src/supply-chain/container-release.js +496 -0
- package/src/supply-chain/container-release.js.map +1 -0
- package/src/supply-chain/ecr-applicability.d.ts +19 -0
- package/src/supply-chain/ecr-applicability.js +103 -0
- package/src/supply-chain/ecr-applicability.js.map +1 -0
- package/src/supply-chain/ecr-scanning.d.ts +83 -0
- package/src/supply-chain/ecr-scanning.js +321 -0
- package/src/supply-chain/ecr-scanning.js.map +1 -0
- package/src/supply-chain/ecs-deployed-image.d.ts +85 -0
- package/src/supply-chain/ecs-deployed-image.js +300 -0
- package/src/supply-chain/ecs-deployed-image.js.map +1 -0
- package/src/supply-chain/errors.d.ts +6 -0
- package/src/supply-chain/errors.js +15 -0
- package/src/supply-chain/errors.js.map +1 -0
- package/src/supply-chain/generated-blueprint-trust-command.d.ts +4 -0
- package/src/supply-chain/generated-blueprint-trust-command.js +1362 -0
- package/src/supply-chain/generated-blueprint-trust-command.js.map +1 -0
- package/src/supply-chain/generated-command.d.ts +1 -0
- package/src/supply-chain/generated-command.js +687 -0
- package/src/supply-chain/generated-command.js.map +1 -0
- package/src/supply-chain/generated-container-release-command.d.ts +16 -0
- package/src/supply-chain/generated-container-release-command.js +2087 -0
- package/src/supply-chain/generated-container-release-command.js.map +1 -0
- package/src/supply-chain/generated-ecr-collector-command.d.ts +21 -0
- package/src/supply-chain/generated-ecr-collector-command.js +1338 -0
- package/src/supply-chain/generated-ecr-collector-command.js.map +1 -0
- package/src/supply-chain/generated-files.d.ts +13 -0
- package/src/supply-chain/generated-files.js +401 -0
- package/src/supply-chain/generated-files.js.map +1 -0
- package/src/supply-chain/generated-scanner-command.d.ts +1 -0
- package/src/supply-chain/generated-scanner-command.js +718 -0
- package/src/supply-chain/generated-scanner-command.js.map +1 -0
- package/src/supply-chain/index.d.ts +28 -0
- package/src/supply-chain/index.js +35 -0
- package/src/supply-chain/index.js.map +1 -0
- package/src/supply-chain/inventory.d.ts +79 -0
- package/src/supply-chain/inventory.js +717 -0
- package/src/supply-chain/inventory.js.map +1 -0
- package/src/supply-chain/license-expression.d.ts +7 -0
- package/src/supply-chain/license-expression.js +128 -0
- package/src/supply-chain/license-expression.js.map +1 -0
- package/src/supply-chain/pnpm-toolchain-authority.d.ts +31 -0
- package/src/supply-chain/pnpm-toolchain-authority.js +316 -0
- package/src/supply-chain/pnpm-toolchain-authority.js.map +1 -0
- package/src/supply-chain/policy.d.ts +105 -0
- package/src/supply-chain/policy.js +301 -0
- package/src/supply-chain/policy.js.map +1 -0
- package/src/supply-chain/publication.d.ts +48 -0
- package/src/supply-chain/publication.js +85 -0
- package/src/supply-chain/publication.js.map +1 -0
- package/src/supply-chain/sbom.d.ts +228 -0
- package/src/supply-chain/sbom.js +826 -0
- package/src/supply-chain/sbom.js.map +1 -0
- package/src/supply-chain/scanner.d.ts +77 -0
- package/src/supply-chain/scanner.js +502 -0
- package/src/supply-chain/scanner.js.map +1 -0
- package/src/supply-chain/vendored-source.d.ts +95 -0
- package/src/supply-chain/vendored-source.js +315 -0
- package/src/supply-chain/vendored-source.js.map +1 -0
- package/src/testing-evidence/fixture-scope.d.ts +52 -0
- package/src/testing-evidence/fixture-scope.js +140 -0
- package/src/testing-evidence/fixture-scope.js.map +1 -0
- package/src/testing-evidence/index.d.ts +5 -0
- package/src/testing-evidence/index.js +9 -0
- package/src/testing-evidence/index.js.map +1 -0
- package/src/testing-evidence/quarantine.d.ts +48 -0
- package/src/testing-evidence/quarantine.js +253 -0
- package/src/testing-evidence/quarantine.js.map +1 -0
- package/src/testing-evidence/result.d.ts +108 -0
- package/src/testing-evidence/result.js +571 -0
- package/src/testing-evidence/result.js.map +1 -0
- package/src/testing-evidence/runner-adapter.d.ts +51 -0
- package/src/testing-evidence/runner-adapter.js +288 -0
- package/src/testing-evidence/runner-adapter.js.map +1 -0
- package/src/testing-evidence/sensitive-artifacts.d.ts +13 -0
- package/src/testing-evidence/sensitive-artifacts.js +93 -0
- package/src/testing-evidence/sensitive-artifacts.js.map +1 -0
- package/src/work-markers/work-markers.js +4 -3
- package/src/work-markers/work-markers.js.map +1 -1
- package/src/workload-roles/account-baseline.d.ts +132 -0
- package/src/workload-roles/account-baseline.js +743 -0
- package/src/workload-roles/account-baseline.js.map +1 -0
- package/src/workload-roles/authority.d.ts +38 -0
- package/src/workload-roles/authority.js +156 -0
- package/src/workload-roles/authority.js.map +1 -0
- package/src/workload-roles/aws-adapter.d.ts +99 -0
- package/src/workload-roles/aws-adapter.js +416 -0
- package/src/workload-roles/aws-adapter.js.map +1 -0
- package/src/workload-roles/aws-internal-handler.d.ts +27 -0
- package/src/workload-roles/aws-internal-handler.js +58 -0
- package/src/workload-roles/aws-internal-handler.js.map +1 -0
- package/src/workload-roles/aws-s3-state.d.ts +52 -0
- package/src/workload-roles/aws-s3-state.js +164 -0
- package/src/workload-roles/aws-s3-state.js.map +1 -0
- package/src/workload-roles/aws-sdk-control-plane.d.ts +12 -0
- package/src/workload-roles/aws-sdk-control-plane.js +291 -0
- package/src/workload-roles/aws-sdk-control-plane.js.map +1 -0
- package/src/workload-roles/boundary.d.ts +33 -0
- package/src/workload-roles/boundary.js +130 -0
- package/src/workload-roles/boundary.js.map +1 -0
- package/src/workload-roles/convergence.d.ts +66 -0
- package/src/workload-roles/convergence.js +186 -0
- package/src/workload-roles/convergence.js.map +1 -0
- package/src/workload-roles/effective-policy.d.ts +51 -0
- package/src/workload-roles/effective-policy.js +183 -0
- package/src/workload-roles/effective-policy.js.map +1 -0
- package/src/workload-roles/handler.d.ts +43 -0
- package/src/workload-roles/handler.js +130 -0
- package/src/workload-roles/handler.js.map +1 -0
- package/src/workload-roles/history.d.ts +47 -0
- package/src/workload-roles/history.js +324 -0
- package/src/workload-roles/history.js.map +1 -0
- package/src/workload-roles/index.d.ts +17 -0
- package/src/workload-roles/index.js +21 -0
- package/src/workload-roles/index.js.map +1 -0
- package/src/workload-roles/injection.d.ts +119 -0
- package/src/workload-roles/injection.js +495 -0
- package/src/workload-roles/injection.js.map +1 -0
- package/src/workload-roles/manifest.d.ts +54 -0
- package/src/workload-roles/manifest.js +343 -0
- package/src/workload-roles/manifest.js.map +1 -0
- package/src/workload-roles/provisioner.d.ts +70 -0
- package/src/workload-roles/provisioner.js +231 -0
- package/src/workload-roles/provisioner.js.map +1 -0
- package/src/workload-roles/registration.d.ts +101 -0
- package/src/workload-roles/registration.js +457 -0
- package/src/workload-roles/registration.js.map +1 -0
- package/src/workload-roles/stage-boundary.d.ts +31 -0
- package/src/workload-roles/stage-boundary.js +208 -0
- package/src/workload-roles/stage-boundary.js.map +1 -0
- package/src/workload-roles/standard-slice.d.ts +54 -0
- package/src/workload-roles/standard-slice.js +252 -0
- package/src/workload-roles/standard-slice.js.map +1 -0
- package/migrations/standard-pre-v1-to-v1.md +0 -11
- package/src/foundation/aurora-logical-database.d.ts +0 -76
- package/src/foundation/aurora-logical-database.js +0 -419
- package/src/foundation/aurora-logical-database.js.map +0 -1
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CYCLONEDX_INVENTORY_SCOPES = exports.SUPPLY_CHAIN_RELEASE_BINDING_KIND = exports.SUPPLY_CHAIN_SBOM_SCHEMA_VERSION = exports.CYCLONEDX_SPEC_VERSION = void 0;
|
|
4
|
+
exports.createCycloneDxComponentsFromInventory = createCycloneDxComponentsFromInventory;
|
|
5
|
+
exports.createCycloneDxPlatformSbomUnion = createCycloneDxPlatformSbomUnion;
|
|
6
|
+
exports.createCycloneDxSbom = createCycloneDxSbom;
|
|
7
|
+
exports.validateCycloneDxSbom = validateCycloneDxSbom;
|
|
8
|
+
exports.createSupplyChainReleaseBinding = createSupplyChainReleaseBinding;
|
|
9
|
+
exports.validateSupplyChainReleaseBinding = validateSupplyChainReleaseBinding;
|
|
10
|
+
const deterministic_order_js_1 = require("../deterministic-order.js");
|
|
11
|
+
const validation_js_1 = require("../validation.js");
|
|
12
|
+
const common_js_1 = require("./common.js");
|
|
13
|
+
const errors_js_1 = require("./errors.js");
|
|
14
|
+
const license_expression_js_1 = require("./license-expression.js");
|
|
15
|
+
exports.CYCLONEDX_SPEC_VERSION = '1.6';
|
|
16
|
+
exports.SUPPLY_CHAIN_SBOM_SCHEMA_VERSION = 1;
|
|
17
|
+
exports.SUPPLY_CHAIN_RELEASE_BINDING_KIND = 'ebk-supply-chain-release-binding';
|
|
18
|
+
exports.CYCLONEDX_INVENTORY_SCOPES = [
|
|
19
|
+
'source-build-inputs',
|
|
20
|
+
'build-output-contents',
|
|
21
|
+
'deployable-bundle-contents',
|
|
22
|
+
'final-oci-contents',
|
|
23
|
+
];
|
|
24
|
+
function packageReference(value, path) {
|
|
25
|
+
const withoutPeers = value.replace(/\(.+$/, '');
|
|
26
|
+
const separator = withoutPeers.lastIndexOf('@');
|
|
27
|
+
if (separator <= 0) {
|
|
28
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', path, `cannot resolve dependency reference ${value}`);
|
|
29
|
+
}
|
|
30
|
+
const name = withoutPeers.slice(0, separator);
|
|
31
|
+
const version = withoutPeers.slice(separator + 1);
|
|
32
|
+
if (!common_js_1.SUPPLY_CHAIN_PACKAGE_NAME.test(name) ||
|
|
33
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(version)) {
|
|
34
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', path, `does not identify one exact npm component: ${value}`);
|
|
35
|
+
}
|
|
36
|
+
return { name, version };
|
|
37
|
+
}
|
|
38
|
+
function npmPurl(name, version) {
|
|
39
|
+
return `pkg:npm/${encodeURIComponent(name)}@${version}`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Derive the exact production source/build dependency closure for one
|
|
43
|
+
* workspace importer.
|
|
44
|
+
*
|
|
45
|
+
* pnpm can retain multiple peer-context lock keys for the same package bytes.
|
|
46
|
+
* CycloneDX identifies those bytes by package URL, so this projection merges
|
|
47
|
+
* peer contexts while retaining the union of their dependency edges. Any
|
|
48
|
+
* unresolved edge fails as an omission instead of producing a partial SBOM.
|
|
49
|
+
*/
|
|
50
|
+
function createCycloneDxComponentsFromInventory(input) {
|
|
51
|
+
if (typeof input.importer !== 'string' ||
|
|
52
|
+
input.importer.trim() === '' ||
|
|
53
|
+
input.importer !== input.importer.trim()) {
|
|
54
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'importer', 'must name one exact workspace importer');
|
|
55
|
+
}
|
|
56
|
+
const packages = new Map(input.inventory.resolvedPackages.map((entry) => [entry.lockKey, entry]));
|
|
57
|
+
const packagesByIdentity = new Map();
|
|
58
|
+
for (const entry of input.inventory.resolvedPackages) {
|
|
59
|
+
const identity = `${entry.name}@${entry.version}`;
|
|
60
|
+
packagesByIdentity.set(identity, [
|
|
61
|
+
...(packagesByIdentity.get(identity) ?? []),
|
|
62
|
+
entry.lockKey,
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
const resolveKeys = (name, resolved, path) => {
|
|
66
|
+
const exact = `${name}@${resolved}`;
|
|
67
|
+
if (packages.has(exact))
|
|
68
|
+
return [exact];
|
|
69
|
+
if (/^(?:file|link|workspace):/.test(resolved)) {
|
|
70
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', path, `workspace dependency ${name}@${resolved} has no final registry component`);
|
|
71
|
+
}
|
|
72
|
+
const reference = packageReference(`${name}@${resolved}`, path);
|
|
73
|
+
const candidates = packagesByIdentity.get(`${reference.name}@${reference.version}`) ?? [];
|
|
74
|
+
if (candidates.length === 0) {
|
|
75
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', path, `resolved package ${name}@${resolved} is absent from the lock inventory`);
|
|
76
|
+
}
|
|
77
|
+
return candidates;
|
|
78
|
+
};
|
|
79
|
+
const visited = new Map();
|
|
80
|
+
const pending = [];
|
|
81
|
+
const directDependencies = input.inventory.dependencies.filter(({ importer, scope }) => importer === input.importer &&
|
|
82
|
+
(scope === 'production' || scope === 'optional'));
|
|
83
|
+
if (directDependencies.length === 0) {
|
|
84
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', `inventory.dependencies.${input.importer}`, 'has no production dependency closure');
|
|
85
|
+
}
|
|
86
|
+
for (const dependency of directDependencies) {
|
|
87
|
+
for (const key of resolveKeys(dependency.name, dependency.resolved, `inventory.dependencies.${input.importer}.${dependency.name}`)) {
|
|
88
|
+
pending.push({
|
|
89
|
+
direct: true,
|
|
90
|
+
key,
|
|
91
|
+
required: dependency.scope === 'production',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
while (pending.length > 0) {
|
|
96
|
+
const current = pending.pop();
|
|
97
|
+
if (!current)
|
|
98
|
+
break;
|
|
99
|
+
const previous = visited.get(current.key);
|
|
100
|
+
const next = {
|
|
101
|
+
direct: (previous?.direct ?? false) || current.direct,
|
|
102
|
+
required: (previous?.required ?? false) || current.required,
|
|
103
|
+
};
|
|
104
|
+
if (previous?.direct === next.direct &&
|
|
105
|
+
previous.required === next.required) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
visited.set(current.key, next);
|
|
109
|
+
const entry = packages.get(current.key);
|
|
110
|
+
if (!entry) {
|
|
111
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', `inventory.resolvedPackages.${current.key}`, 'is absent from the exact lock inventory');
|
|
112
|
+
}
|
|
113
|
+
for (const [index, dependency] of entry.dependencies.entries()) {
|
|
114
|
+
const reference = packageReference(dependency, `inventory.resolvedPackages.${current.key}.dependencies[${index}]`);
|
|
115
|
+
for (const key of resolveKeys(reference.name, reference.version, `inventory.resolvedPackages.${current.key}.dependencies[${index}]`)) {
|
|
116
|
+
pending.push({
|
|
117
|
+
direct: false,
|
|
118
|
+
key,
|
|
119
|
+
required: next.required,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const grouped = new Map();
|
|
125
|
+
for (const [key, reachability] of visited) {
|
|
126
|
+
const entry = packages.get(key);
|
|
127
|
+
if (!entry)
|
|
128
|
+
continue;
|
|
129
|
+
const identity = `${entry.name}@${entry.version}`;
|
|
130
|
+
const component = grouped.get(identity) ?? {
|
|
131
|
+
dependencies: new Set(),
|
|
132
|
+
direct: false,
|
|
133
|
+
name: entry.name,
|
|
134
|
+
required: false,
|
|
135
|
+
version: entry.version,
|
|
136
|
+
};
|
|
137
|
+
component.direct ||= reachability.direct;
|
|
138
|
+
component.required ||= reachability.required;
|
|
139
|
+
for (const [index, dependency] of entry.dependencies.entries()) {
|
|
140
|
+
const reference = packageReference(dependency, `inventory.resolvedPackages.${key}.dependencies[${index}]`);
|
|
141
|
+
component.dependencies.add(npmPurl(reference.name, reference.version));
|
|
142
|
+
}
|
|
143
|
+
grouped.set(identity, component);
|
|
144
|
+
}
|
|
145
|
+
return [...grouped.entries()]
|
|
146
|
+
.sort(([left], [right]) => (0, deterministic_order_js_1.compareUtf16)(left, right))
|
|
147
|
+
.map(([identity, component]) => ({
|
|
148
|
+
dependencies: [...component.dependencies].sort(),
|
|
149
|
+
direct: component.direct,
|
|
150
|
+
licenses: input.licenses?.[identity]?.length === 0
|
|
151
|
+
? ['LicenseRef-Unknown']
|
|
152
|
+
: [...(input.licenses?.[identity] ?? ['LicenseRef-Unknown'])].sort(),
|
|
153
|
+
name: component.name,
|
|
154
|
+
purl: npmPurl(component.name, component.version),
|
|
155
|
+
scope: component.required ? 'required' : 'optional',
|
|
156
|
+
type: component.name.startsWith('@empire-builder-kit/')
|
|
157
|
+
? 'framework'
|
|
158
|
+
: 'library',
|
|
159
|
+
version: component.version,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
function canonicalTimestamp(value, path) {
|
|
163
|
+
if (!Number.isFinite(Date.parse(value)) ||
|
|
164
|
+
new Date(value).toISOString() !== value) {
|
|
165
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', path, 'must be a canonical ISO-8601 timestamp');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function uuidFromDigest(digest) {
|
|
169
|
+
const chars = digest.slice(0, 32).split('');
|
|
170
|
+
chars[12] = '5';
|
|
171
|
+
chars[16] = ['8', '9', 'a', 'b'][Number.parseInt(chars[16] ?? '0', 16) % 4];
|
|
172
|
+
const value = chars.join('');
|
|
173
|
+
return [
|
|
174
|
+
value.slice(0, 8),
|
|
175
|
+
value.slice(8, 12),
|
|
176
|
+
value.slice(12, 16),
|
|
177
|
+
value.slice(16, 20),
|
|
178
|
+
value.slice(20, 32),
|
|
179
|
+
].join('-');
|
|
180
|
+
}
|
|
181
|
+
function canonicalClone(value) {
|
|
182
|
+
return JSON.parse((0, common_js_1.canonicalizeSupplyChainValue)(value));
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Create one deterministic CycloneDX inventory for a multi-architecture OCI
|
|
186
|
+
* index from the independently scanned child manifests.
|
|
187
|
+
*
|
|
188
|
+
* Architecture-specific operating-system packages are retained as a union.
|
|
189
|
+
* The npm identities must remain identical because the container-release
|
|
190
|
+
* contract proves one architecture-neutral production dependency closure.
|
|
191
|
+
*/
|
|
192
|
+
function createCycloneDxPlatformSbomUnion(input) {
|
|
193
|
+
canonicalTimestamp(input.generatedAt, 'generatedAt');
|
|
194
|
+
const expectedPlatforms = ['linux/amd64', 'linux/arm64'];
|
|
195
|
+
const platforms = [...input.platforms].sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.platform, right.platform));
|
|
196
|
+
if (platforms.length !== expectedPlatforms.length ||
|
|
197
|
+
platforms.some(({ platform }, index) => platform !== expectedPlatforms[index]) ||
|
|
198
|
+
typeof input.artifact['bom-ref'] !== 'string' ||
|
|
199
|
+
input.artifact['bom-ref'].length === 0 ||
|
|
200
|
+
input.artifact.type !== 'container' ||
|
|
201
|
+
typeof input.artifact.name !== 'string' ||
|
|
202
|
+
input.artifact.name.length === 0 ||
|
|
203
|
+
typeof input.artifact.version !== 'string' ||
|
|
204
|
+
input.artifact.version.length === 0 ||
|
|
205
|
+
!Array.isArray(input.artifact.hashes) ||
|
|
206
|
+
input.artifact.hashes.length !== 1 ||
|
|
207
|
+
input.artifact.hashes[0]?.alg !== 'SHA-256' ||
|
|
208
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(input.artifact.hashes[0]?.content ?? '')) {
|
|
209
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'platformUnion', 'must bind exactly linux/amd64 and linux/arm64 to one OCI index');
|
|
210
|
+
}
|
|
211
|
+
const propertyNames = new Set();
|
|
212
|
+
const properties = [...input.properties]
|
|
213
|
+
.map((property, index) => {
|
|
214
|
+
if (!(0, validation_js_1.isRecord)(property) ||
|
|
215
|
+
typeof property.name !== 'string' ||
|
|
216
|
+
property.name.length === 0 ||
|
|
217
|
+
property.name.length > 256 ||
|
|
218
|
+
typeof property.value !== 'string' ||
|
|
219
|
+
property.value.length === 0 ||
|
|
220
|
+
property.value.length > 2_048 ||
|
|
221
|
+
propertyNames.has(property.name)) {
|
|
222
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `platformUnion.properties[${index}]`, 'must be one bounded unique name/value binding');
|
|
223
|
+
}
|
|
224
|
+
propertyNames.add(property.name);
|
|
225
|
+
return { name: property.name, value: property.value };
|
|
226
|
+
})
|
|
227
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.name, right.name) ||
|
|
228
|
+
(0, deterministic_order_js_1.compareUtf16)(left.value, right.value));
|
|
229
|
+
const componentByRef = new Map();
|
|
230
|
+
const dependencyByRef = new Map();
|
|
231
|
+
const toolByIdentity = new Map();
|
|
232
|
+
const npmClosures = [];
|
|
233
|
+
const childIdentities = [];
|
|
234
|
+
for (const [platformIndex, platform] of platforms.entries()) {
|
|
235
|
+
const path = `platformUnion.platforms[${platformIndex}].sbom`;
|
|
236
|
+
const sbom = platform.sbom;
|
|
237
|
+
if (!(0, validation_js_1.isRecord)(sbom) ||
|
|
238
|
+
sbom.bomFormat !== 'CycloneDX' ||
|
|
239
|
+
sbom.specVersion !== exports.CYCLONEDX_SPEC_VERSION ||
|
|
240
|
+
sbom.version !== 1 ||
|
|
241
|
+
typeof sbom.serialNumber !== 'string' ||
|
|
242
|
+
!/^urn:uuid:[a-fA-F0-9-]{36}$/.test(sbom.serialNumber) ||
|
|
243
|
+
!Array.isArray(sbom.components) ||
|
|
244
|
+
sbom.components.length === 0 ||
|
|
245
|
+
!Array.isArray(sbom.dependencies) ||
|
|
246
|
+
!(0, validation_js_1.isRecord)(sbom.metadata)) {
|
|
247
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', path, 'must be complete CycloneDX 1.6 child-manifest evidence');
|
|
248
|
+
}
|
|
249
|
+
const seenChildRefs = new Set();
|
|
250
|
+
const npmComponents = [];
|
|
251
|
+
for (const [componentIndex, candidate] of sbom.components.entries()) {
|
|
252
|
+
if (!(0, validation_js_1.isRecord)(candidate)) {
|
|
253
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.components[${componentIndex}]`, 'must be one component object');
|
|
254
|
+
}
|
|
255
|
+
const ref = typeof candidate['bom-ref'] === 'string'
|
|
256
|
+
? candidate['bom-ref']
|
|
257
|
+
: candidate.purl;
|
|
258
|
+
if (typeof ref !== 'string' ||
|
|
259
|
+
ref.length === 0 ||
|
|
260
|
+
ref.length > 2_048 ||
|
|
261
|
+
seenChildRefs.has(ref) ||
|
|
262
|
+
typeof candidate.name !== 'string' ||
|
|
263
|
+
candidate.name.length === 0 ||
|
|
264
|
+
typeof candidate.type !== 'string' ||
|
|
265
|
+
candidate.type.length === 0 ||
|
|
266
|
+
typeof candidate.version !== 'string' ||
|
|
267
|
+
candidate.version.length === 0) {
|
|
268
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.components[${componentIndex}]`, 'must have one unique bounded component identity');
|
|
269
|
+
}
|
|
270
|
+
seenChildRefs.add(ref);
|
|
271
|
+
const component = canonicalClone({ ...candidate, 'bom-ref': ref });
|
|
272
|
+
const prior = componentByRef.get(ref);
|
|
273
|
+
if (prior !== undefined &&
|
|
274
|
+
(0, common_js_1.canonicalizeSupplyChainValue)(prior) !==
|
|
275
|
+
(0, common_js_1.canonicalizeSupplyChainValue)(component)) {
|
|
276
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.components[${componentIndex}]`, 'conflicts with the same component reference on another platform');
|
|
277
|
+
}
|
|
278
|
+
componentByRef.set(ref, component);
|
|
279
|
+
if (typeof candidate.purl === 'string' &&
|
|
280
|
+
candidate.purl.startsWith('pkg:npm/')) {
|
|
281
|
+
npmComponents.push({
|
|
282
|
+
name: candidate.name,
|
|
283
|
+
purl: candidate.purl,
|
|
284
|
+
type: candidate.type,
|
|
285
|
+
version: candidate.version,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
npmClosures.push((0, common_js_1.canonicalizeSupplyChainValue)(npmComponents.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.purl, right.purl))));
|
|
290
|
+
const seenDependencyRefs = new Set();
|
|
291
|
+
for (const [dependencyIndex, candidate] of sbom.dependencies.entries()) {
|
|
292
|
+
if (!(0, validation_js_1.isRecord)(candidate) ||
|
|
293
|
+
typeof candidate.ref !== 'string' ||
|
|
294
|
+
candidate.ref.length === 0 ||
|
|
295
|
+
candidate.ref.length > 2_048 ||
|
|
296
|
+
seenDependencyRefs.has(candidate.ref) ||
|
|
297
|
+
!Array.isArray(candidate.dependsOn) ||
|
|
298
|
+
candidate.dependsOn.some((dependency) => typeof dependency !== 'string' ||
|
|
299
|
+
dependency.length === 0 ||
|
|
300
|
+
dependency.length > 2_048)) {
|
|
301
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.dependencies[${dependencyIndex}]`, 'must have one unique reference and bounded dependency set');
|
|
302
|
+
}
|
|
303
|
+
seenDependencyRefs.add(candidate.ref);
|
|
304
|
+
const targets = dependencyByRef.get(candidate.ref) ?? new Set();
|
|
305
|
+
for (const dependency of candidate.dependsOn) {
|
|
306
|
+
targets.add(dependency);
|
|
307
|
+
}
|
|
308
|
+
dependencyByRef.set(candidate.ref, targets);
|
|
309
|
+
}
|
|
310
|
+
const tools = (0, validation_js_1.isRecord)(sbom.metadata.tools)
|
|
311
|
+
? sbom.metadata.tools.components
|
|
312
|
+
: undefined;
|
|
313
|
+
if (tools !== undefined) {
|
|
314
|
+
if (!Array.isArray(tools) || tools.some((tool) => !(0, validation_js_1.isRecord)(tool))) {
|
|
315
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.metadata.tools.components`, 'must be a component list when present');
|
|
316
|
+
}
|
|
317
|
+
for (const tool of tools) {
|
|
318
|
+
const normalized = canonicalClone(tool);
|
|
319
|
+
toolByIdentity.set((0, common_js_1.canonicalizeSupplyChainValue)(normalized), normalized);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
childIdentities.push({
|
|
323
|
+
digest: (0, common_js_1.supplyChainDigest)(sbom),
|
|
324
|
+
platform: platform.platform,
|
|
325
|
+
serialNumber: sbom.serialNumber.toLowerCase(),
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
if (npmClosures.some((closure) => closure !== npmClosures[0])) {
|
|
329
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'platformUnion.platforms', 'must retain one exact npm component closure across both architectures');
|
|
330
|
+
}
|
|
331
|
+
const components = [...componentByRef.entries()]
|
|
332
|
+
.sort(([left], [right]) => (0, deterministic_order_js_1.compareUtf16)(left, right))
|
|
333
|
+
.map(([, component]) => component);
|
|
334
|
+
const dependencies = [...dependencyByRef.entries()]
|
|
335
|
+
.sort(([left], [right]) => (0, deterministic_order_js_1.compareUtf16)(left, right))
|
|
336
|
+
.map(([ref, dependsOn]) => ({ dependsOn: [...dependsOn].sort(), ref }));
|
|
337
|
+
const unionIdentity = (0, common_js_1.supplyChainDigest)({
|
|
338
|
+
artifact: input.artifact,
|
|
339
|
+
childIdentities,
|
|
340
|
+
components,
|
|
341
|
+
dependencies,
|
|
342
|
+
generatedAt: input.generatedAt,
|
|
343
|
+
properties,
|
|
344
|
+
});
|
|
345
|
+
const serialNumber = `urn:uuid:${uuidFromDigest(unionIdentity)}`;
|
|
346
|
+
if (childIdentities.some((identity) => identity.serialNumber === serialNumber)) {
|
|
347
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'platformUnion.serialNumber', 'must be distinct from every child-manifest SBOM serial');
|
|
348
|
+
}
|
|
349
|
+
const tools = [...toolByIdentity.entries()]
|
|
350
|
+
.sort(([left], [right]) => (0, deterministic_order_js_1.compareUtf16)(left, right))
|
|
351
|
+
.map(([, tool]) => tool);
|
|
352
|
+
return {
|
|
353
|
+
bomFormat: 'CycloneDX',
|
|
354
|
+
components,
|
|
355
|
+
dependencies,
|
|
356
|
+
metadata: {
|
|
357
|
+
component: canonicalClone(input.artifact),
|
|
358
|
+
properties,
|
|
359
|
+
timestamp: input.generatedAt,
|
|
360
|
+
...(tools.length > 0 ? { tools: { components: tools } } : {}),
|
|
361
|
+
},
|
|
362
|
+
serialNumber,
|
|
363
|
+
specVersion: exports.CYCLONEDX_SPEC_VERSION,
|
|
364
|
+
version: 1,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function componentRef(component) {
|
|
368
|
+
return component.purl;
|
|
369
|
+
}
|
|
370
|
+
function validateComponentInput(component, index) {
|
|
371
|
+
const path = `components[${index}]`;
|
|
372
|
+
const licenses = Array.isArray(component.licenses) ? component.licenses : [];
|
|
373
|
+
if (!(0, validation_js_1.isRecord)(component) ||
|
|
374
|
+
!['application', 'container', 'framework', 'library'].includes(component.type) ||
|
|
375
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(component.version) ||
|
|
376
|
+
typeof component.name !== 'string' ||
|
|
377
|
+
component.name.trim() === '' ||
|
|
378
|
+
!/^pkg:(?:npm|oci)\/[A-Za-z0-9.%_@/+~-]+@\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?(?:\?.*)?$/.test(component.purl) ||
|
|
379
|
+
!['excluded', 'optional', 'required'].includes(component.scope) ||
|
|
380
|
+
!Array.isArray(component.dependencies) ||
|
|
381
|
+
licenses.length === 0 ||
|
|
382
|
+
licenses.some((license) => {
|
|
383
|
+
try {
|
|
384
|
+
return (typeof license !== 'string' ||
|
|
385
|
+
license !== (0, license_expression_js_1.normalizeSpdxLicenseExpression)(license));
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
}) ||
|
|
391
|
+
(0, common_js_1.hasSensitiveSupplyChainShape)(component)) {
|
|
392
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', path, 'must completely identify one supported exact-version component');
|
|
393
|
+
}
|
|
394
|
+
for (const [hashIndex, hash] of (component.hashes ?? []).entries()) {
|
|
395
|
+
if (hash.algorithm !== 'SHA-256' || !common_js_1.SUPPLY_CHAIN_SHA256.test(hash.value)) {
|
|
396
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `${path}.hashes[${hashIndex}]`, 'must be a lowercase SHA-256 hash');
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function createCycloneDxSbom(input) {
|
|
401
|
+
canonicalTimestamp(input.generatedAt, 'generatedAt');
|
|
402
|
+
if (!common_js_1.SUPPLY_CHAIN_SHA256.test(input.artifact.digest) ||
|
|
403
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(input.artifact.version) ||
|
|
404
|
+
!['application', 'container', 'framework', 'library'].includes(input.artifact.type) ||
|
|
405
|
+
typeof input.artifact.name !== 'string' ||
|
|
406
|
+
input.artifact.name.trim() === '' ||
|
|
407
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(input.release.manifestDigest) ||
|
|
408
|
+
!common_js_1.SUPPLY_CHAIN_REFERENCE.test(input.release.id) ||
|
|
409
|
+
!/^[a-f0-9]{40}$/.test(input.source.commit) ||
|
|
410
|
+
!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(input.source.repository) ||
|
|
411
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(input.generationTool.version) ||
|
|
412
|
+
!input.generationTool.purl.startsWith('pkg:npm/') ||
|
|
413
|
+
!exports.CYCLONEDX_INVENTORY_SCOPES.includes(input.inventoryScope) ||
|
|
414
|
+
(['build-output-contents', 'deployable-bundle-contents'].includes(input.inventoryScope) &&
|
|
415
|
+
input.artifact.type !== 'application') ||
|
|
416
|
+
(input.inventoryScope === 'final-oci-contents' &&
|
|
417
|
+
input.artifact.type !== 'container') ||
|
|
418
|
+
input.components.length === 0 ||
|
|
419
|
+
(0, common_js_1.hasSensitiveSupplyChainShape)(input)) {
|
|
420
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'sbom', 'must bind a supported artifact to source, release, and exact tool identity');
|
|
421
|
+
}
|
|
422
|
+
if (input.omissions.length > 0) {
|
|
423
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', 'omissions', `SBOM generation cannot omit ${input.omissions
|
|
424
|
+
.map(({ ecosystem }) => ecosystem)
|
|
425
|
+
.join(', ')}`);
|
|
426
|
+
}
|
|
427
|
+
input.components.forEach(validateComponentInput);
|
|
428
|
+
const refs = new Set(input.components.map(componentRef));
|
|
429
|
+
if (refs.size !== input.components.length) {
|
|
430
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'components', 'component package URLs must be unique');
|
|
431
|
+
}
|
|
432
|
+
for (const [index, component] of input.components.entries()) {
|
|
433
|
+
for (const dependency of component.dependencies) {
|
|
434
|
+
if (!refs.has(dependency)) {
|
|
435
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', `components[${index}].dependencies`, `${dependency} is absent from the declared component inventory`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
const artifactRef = `urn:ebk:artifact:${input.artifact.digest}`;
|
|
440
|
+
const components = [...input.components]
|
|
441
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.purl, right.purl))
|
|
442
|
+
.map((component) => ({
|
|
443
|
+
'bom-ref': componentRef(component),
|
|
444
|
+
...(component.hashes?.length
|
|
445
|
+
? {
|
|
446
|
+
hashes: [...component.hashes]
|
|
447
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.value, right.value))
|
|
448
|
+
.map(({ value }) => ({
|
|
449
|
+
alg: 'SHA-256',
|
|
450
|
+
content: value,
|
|
451
|
+
})),
|
|
452
|
+
}
|
|
453
|
+
: {}),
|
|
454
|
+
licenses: [...component.licenses]
|
|
455
|
+
.sort()
|
|
456
|
+
.map((expression) => /^(?:[A-Za-z0-9-.+]+|LicenseRef-[A-Za-z0-9-.]+)$/.test(expression)
|
|
457
|
+
? { license: { id: expression } }
|
|
458
|
+
: { expression }),
|
|
459
|
+
name: component.name,
|
|
460
|
+
properties: [
|
|
461
|
+
{
|
|
462
|
+
name: 'ebk:dependency:direct',
|
|
463
|
+
value: String(component.direct),
|
|
464
|
+
},
|
|
465
|
+
],
|
|
466
|
+
purl: component.purl,
|
|
467
|
+
scope: component.scope,
|
|
468
|
+
...(component.supplier ? { supplier: { name: component.supplier } } : {}),
|
|
469
|
+
type: component.type,
|
|
470
|
+
version: component.version,
|
|
471
|
+
}));
|
|
472
|
+
const dependencies = [
|
|
473
|
+
{
|
|
474
|
+
dependsOn: input.components
|
|
475
|
+
.filter(({ direct }) => direct)
|
|
476
|
+
.map(componentRef)
|
|
477
|
+
.sort(),
|
|
478
|
+
ref: artifactRef,
|
|
479
|
+
},
|
|
480
|
+
...input.components
|
|
481
|
+
.map((component) => ({
|
|
482
|
+
dependsOn: [...component.dependencies].sort(),
|
|
483
|
+
ref: componentRef(component),
|
|
484
|
+
}))
|
|
485
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.ref, right.ref)),
|
|
486
|
+
];
|
|
487
|
+
const identity = (0, common_js_1.supplyChainDigest)({
|
|
488
|
+
artifact: input.artifact,
|
|
489
|
+
components,
|
|
490
|
+
generatedAt: input.generatedAt,
|
|
491
|
+
generationTool: input.generationTool,
|
|
492
|
+
inventoryScope: input.inventoryScope,
|
|
493
|
+
release: input.release,
|
|
494
|
+
source: input.source,
|
|
495
|
+
});
|
|
496
|
+
const componentGraphDigest = (0, common_js_1.supplyChainDigest)(input.components
|
|
497
|
+
.map(({ dependencies, direct, purl }) => ({
|
|
498
|
+
dependencies: [...dependencies].sort(),
|
|
499
|
+
direct,
|
|
500
|
+
purl,
|
|
501
|
+
}))
|
|
502
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.purl, right.purl)));
|
|
503
|
+
return {
|
|
504
|
+
bomFormat: 'CycloneDX',
|
|
505
|
+
components,
|
|
506
|
+
dependencies,
|
|
507
|
+
metadata: {
|
|
508
|
+
component: {
|
|
509
|
+
'bom-ref': artifactRef,
|
|
510
|
+
hashes: [{ alg: 'SHA-256', content: input.artifact.digest }],
|
|
511
|
+
name: input.artifact.name,
|
|
512
|
+
type: input.artifact.type,
|
|
513
|
+
version: input.artifact.version,
|
|
514
|
+
},
|
|
515
|
+
properties: [
|
|
516
|
+
{ name: 'ebk:release:id', value: input.release.id },
|
|
517
|
+
{
|
|
518
|
+
name: 'ebk:release:manifest:sha256',
|
|
519
|
+
value: input.release.manifestDigest,
|
|
520
|
+
},
|
|
521
|
+
{ name: 'ebk:source:commit', value: input.source.commit },
|
|
522
|
+
{ name: 'ebk:source:repository', value: input.source.repository },
|
|
523
|
+
{
|
|
524
|
+
name: 'ebk:inventory:component-graph:sha256',
|
|
525
|
+
value: componentGraphDigest,
|
|
526
|
+
},
|
|
527
|
+
{ name: 'ebk:inventory:scope', value: input.inventoryScope },
|
|
528
|
+
],
|
|
529
|
+
timestamp: input.generatedAt,
|
|
530
|
+
tools: {
|
|
531
|
+
components: [
|
|
532
|
+
{
|
|
533
|
+
name: input.generationTool.name,
|
|
534
|
+
purl: input.generationTool.purl,
|
|
535
|
+
type: 'application',
|
|
536
|
+
version: input.generationTool.version,
|
|
537
|
+
},
|
|
538
|
+
],
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
serialNumber: `urn:uuid:${uuidFromDigest(identity)}`,
|
|
542
|
+
specVersion: exports.CYCLONEDX_SPEC_VERSION,
|
|
543
|
+
version: 1,
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
function validateCycloneDxSbom(value, expected) {
|
|
547
|
+
if (!(0, validation_js_1.isRecord)(value) ||
|
|
548
|
+
value.bomFormat !== 'CycloneDX' ||
|
|
549
|
+
value.specVersion !== exports.CYCLONEDX_SPEC_VERSION ||
|
|
550
|
+
value.version !== 1 ||
|
|
551
|
+
typeof value.serialNumber !== 'string' ||
|
|
552
|
+
!/^urn:uuid:[a-f0-9-]{36}$/.test(value.serialNumber) ||
|
|
553
|
+
!Array.isArray(value.components) ||
|
|
554
|
+
!Array.isArray(value.dependencies) ||
|
|
555
|
+
!(0, validation_js_1.isRecord)(value.metadata) ||
|
|
556
|
+
!(0, validation_js_1.isRecord)(value.metadata.component) ||
|
|
557
|
+
!Array.isArray(value.metadata.properties) ||
|
|
558
|
+
(0, common_js_1.hasSensitiveSupplyChainShape)(value)) {
|
|
559
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', 'sbom', 'does not satisfy the CycloneDX v1.6 EBK profile');
|
|
560
|
+
}
|
|
561
|
+
const artifactHashes = value.metadata.component.hashes;
|
|
562
|
+
if (!Array.isArray(artifactHashes) ||
|
|
563
|
+
!artifactHashes.some((hash) => (0, validation_js_1.isRecord)(hash) &&
|
|
564
|
+
hash.alg === 'SHA-256' &&
|
|
565
|
+
hash.content === expected.artifact.digest)) {
|
|
566
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'sbom.metadata.component.hashes', 'does not bind the independently computed artifact digest');
|
|
567
|
+
}
|
|
568
|
+
const artifactRef = `urn:ebk:artifact:${expected.artifact.digest}`;
|
|
569
|
+
if (value.metadata.component['bom-ref'] !== artifactRef ||
|
|
570
|
+
value.metadata.component.name !== expected.artifact.name ||
|
|
571
|
+
value.metadata.component.type !== expected.artifact.type ||
|
|
572
|
+
value.metadata.component.version !== expected.artifact.version) {
|
|
573
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'sbom.metadata.component', 'does not identify the independently expected release artifact');
|
|
574
|
+
}
|
|
575
|
+
const properties = new Map(value.metadata.properties
|
|
576
|
+
.filter((property) => (0, validation_js_1.isRecord)(property) &&
|
|
577
|
+
typeof property.name === 'string' &&
|
|
578
|
+
typeof property.value === 'string')
|
|
579
|
+
.map(({ name, value: propertyValue }) => [name, propertyValue]));
|
|
580
|
+
if (!exports.CYCLONEDX_INVENTORY_SCOPES.includes(expected.inventoryScope) ||
|
|
581
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(expected.artifact.digest) ||
|
|
582
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(expected.artifact.version) ||
|
|
583
|
+
typeof expected.artifact.name !== 'string' ||
|
|
584
|
+
expected.artifact.name.trim() === '' ||
|
|
585
|
+
!['application', 'container', 'framework', 'library'].includes(expected.artifact.type) ||
|
|
586
|
+
expected.components.length === 0) {
|
|
587
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'expected.components', 'must independently identify one exact nonempty component graph and inventory scope');
|
|
588
|
+
}
|
|
589
|
+
const expectedGraph = [...expected.components]
|
|
590
|
+
.map((component, index) => {
|
|
591
|
+
if (!(0, validation_js_1.isRecord)(component) ||
|
|
592
|
+
typeof component.purl !== 'string' ||
|
|
593
|
+
!/^pkg:(?:npm|oci)\/[A-Za-z0-9.%_@/+~-]+@\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?(?:\?.*)?$/.test(component.purl) ||
|
|
594
|
+
!Array.isArray(component.dependencies) ||
|
|
595
|
+
component.dependencies.some((dependency) => typeof dependency !== 'string') ||
|
|
596
|
+
new Set(component.dependencies).size !==
|
|
597
|
+
component.dependencies.length ||
|
|
598
|
+
typeof component.direct !== 'boolean' ||
|
|
599
|
+
!Array.isArray(component.licenses) ||
|
|
600
|
+
component.licenses.length === 0 ||
|
|
601
|
+
component.licenses.some((license) => {
|
|
602
|
+
try {
|
|
603
|
+
return (typeof license !== 'string' ||
|
|
604
|
+
license !== (0, license_expression_js_1.normalizeSpdxLicenseExpression)(license));
|
|
605
|
+
}
|
|
606
|
+
catch {
|
|
607
|
+
return true;
|
|
608
|
+
}
|
|
609
|
+
}) ||
|
|
610
|
+
typeof component.name !== 'string' ||
|
|
611
|
+
component.name.trim() === '' ||
|
|
612
|
+
!['excluded', 'optional', 'required'].includes(component.scope) ||
|
|
613
|
+
!['application', 'container', 'framework', 'library'].includes(component.type) ||
|
|
614
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(component.version)) {
|
|
615
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', `expected.components[${index}]`, 'must independently identify one component and its exact dependency edges');
|
|
616
|
+
}
|
|
617
|
+
return {
|
|
618
|
+
dependencies: [...component.dependencies].sort(),
|
|
619
|
+
direct: component.direct,
|
|
620
|
+
licenses: [...component.licenses].sort(),
|
|
621
|
+
name: component.name,
|
|
622
|
+
purl: component.purl,
|
|
623
|
+
scope: component.scope,
|
|
624
|
+
type: component.type,
|
|
625
|
+
version: component.version,
|
|
626
|
+
};
|
|
627
|
+
})
|
|
628
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.purl, right.purl));
|
|
629
|
+
if (new Set(expectedGraph.map(({ purl }) => purl)).size !== expectedGraph.length) {
|
|
630
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'expected.components', 'must not contain duplicate component identities');
|
|
631
|
+
}
|
|
632
|
+
const expectedPurlSet = new Set(expectedGraph.map(({ purl }) => purl));
|
|
633
|
+
if (expectedGraph.some(({ dependencies }) => dependencies.some((dependency) => !expectedPurlSet.has(dependency)))) {
|
|
634
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'expected.components', 'must close every expected dependency edge within the component graph');
|
|
635
|
+
}
|
|
636
|
+
const expectedGraphDigest = (0, common_js_1.supplyChainDigest)(expectedGraph.map(({ dependencies, direct, purl }) => ({
|
|
637
|
+
dependencies,
|
|
638
|
+
direct,
|
|
639
|
+
purl,
|
|
640
|
+
})));
|
|
641
|
+
if (properties.get('ebk:release:manifest:sha256') !==
|
|
642
|
+
expected.releaseManifestDigest ||
|
|
643
|
+
properties.get('ebk:source:commit') !== expected.sourceCommit ||
|
|
644
|
+
properties.get('ebk:inventory:scope') !== expected.inventoryScope) {
|
|
645
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'sbom.metadata.properties', 'source or release identity does not match the expected candidate');
|
|
646
|
+
}
|
|
647
|
+
const componentIdentities = value.components
|
|
648
|
+
.map((component, index) => {
|
|
649
|
+
if (!(0, validation_js_1.isRecord)(component) ||
|
|
650
|
+
typeof component.purl !== 'string' ||
|
|
651
|
+
component['bom-ref'] !== component.purl ||
|
|
652
|
+
typeof component.name !== 'string' ||
|
|
653
|
+
component.name.trim() === '' ||
|
|
654
|
+
typeof component.version !== 'string' ||
|
|
655
|
+
!common_js_1.SUPPLY_CHAIN_EXACT_VERSION.test(component.version) ||
|
|
656
|
+
!['application', 'container', 'framework', 'library'].includes(String(component.type)) ||
|
|
657
|
+
!['excluded', 'optional', 'required'].includes(String(component.scope)) ||
|
|
658
|
+
!Array.isArray(component.licenses) ||
|
|
659
|
+
component.licenses.length === 0) {
|
|
660
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `sbom.components[${index}]`, 'does not satisfy the exact-component EBK profile');
|
|
661
|
+
}
|
|
662
|
+
const licenses = component.licenses.map((license, licenseIndex) => {
|
|
663
|
+
if ((0, validation_js_1.isRecord)(license) &&
|
|
664
|
+
Object.keys(license).length === 1 &&
|
|
665
|
+
(0, validation_js_1.isRecord)(license.license) &&
|
|
666
|
+
Object.keys(license.license).length === 1 &&
|
|
667
|
+
typeof license.license.id === 'string' &&
|
|
668
|
+
/^(?:[A-Za-z0-9-.+]+|LicenseRef-[A-Za-z0-9-.]+)$/.test(license.license.id)) {
|
|
669
|
+
return (0, license_expression_js_1.normalizeSpdxLicenseExpression)(license.license.id);
|
|
670
|
+
}
|
|
671
|
+
if ((0, validation_js_1.isRecord)(license) &&
|
|
672
|
+
Object.keys(license).length === 1 &&
|
|
673
|
+
typeof license.expression === 'string') {
|
|
674
|
+
const normalized = (0, license_expression_js_1.normalizeSpdxLicenseExpression)(license.expression);
|
|
675
|
+
if (normalized === license.expression)
|
|
676
|
+
return normalized;
|
|
677
|
+
}
|
|
678
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `sbom.components[${index}].licenses[${licenseIndex}]`, 'must be one canonical SPDX identifier or expression');
|
|
679
|
+
});
|
|
680
|
+
return {
|
|
681
|
+
licenses: [...licenses].sort(),
|
|
682
|
+
name: component.name,
|
|
683
|
+
purl: component.purl,
|
|
684
|
+
scope: component.scope,
|
|
685
|
+
type: component.type,
|
|
686
|
+
version: component.version,
|
|
687
|
+
};
|
|
688
|
+
})
|
|
689
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.purl, right.purl));
|
|
690
|
+
const expectedPurls = expectedGraph.map(({ purl }) => purl);
|
|
691
|
+
if (componentIdentities.length !== expectedGraph.length ||
|
|
692
|
+
componentIdentities.some((identity, index) => {
|
|
693
|
+
const expectedIdentity = expectedGraph[index];
|
|
694
|
+
return (expectedIdentity === undefined ||
|
|
695
|
+
identity.name !== expectedIdentity.name ||
|
|
696
|
+
JSON.stringify(identity.licenses) !==
|
|
697
|
+
JSON.stringify(expectedIdentity.licenses) ||
|
|
698
|
+
identity.purl !== expectedIdentity.purl ||
|
|
699
|
+
identity.scope !== expectedIdentity.scope ||
|
|
700
|
+
identity.type !== expectedIdentity.type ||
|
|
701
|
+
identity.version !== expectedIdentity.version);
|
|
702
|
+
})) {
|
|
703
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', 'sbom.components', 'does not exactly match the independently derived component inventory');
|
|
704
|
+
}
|
|
705
|
+
const dependencyRefs = new Set();
|
|
706
|
+
const dependencyGraph = new Map();
|
|
707
|
+
value.dependencies.forEach((entry, index) => {
|
|
708
|
+
if (!(0, validation_js_1.isRecord)(entry) ||
|
|
709
|
+
typeof entry.ref !== 'string' ||
|
|
710
|
+
!Array.isArray(entry.dependsOn) ||
|
|
711
|
+
entry.dependsOn.some((target) => typeof target !== 'string') ||
|
|
712
|
+
new Set(entry.dependsOn).size !== entry.dependsOn.length ||
|
|
713
|
+
dependencyRefs.has(entry.ref)) {
|
|
714
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-invalid', `sbom.dependencies[${index}]`, 'must uniquely identify a dependency node and its exact targets');
|
|
715
|
+
}
|
|
716
|
+
dependencyRefs.add(entry.ref);
|
|
717
|
+
dependencyGraph.set(entry.ref, [...entry.dependsOn].sort());
|
|
718
|
+
});
|
|
719
|
+
if (dependencyRefs.size !== expectedPurls.length + 1 ||
|
|
720
|
+
!dependencyRefs.has(artifactRef) ||
|
|
721
|
+
expectedPurls.some((purl) => !dependencyRefs.has(purl))) {
|
|
722
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', 'sbom.dependencies', 'must include the artifact and every component dependency node');
|
|
723
|
+
}
|
|
724
|
+
const expectedDependencyGraph = new Map([
|
|
725
|
+
[
|
|
726
|
+
artifactRef,
|
|
727
|
+
expectedGraph
|
|
728
|
+
.filter(({ direct }) => direct)
|
|
729
|
+
.map(({ purl }) => purl)
|
|
730
|
+
.sort(),
|
|
731
|
+
],
|
|
732
|
+
...expectedGraph.map(({ dependencies, purl }) => [purl, dependencies]),
|
|
733
|
+
]);
|
|
734
|
+
if ([...expectedDependencyGraph].some(([ref, targets]) => JSON.stringify(dependencyGraph.get(ref)) !== JSON.stringify(targets))) {
|
|
735
|
+
throw new errors_js_1.SupplyChainError('supply-chain-sbom-omission', 'sbom.dependencies', 'does not exactly match the independently derived dependency graph');
|
|
736
|
+
}
|
|
737
|
+
if (properties.get('ebk:inventory:component-graph:sha256') !==
|
|
738
|
+
expectedGraphDigest) {
|
|
739
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'sbom.metadata.properties', 'component-graph identity does not match the independently derived inventory');
|
|
740
|
+
}
|
|
741
|
+
return value;
|
|
742
|
+
}
|
|
743
|
+
function bindingInput(value) {
|
|
744
|
+
return {
|
|
745
|
+
artifacts: value.artifacts,
|
|
746
|
+
createdAt: value.createdAt,
|
|
747
|
+
releaseId: value.releaseId,
|
|
748
|
+
releaseManifestDigest: value.releaseManifestDigest,
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function createSupplyChainReleaseBinding(input) {
|
|
752
|
+
canonicalTimestamp(input.createdAt, 'createdAt');
|
|
753
|
+
if (!common_js_1.SUPPLY_CHAIN_REFERENCE.test(input.releaseId) ||
|
|
754
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(input.releaseManifestDigest) ||
|
|
755
|
+
input.artifacts.length === 0 ||
|
|
756
|
+
(0, common_js_1.hasSensitiveSupplyChainShape)(input)) {
|
|
757
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'releaseBinding', 'must bind at least one artifact to an exact release manifest');
|
|
758
|
+
}
|
|
759
|
+
const seen = new Set();
|
|
760
|
+
const artifacts = [...input.artifacts]
|
|
761
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.bindingId, right.bindingId))
|
|
762
|
+
.map((artifact, index) => {
|
|
763
|
+
if (!common_js_1.SUPPLY_CHAIN_REFERENCE.test(artifact.bindingId) ||
|
|
764
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(artifact.candidateDigest) ||
|
|
765
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(artifact.contentDigest) ||
|
|
766
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(artifact.sbomDigest) ||
|
|
767
|
+
!/^urn:uuid:[a-f0-9-]{36}$/.test(artifact.sbomSerialNumber) ||
|
|
768
|
+
seen.has(artifact.bindingId)) {
|
|
769
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', `releaseBinding.artifacts[${index}]`, 'must uniquely bind artifact and SBOM digests');
|
|
770
|
+
}
|
|
771
|
+
seen.add(artifact.bindingId);
|
|
772
|
+
return artifact;
|
|
773
|
+
});
|
|
774
|
+
const normalized = {
|
|
775
|
+
artifacts,
|
|
776
|
+
createdAt: input.createdAt,
|
|
777
|
+
releaseId: input.releaseId,
|
|
778
|
+
releaseManifestDigest: input.releaseManifestDigest,
|
|
779
|
+
};
|
|
780
|
+
return {
|
|
781
|
+
...normalized,
|
|
782
|
+
kind: exports.SUPPLY_CHAIN_RELEASE_BINDING_KIND,
|
|
783
|
+
materialDigest: (0, common_js_1.supplyChainDigest)(normalized),
|
|
784
|
+
schemaVersion: exports.SUPPLY_CHAIN_SBOM_SCHEMA_VERSION,
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function validateSupplyChainReleaseBinding(value, expected) {
|
|
788
|
+
if (!(0, validation_js_1.isRecord)(value) ||
|
|
789
|
+
value.kind !== exports.SUPPLY_CHAIN_RELEASE_BINDING_KIND ||
|
|
790
|
+
value.schemaVersion !== exports.SUPPLY_CHAIN_SBOM_SCHEMA_VERSION ||
|
|
791
|
+
!common_js_1.SUPPLY_CHAIN_SHA256.test(String(value.materialDigest)) ||
|
|
792
|
+
!Array.isArray(value.artifacts)) {
|
|
793
|
+
throw new errors_js_1.SupplyChainError('supply-chain-input-invalid', 'releaseBinding', 'must be an EBK supply-chain release binding v1');
|
|
794
|
+
}
|
|
795
|
+
const recreated = createSupplyChainReleaseBinding(value);
|
|
796
|
+
if (recreated.materialDigest !== value.materialDigest) {
|
|
797
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'releaseBinding.materialDigest', 'does not match the canonical binding bytes');
|
|
798
|
+
}
|
|
799
|
+
if (recreated.releaseId !== expected.releaseId ||
|
|
800
|
+
recreated.releaseManifestDigest !== expected.releaseManifestDigest) {
|
|
801
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'releaseBinding', 'does not name the expected release candidate');
|
|
802
|
+
}
|
|
803
|
+
const expectedBindingIds = Object.keys(expected.contentDigests).sort();
|
|
804
|
+
const expectedCandidateBindingIds = Object.keys(expected.candidateDigests).sort();
|
|
805
|
+
const actualBindingIds = recreated.artifacts.map(({ bindingId }) => bindingId);
|
|
806
|
+
if (expectedBindingIds.length === 0 ||
|
|
807
|
+
expectedCandidateBindingIds.length !== expectedBindingIds.length ||
|
|
808
|
+
expectedCandidateBindingIds.some((bindingId, index) => bindingId !== expectedBindingIds[index]) ||
|
|
809
|
+
actualBindingIds.length !== expectedBindingIds.length ||
|
|
810
|
+
actualBindingIds.some((bindingId, index) => bindingId !== expectedBindingIds[index])) {
|
|
811
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', 'releaseBinding.artifacts', 'must bind every independently expected SBOM binding ID exactly once');
|
|
812
|
+
}
|
|
813
|
+
for (const artifact of recreated.artifacts) {
|
|
814
|
+
const contentDigest = expected.contentDigests[artifact.bindingId];
|
|
815
|
+
const candidateDigest = expected.candidateDigests[artifact.bindingId];
|
|
816
|
+
if (contentDigest !== artifact.contentDigest ||
|
|
817
|
+
candidateDigest !== artifact.candidateDigest) {
|
|
818
|
+
throw new errors_js_1.SupplyChainError('supply-chain-artifact-mismatch', `releaseBinding.artifacts.${artifact.bindingId}`, 'does not match independently computed content and candidate digests');
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return {
|
|
822
|
+
...recreated,
|
|
823
|
+
materialDigest: (0, common_js_1.supplyChainDigest)(bindingInput(recreated)),
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
//# sourceMappingURL=sbom.js.map
|