@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
|
@@ -1,24 +1,438 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeveloperAgentUpgradePreviewBindingError = void 0;
|
|
4
|
+
exports.developerAgentUpgradeExecutionOptions = developerAgentUpgradeExecutionOptions;
|
|
3
5
|
exports.preserveCompositionRegions = preserveCompositionRegions;
|
|
6
|
+
exports.inspectWorkspaceSstVersion = inspectWorkspaceSstVersion;
|
|
4
7
|
exports.createUpgradeReport = createUpgradeReport;
|
|
5
8
|
exports.upgradeGenerator = upgradeGenerator;
|
|
9
|
+
const deterministic_order_js_1 = require("../../deterministic-order.js");
|
|
6
10
|
const devkit_1 = require("@nx/devkit");
|
|
11
|
+
const node_buffer_1 = require("node:buffer");
|
|
12
|
+
const node_crypto_1 = require("node:crypto");
|
|
13
|
+
const node_fs_1 = require("node:fs");
|
|
7
14
|
const node_path_1 = require("node:path");
|
|
15
|
+
const node_util_1 = require("node:util");
|
|
8
16
|
const prettier_1 = require("prettier");
|
|
17
|
+
const yaml_1 = require("yaml");
|
|
9
18
|
const index_js_1 = require("../../blueprints/index.js");
|
|
10
|
-
const index_js_2 = require("../../
|
|
11
|
-
const index_js_3 = require("../../
|
|
19
|
+
const index_js_2 = require("../../api-contract/index.js");
|
|
20
|
+
const index_js_3 = require("../../foundation/index.js");
|
|
21
|
+
const index_js_4 = require("../../ownership/index.js");
|
|
12
22
|
const function_js_1 = require("../function/function.js");
|
|
23
|
+
const feature_registry_js_1 = require("../feature-registry.js");
|
|
13
24
|
const generator_js_1 = require("../preset/generator.js");
|
|
25
|
+
const tool_versions_js_1 = require("../preset/tool-versions.js");
|
|
14
26
|
const workspace_files_js_1 = require("../preset/workspace-files.js");
|
|
15
|
-
const
|
|
27
|
+
const built_in_plan_js_1 = require("../slice/built-in-plan.js");
|
|
16
28
|
const workload_js_1 = require("../workload/workload.js");
|
|
29
|
+
const git_inspection_js_1 = require("../../developer-agent/git-inspection.js");
|
|
30
|
+
const context_js_1 = require("../../developer-agent/context.js");
|
|
31
|
+
const model_js_1 = require("../../developer-agent/model.js");
|
|
32
|
+
const preview_source_js_1 = require("../../developer-agent/preview-source.js");
|
|
33
|
+
const preview_changes_js_1 = require("../../developer-agent/preview-changes.js");
|
|
34
|
+
const validation_js_1 = require("../../developer-agent/validation.js");
|
|
35
|
+
function requireTargetCompositionFeatures(files, ownership) {
|
|
36
|
+
if (ownership.compositions.length === 0)
|
|
37
|
+
return;
|
|
38
|
+
const source = files.get(feature_registry_js_1.SLICE_FEATURE_REGISTRY_PATH);
|
|
39
|
+
if (source === undefined) {
|
|
40
|
+
throw new Error(`Target Product Slice is missing ${feature_registry_js_1.SLICE_FEATURE_REGISTRY_PATH} required by retained composition ownership.`);
|
|
41
|
+
}
|
|
42
|
+
let value;
|
|
43
|
+
try {
|
|
44
|
+
value = JSON.parse(source);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw new Error(`Target Product Slice feature registry at ${feature_registry_js_1.SLICE_FEATURE_REGISTRY_PATH} must be valid JSON.`);
|
|
48
|
+
}
|
|
49
|
+
const registry = (0, feature_registry_js_1.parseSliceFeatureRegistry)(value, `Target Product Slice feature registry at ${feature_registry_js_1.SLICE_FEATURE_REGISTRY_PATH}`);
|
|
50
|
+
const registered = new Set(registry.features.map(({ id }) => id));
|
|
51
|
+
for (const composition of ownership.compositions) {
|
|
52
|
+
if (!registered.has(composition.feature)) {
|
|
53
|
+
throw new Error(`Target Product Slice feature registry does not register retained composition feature "${composition.feature}" for ${composition.kind} ${composition.name}.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function developerAgentUpgradeExecutionOptions(options = {}) {
|
|
58
|
+
return {
|
|
59
|
+
...options,
|
|
60
|
+
externalBlueprintDiagnostics: 'suppress',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const DEVELOPER_AGENT_PREVIEW_REFERENCE = /^\.ebk\/agent\/previews\/[a-z][a-z0-9-]{0,62}\.json$/;
|
|
64
|
+
const SHA256_DIGEST = /^sha256:[a-f0-9]{64}$/;
|
|
65
|
+
const PREVIEW_BINDING_FAILURE = 'Developer-Agent Upgrade preview binding does not match the current exact mutation candidate.';
|
|
66
|
+
class DeveloperAgentUpgradePreviewBindingError extends Error {
|
|
67
|
+
classification = 'generated-drift';
|
|
68
|
+
constructor() {
|
|
69
|
+
super(PREVIEW_BINDING_FAILURE);
|
|
70
|
+
this.name = 'DeveloperAgentUpgradePreviewBindingError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.DeveloperAgentUpgradePreviewBindingError = DeveloperAgentUpgradePreviewBindingError;
|
|
74
|
+
function previewBindingFailure() {
|
|
75
|
+
throw new DeveloperAgentUpgradePreviewBindingError();
|
|
76
|
+
}
|
|
77
|
+
function developerAgentPreviewBlueprintReference(preview) {
|
|
78
|
+
if (preview.input.name === 'workspace' ||
|
|
79
|
+
preview.input.name === 'foundation') {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const states = preview.source.ownershipVersions.filter(({ kind, target }) => kind === 'slice' && target === preview.input.name);
|
|
83
|
+
const state = states[0];
|
|
84
|
+
if (states.length !== 1 ||
|
|
85
|
+
!state?.blueprintName ||
|
|
86
|
+
!state.installedBlueprintVersion) {
|
|
87
|
+
return previewBindingFailure();
|
|
88
|
+
}
|
|
89
|
+
return state.blueprintName === index_js_1.BUILTIN_BLUEPRINT_NAME
|
|
90
|
+
? index_js_1.BUILTIN_BLUEPRINT_REFERENCE
|
|
91
|
+
: `${state.blueprintName}@${state.installedBlueprintVersion}`;
|
|
92
|
+
}
|
|
93
|
+
function readDeveloperAgentPreviewFile(workspaceRoot, reference) {
|
|
94
|
+
try {
|
|
95
|
+
if (!DEVELOPER_AGENT_PREVIEW_REFERENCE.test(reference)) {
|
|
96
|
+
return previewBindingFailure();
|
|
97
|
+
}
|
|
98
|
+
const root = (0, node_fs_1.realpathSync)(workspaceRoot);
|
|
99
|
+
const absolute = (0, node_path_1.resolve)(root, ...reference.split('/'));
|
|
100
|
+
const fromRoot = (0, node_path_1.relative)(root, absolute);
|
|
101
|
+
if (fromRoot === '' ||
|
|
102
|
+
fromRoot === '..' ||
|
|
103
|
+
fromRoot.startsWith(`..${node_path_1.sep}`) ||
|
|
104
|
+
(0, node_path_1.isAbsolute)(fromRoot)) {
|
|
105
|
+
return previewBindingFailure();
|
|
106
|
+
}
|
|
107
|
+
const entry = (0, node_fs_1.lstatSync)(absolute);
|
|
108
|
+
if (!entry.isFile() || entry.isSymbolicLink()) {
|
|
109
|
+
return previewBindingFailure();
|
|
110
|
+
}
|
|
111
|
+
const real = (0, node_fs_1.realpathSync)(absolute);
|
|
112
|
+
const realFromRoot = (0, node_path_1.relative)(root, real);
|
|
113
|
+
if (realFromRoot === '..' ||
|
|
114
|
+
realFromRoot.startsWith(`..${node_path_1.sep}`) ||
|
|
115
|
+
(0, node_path_1.isAbsolute)(realFromRoot)) {
|
|
116
|
+
return previewBindingFailure();
|
|
117
|
+
}
|
|
118
|
+
const descriptor = (0, node_fs_1.openSync)(real, node_fs_1.constants.O_RDONLY | (node_fs_1.constants.O_NOFOLLOW ?? 0));
|
|
119
|
+
try {
|
|
120
|
+
const before = (0, node_fs_1.fstatSync)(descriptor);
|
|
121
|
+
const currentUser = typeof process.getuid === 'function' ? process.getuid() : undefined;
|
|
122
|
+
if (!before.isFile() ||
|
|
123
|
+
before.size > model_js_1.DEVELOPER_AGENT_GENERATOR_PREVIEW_RECEIPT_MAX_BYTES ||
|
|
124
|
+
(process.platform !== 'win32' &&
|
|
125
|
+
((currentUser !== undefined && before.uid !== currentUser) ||
|
|
126
|
+
(before.mode & 0o077) !== 0))) {
|
|
127
|
+
return previewBindingFailure();
|
|
128
|
+
}
|
|
129
|
+
const bytes = node_buffer_1.Buffer.alloc(before.size);
|
|
130
|
+
let offset = 0;
|
|
131
|
+
while (offset < bytes.length) {
|
|
132
|
+
const count = (0, node_fs_1.readSync)(descriptor, bytes, offset, bytes.length - offset, offset);
|
|
133
|
+
if (count === 0)
|
|
134
|
+
break;
|
|
135
|
+
offset += count;
|
|
136
|
+
}
|
|
137
|
+
const after = (0, node_fs_1.fstatSync)(descriptor);
|
|
138
|
+
if (offset !== bytes.length ||
|
|
139
|
+
after.dev !== before.dev ||
|
|
140
|
+
after.ino !== before.ino ||
|
|
141
|
+
after.size !== before.size ||
|
|
142
|
+
after.mtimeMs !== before.mtimeMs ||
|
|
143
|
+
after.ctimeMs !== before.ctimeMs) {
|
|
144
|
+
return previewBindingFailure();
|
|
145
|
+
}
|
|
146
|
+
const parsed = JSON.parse(bytes.toString('utf8'));
|
|
147
|
+
const validation = (0, validation_js_1.validateDeveloperAgentGeneratorPreview)(parsed);
|
|
148
|
+
if (!validation.valid)
|
|
149
|
+
return previewBindingFailure();
|
|
150
|
+
return {
|
|
151
|
+
digest: `sha256:${(0, node_crypto_1.createHash)('sha256').update(bytes).digest('hex')}`,
|
|
152
|
+
preview: validation.value,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
(0, node_fs_1.closeSync)(descriptor);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (error instanceof DeveloperAgentUpgradePreviewBindingError)
|
|
161
|
+
throw error;
|
|
162
|
+
return previewBindingFailure();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function requireDeveloperAgentPreviewBinding(tree, options, executionOptions) {
|
|
166
|
+
const reference = options.developerAgentPreview;
|
|
167
|
+
const digest = options.developerAgentPreviewDigest;
|
|
168
|
+
if (reference === undefined && digest === undefined)
|
|
169
|
+
return undefined;
|
|
170
|
+
if (reference === undefined ||
|
|
171
|
+
digest === undefined ||
|
|
172
|
+
!SHA256_DIGEST.test(digest) ||
|
|
173
|
+
options.apply !== true ||
|
|
174
|
+
options.skipFormat !== true ||
|
|
175
|
+
options.skipInstall !== true) {
|
|
176
|
+
return previewBindingFailure();
|
|
177
|
+
}
|
|
178
|
+
const previewFile = readDeveloperAgentPreviewFile(tree.root, reference);
|
|
179
|
+
const { preview } = previewFile;
|
|
180
|
+
const expectedBlueprint = developerAgentPreviewBlueprintReference(preview);
|
|
181
|
+
const packageJsonSource = tree.read('package.json', 'utf8');
|
|
182
|
+
if (packageJsonSource === null)
|
|
183
|
+
return previewBindingFailure();
|
|
184
|
+
let packageJson;
|
|
185
|
+
try {
|
|
186
|
+
packageJson = JSON.parse(packageJsonSource);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
return previewBindingFailure();
|
|
190
|
+
}
|
|
191
|
+
const git = await (0, git_inspection_js_1.inspectDeveloperAgentGit)({ cwd: (0, node_fs_1.realpathSync)(tree.root) });
|
|
192
|
+
if (previewFile.digest !== digest ||
|
|
193
|
+
preview.input.name !== options.name ||
|
|
194
|
+
options.blueprint !== expectedBlueprint ||
|
|
195
|
+
options.inputs !== undefined ||
|
|
196
|
+
preview.source.commit !== git.worktree.commit ||
|
|
197
|
+
git.worktree.dirtyPaths.length > 0 ||
|
|
198
|
+
!packageJson ||
|
|
199
|
+
typeof packageJson !== 'object' ||
|
|
200
|
+
Array.isArray(packageJson) ||
|
|
201
|
+
packageJson.name !== preview.source.workspace ||
|
|
202
|
+
preview.source.frameworkVersion !== (0, generator_js_1.frameworkPackageVersion)()) {
|
|
203
|
+
return previewBindingFailure();
|
|
204
|
+
}
|
|
205
|
+
await assertCurrentDeveloperAgentPreviewSource(tree.root, preview, executionOptions);
|
|
206
|
+
return previewFile;
|
|
207
|
+
}
|
|
208
|
+
async function inspectCurrentDeveloperAgentPreviewSource(workspaceRoot, preview) {
|
|
209
|
+
const target = preview.input.name;
|
|
210
|
+
const context = await (0, context_js_1.inspectDeveloperAgentContext)(workspaceRoot, {
|
|
211
|
+
...(preview.source.candidateProvenance
|
|
212
|
+
? {
|
|
213
|
+
candidateProvenancePath: preview.source.candidateProvenance.reference,
|
|
214
|
+
}
|
|
215
|
+
: {}),
|
|
216
|
+
...(target === 'workspace'
|
|
217
|
+
? {}
|
|
218
|
+
: target === 'foundation'
|
|
219
|
+
? { selectedProjects: ['foundation'] }
|
|
220
|
+
: {
|
|
221
|
+
selectedProjects: ['foundation', target].sort(),
|
|
222
|
+
selectedSlice: target,
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
225
|
+
if (context.git.dirty ||
|
|
226
|
+
context.warnings.some(({ classification }) => classification === 'stale-base')) {
|
|
227
|
+
return previewBindingFailure();
|
|
228
|
+
}
|
|
229
|
+
return (0, preview_source_js_1.developerAgentGeneratorPreviewSource)(context);
|
|
230
|
+
}
|
|
231
|
+
async function assertCurrentDeveloperAgentPreviewSource(workspaceRoot, preview, executionOptions) {
|
|
232
|
+
try {
|
|
233
|
+
const current = await (executionOptions.inspectDeveloperAgentPreviewSource ??
|
|
234
|
+
inspectCurrentDeveloperAgentPreviewSource)(workspaceRoot, preview);
|
|
235
|
+
if (!(0, node_util_1.isDeepStrictEqual)(current, preview.source)) {
|
|
236
|
+
return previewBindingFailure();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
if (error instanceof DeveloperAgentUpgradePreviewBindingError)
|
|
241
|
+
throw error;
|
|
242
|
+
return previewBindingFailure();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const SEEDED_RECONCILIATION = {
|
|
246
|
+
'async/recovery-adapters.ts': {
|
|
247
|
+
category: 'async-adapter',
|
|
248
|
+
implications: [
|
|
249
|
+
'failure-semantics',
|
|
250
|
+
'provider-behavior',
|
|
251
|
+
'provider-permissions',
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
'async/runtime.ts': {
|
|
255
|
+
category: 'async-settings',
|
|
256
|
+
implications: [
|
|
257
|
+
'retry-and-dlq-settings',
|
|
258
|
+
'schedule-contracts',
|
|
259
|
+
'workflow-contracts',
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
'async/webhook.ts': {
|
|
263
|
+
category: 'async-adapter',
|
|
264
|
+
implications: [
|
|
265
|
+
'provider-authentication',
|
|
266
|
+
'provider-behavior',
|
|
267
|
+
'webhook-replay-protection',
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
'async/work-contract.json': {
|
|
271
|
+
category: 'async-settings',
|
|
272
|
+
implications: [
|
|
273
|
+
'recovery-authority',
|
|
274
|
+
'retry-and-dlq-settings',
|
|
275
|
+
'workflow-versioning',
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
'configuration/declarations.json': {
|
|
279
|
+
category: 'configuration-contract',
|
|
280
|
+
implications: [
|
|
281
|
+
'configuration-types',
|
|
282
|
+
'outage-policy',
|
|
283
|
+
'provider-permissions',
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
'configuration/declarations.ts': {
|
|
287
|
+
category: 'configuration-contract',
|
|
288
|
+
implications: [
|
|
289
|
+
'configuration-types',
|
|
290
|
+
'outage-policy',
|
|
291
|
+
'provider-permissions',
|
|
292
|
+
],
|
|
293
|
+
},
|
|
294
|
+
'configuration/local-values.json': {
|
|
295
|
+
category: 'configuration-values',
|
|
296
|
+
implications: ['local-defaults', 'safe-fallbacks'],
|
|
297
|
+
},
|
|
298
|
+
'docs/reliability/slo.json': {
|
|
299
|
+
category: 'reliability-slo',
|
|
300
|
+
implications: [
|
|
301
|
+
'error-budget-policy',
|
|
302
|
+
'journey-ownership',
|
|
303
|
+
'service-level-objectives',
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
'frontend/contract.json': {
|
|
307
|
+
category: 'frontend-contract',
|
|
308
|
+
implications: [
|
|
309
|
+
'accessibility-proof',
|
|
310
|
+
'browser-security-boundary',
|
|
311
|
+
'public-configuration',
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
'frontend/security-headers.json': {
|
|
315
|
+
category: 'frontend-security',
|
|
316
|
+
implications: [
|
|
317
|
+
'content-security-policy',
|
|
318
|
+
'response-header-ownership',
|
|
319
|
+
'transport-profile',
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
'operations/features.json': {
|
|
323
|
+
category: 'feature-controls',
|
|
324
|
+
implications: ['flag-lifecycle', 'owners', 'stop-conditions'],
|
|
325
|
+
},
|
|
326
|
+
'operations/reliability.json': {
|
|
327
|
+
category: 'reliability-operations',
|
|
328
|
+
implications: [
|
|
329
|
+
'alarm-registration',
|
|
330
|
+
'diagnostic-authority',
|
|
331
|
+
'incident-remediation',
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
'operations/release.json': {
|
|
335
|
+
category: 'release-controls',
|
|
336
|
+
implications: [
|
|
337
|
+
'artifact-inventory',
|
|
338
|
+
'compatibility-sequence',
|
|
339
|
+
'rollout-controls',
|
|
340
|
+
],
|
|
341
|
+
},
|
|
342
|
+
'performance/aggregate-count-provider.ts': {
|
|
343
|
+
category: 'performance-aggregate-provider',
|
|
344
|
+
implications: [
|
|
345
|
+
'aggregate-source-authority',
|
|
346
|
+
'business-capability-counts',
|
|
347
|
+
'provider-data-access',
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
'performance/policy.json': {
|
|
351
|
+
category: 'performance-policy',
|
|
352
|
+
implications: [
|
|
353
|
+
'capacity-and-load-settings',
|
|
354
|
+
'cost-budgets',
|
|
355
|
+
'journey-authority',
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
const SEEDED_RECONCILIATION_MARKER_REFERENCE = 'PLAN:5.6/seeded-upgrade-reconciliation';
|
|
360
|
+
const SEEDED_RECONCILIATION_MARKER = '// EBK-TODO(PLAN:5.6/seeded-upgrade-reconciliation): Review retained seeded async, configuration, feature, frontend, performance, reliability, and release decisions against this framework upgrade before protected promotion.';
|
|
361
|
+
const SEEDED_RECONCILIATION_MARKER_ANCHOR = 'async/recovery-adapters.ts';
|
|
362
|
+
const DEVELOPER_AGENT_AGENTS_HEADING = '## Developer-Agent workflow';
|
|
363
|
+
function developerAgentAgentsAppendix(renderedAgents) {
|
|
364
|
+
if (renderedAgents === undefined) {
|
|
365
|
+
throw new Error('Target workspace did not render AGENTS.md.');
|
|
366
|
+
}
|
|
367
|
+
const marker = `\n${DEVELOPER_AGENT_AGENTS_HEADING}\n`;
|
|
368
|
+
const start = renderedAgents.indexOf(marker);
|
|
369
|
+
if (start < 0 || renderedAgents.indexOf(marker, start + marker.length) >= 0) {
|
|
370
|
+
throw new Error('Target AGENTS.md must contain one Developer-Agent workflow section.');
|
|
371
|
+
}
|
|
372
|
+
return renderedAgents.slice(start + 1);
|
|
373
|
+
}
|
|
374
|
+
function planDeveloperAgentInstructionAppend(currentAgents, targetAgents) {
|
|
375
|
+
if (currentAgents === null ||
|
|
376
|
+
new RegExp(`(?:^|\\r?\\n)${DEVELOPER_AGENT_AGENTS_HEADING}(?:\\r?\\n|$)`).test(currentAgents)) {
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
const appendix = developerAgentAgentsAppendix(targetAgents);
|
|
380
|
+
const separator = currentAgents.length === 0
|
|
381
|
+
? ''
|
|
382
|
+
: currentAgents.endsWith('\n\n')
|
|
383
|
+
? ''
|
|
384
|
+
: currentAgents.endsWith('\n')
|
|
385
|
+
? '\n'
|
|
386
|
+
: '\n\n';
|
|
387
|
+
return {
|
|
388
|
+
contents: `${currentAgents}${separator}${appendix}`,
|
|
389
|
+
path: 'AGENTS.md',
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function seededReconciliationDefinition(path) {
|
|
393
|
+
return Object.prototype.hasOwnProperty.call(SEEDED_RECONCILIATION, path)
|
|
394
|
+
? SEEDED_RECONCILIATION[path]
|
|
395
|
+
: null;
|
|
396
|
+
}
|
|
397
|
+
function appendSeededReconciliationMarker(tree, root, report) {
|
|
398
|
+
if (report.seededReconciliation.length === 0)
|
|
399
|
+
return;
|
|
400
|
+
const anchor = node_path_1.posix.join(root, SEEDED_RECONCILIATION_MARKER_ANCHOR);
|
|
401
|
+
const current = tree.read(anchor, 'utf8');
|
|
402
|
+
if (current === null) {
|
|
403
|
+
throw new Error(`Seeded reconciliation requires deterministic anchor ${anchor}.`);
|
|
404
|
+
}
|
|
405
|
+
if (current.includes(SEEDED_RECONCILIATION_MARKER_REFERENCE))
|
|
406
|
+
return;
|
|
407
|
+
tree.write(anchor, `${current.replace(/\s*$/, '')}\n\n${SEEDED_RECONCILIATION_MARKER}\n`);
|
|
408
|
+
}
|
|
409
|
+
function currentContractConsumers(tree, root) {
|
|
410
|
+
const source = tree.read(node_path_1.posix.join(root, 'contracts/dependencies.json'), 'utf8');
|
|
411
|
+
if (source === null)
|
|
412
|
+
return [];
|
|
413
|
+
const declaration = JSON.parse(source);
|
|
414
|
+
if (declaration.schemaVersion !== 1 || !Array.isArray(declaration.consumes)) {
|
|
415
|
+
throw new Error(`${root}/contracts/dependencies.json must be a v1 consumes declaration before upgrade.`);
|
|
416
|
+
}
|
|
417
|
+
return [
|
|
418
|
+
...((0, index_js_2.normalizeApiContractProjectDeclarations)([
|
|
419
|
+
{
|
|
420
|
+
contracts: {
|
|
421
|
+
consumes: declaration.consumes,
|
|
422
|
+
publishes: [],
|
|
423
|
+
},
|
|
424
|
+
project: root.slice(root.lastIndexOf('/') + 1),
|
|
425
|
+
},
|
|
426
|
+
])[0]?.contracts.consumes ?? []),
|
|
427
|
+
];
|
|
428
|
+
}
|
|
17
429
|
const COMPOSITION_REGIONS = [
|
|
18
430
|
'composition-imports',
|
|
19
431
|
'workload-registrations',
|
|
20
432
|
'function-registrations',
|
|
21
433
|
'composition-outputs',
|
|
434
|
+
'workload-role-extensions',
|
|
435
|
+
'workload-role-intent-contributions',
|
|
22
436
|
];
|
|
23
437
|
function preserveCompositionRegions(current, target) {
|
|
24
438
|
let merged = target;
|
|
@@ -53,13 +467,27 @@ function upgradeConflictMessage(label, report) {
|
|
|
53
467
|
];
|
|
54
468
|
return `${label} upgrade has user-modified managed files or unsafe JSON ownership changes:\n${report.conflicting.map((path) => `- ${path}`).join('\n')}${ownershipDetails.length > 0 ? `\n${ownershipDetails.join('\n')}` : ''}\nResolve or restore them before applying the upgrade.`;
|
|
55
469
|
}
|
|
470
|
+
function seededMigrationUpgradeMessage(label, report) {
|
|
471
|
+
return `${label} upgrade cannot rewrite an existing seeded database migration:\n${report.incompatibleSeededMigrations.map((path) => `- ${path}`).join('\n')}\nRegenerate this prerelease workspace instead. Stable-v1 upgrades must add a new migration rather than rewrite migration history.`;
|
|
472
|
+
}
|
|
56
473
|
async function formatRenderedFiles(files, prefix = '') {
|
|
474
|
+
const canonicalApiArtifacts = new Set([
|
|
475
|
+
'api/generated/baseline.json',
|
|
476
|
+
'api/generated/contract.json',
|
|
477
|
+
'api/generated/openapi.json',
|
|
478
|
+
]);
|
|
57
479
|
return Object.fromEntries(await Promise.all(Object.entries(files).map(async ([path, contents]) => {
|
|
480
|
+
const workspacePath = node_path_1.posix.join(prefix, path);
|
|
481
|
+
if (canonicalApiArtifacts.has(path) ||
|
|
482
|
+
(0, workspace_files_js_1.isRawWorkspaceAuthorityPath)(workspacePath) ||
|
|
483
|
+
path.startsWith('database/migrations/')) {
|
|
484
|
+
return [path, contents];
|
|
485
|
+
}
|
|
58
486
|
try {
|
|
59
487
|
return [
|
|
60
488
|
path,
|
|
61
489
|
await (0, prettier_1.format)(contents, {
|
|
62
|
-
filepath:
|
|
490
|
+
filepath: workspacePath,
|
|
63
491
|
singleQuote: true,
|
|
64
492
|
}),
|
|
65
493
|
];
|
|
@@ -80,6 +508,85 @@ function readJson(tree, path, label) {
|
|
|
80
508
|
throw new Error(`${label} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
81
509
|
}
|
|
82
510
|
}
|
|
511
|
+
function objectMember(value, member) {
|
|
512
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
513
|
+
return undefined;
|
|
514
|
+
}
|
|
515
|
+
const candidate = value[member];
|
|
516
|
+
return typeof candidate === 'object' &&
|
|
517
|
+
candidate !== null &&
|
|
518
|
+
!Array.isArray(candidate)
|
|
519
|
+
? candidate
|
|
520
|
+
: undefined;
|
|
521
|
+
}
|
|
522
|
+
function stringMember(value, member) {
|
|
523
|
+
const candidate = value?.[member];
|
|
524
|
+
return typeof candidate === 'string' ? candidate : null;
|
|
525
|
+
}
|
|
526
|
+
function inspectWorkspaceSstVersion(tree, packageJson) {
|
|
527
|
+
const remediation = `pnpm add --workspace-root --save-dev --save-exact sst@${tool_versions_js_1.WORKSPACE_SST_VERSION}`;
|
|
528
|
+
const dependencyVersion = packageJson.dependencies?.sst;
|
|
529
|
+
const developmentVersion = packageJson.devDependencies?.sst;
|
|
530
|
+
const declaredVersion = developmentVersion ?? dependencyVersion ?? null;
|
|
531
|
+
const issues = [];
|
|
532
|
+
if (dependencyVersion !== undefined) {
|
|
533
|
+
issues.push('package.json must declare SST in devDependencies only');
|
|
534
|
+
}
|
|
535
|
+
if (developmentVersion !== tool_versions_js_1.WORKSPACE_SST_VERSION) {
|
|
536
|
+
issues.push(`package.json devDependencies.sst is ${developmentVersion ?? 'missing'}`);
|
|
537
|
+
}
|
|
538
|
+
let lockSpecifier = null;
|
|
539
|
+
let lockVersion = null;
|
|
540
|
+
let lockIntegrity = null;
|
|
541
|
+
const lockContents = tree.read('pnpm-lock.yaml', 'utf8');
|
|
542
|
+
if (lockContents === null) {
|
|
543
|
+
issues.push('pnpm-lock.yaml is missing');
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
try {
|
|
547
|
+
const lock = (0, yaml_1.parse)(lockContents);
|
|
548
|
+
const rootImporter = objectMember(objectMember(lock, 'importers'), '.');
|
|
549
|
+
const rootDependencies = objectMember(rootImporter, 'dependencies');
|
|
550
|
+
const rootDevelopmentDependencies = objectMember(rootImporter, 'devDependencies');
|
|
551
|
+
const dependencyEntry = objectMember(rootDependencies, 'sst');
|
|
552
|
+
const developmentEntry = objectMember(rootDevelopmentDependencies, 'sst');
|
|
553
|
+
const lockEntry = developmentEntry ?? dependencyEntry;
|
|
554
|
+
lockSpecifier = stringMember(lockEntry, 'specifier');
|
|
555
|
+
lockVersion = stringMember(lockEntry, 'version');
|
|
556
|
+
const packageEntry = objectMember(objectMember(lock, 'packages'), `sst@${tool_versions_js_1.WORKSPACE_SST_VERSION}`);
|
|
557
|
+
lockIntegrity = stringMember(objectMember(packageEntry, 'resolution'), 'integrity');
|
|
558
|
+
if (dependencyEntry !== undefined) {
|
|
559
|
+
issues.push('pnpm-lock.yaml must resolve SST from devDependencies only');
|
|
560
|
+
}
|
|
561
|
+
if (lockSpecifier !== tool_versions_js_1.WORKSPACE_SST_VERSION) {
|
|
562
|
+
issues.push(`pnpm-lock.yaml SST specifier is ${lockSpecifier ?? 'missing'}`);
|
|
563
|
+
}
|
|
564
|
+
if (lockVersion !== tool_versions_js_1.WORKSPACE_SST_VERSION) {
|
|
565
|
+
issues.push(`pnpm-lock.yaml SST resolution is ${lockVersion ?? 'missing'}`);
|
|
566
|
+
}
|
|
567
|
+
if (lockIntegrity !== tool_versions_js_1.WORKSPACE_SST_NPM_INTEGRITY) {
|
|
568
|
+
issues.push(`pnpm-lock.yaml SST integrity is ${lockIntegrity ?? 'missing'}`);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
catch (error) {
|
|
572
|
+
issues.push(`pnpm-lock.yaml is not valid YAML: ${error instanceof Error ? error.message : String(error)}`);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return {
|
|
576
|
+
classification: issues.length === 0 ? 'sst-version-current' : 'sst-version-drift',
|
|
577
|
+
declaredVersion,
|
|
578
|
+
expectedIntegrity: tool_versions_js_1.WORKSPACE_SST_NPM_INTEGRITY,
|
|
579
|
+
expectedVersion: tool_versions_js_1.WORKSPACE_SST_VERSION,
|
|
580
|
+
issues,
|
|
581
|
+
lockIntegrity,
|
|
582
|
+
lockSpecifier,
|
|
583
|
+
lockVersion,
|
|
584
|
+
remediation,
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function workspaceSstVersionDriftMessage(state) {
|
|
588
|
+
return `[ebk-upgrade] ${state.classification}: workspace upgrades require the exact audited SST ${state.expectedVersion} manifest and lock resolution before framework ownership can be restamped.\n${state.issues.map((issue) => `- ${issue}`).join('\n')}\nRemediation: ${state.remediation}`;
|
|
589
|
+
}
|
|
83
590
|
function ownershipValidationMessage(label, issues) {
|
|
84
591
|
const details = issues
|
|
85
592
|
.map((issue) => `- ${issue.path}: ${issue.message}`)
|
|
@@ -91,7 +598,7 @@ function ownershipValidationMessage(label, issues) {
|
|
|
91
598
|
}
|
|
92
599
|
function requireUpgradePrerequisites(tree, target) {
|
|
93
600
|
const installedVersion = (0, generator_js_1.frameworkPackageVersion)();
|
|
94
|
-
const workspaceResult = (0,
|
|
601
|
+
const workspaceResult = (0, index_js_4.validateWorkspaceOwnershipRecord)(readJson(tree, '.ebk/ownership.json', 'Workspace ownership metadata'));
|
|
95
602
|
if (!workspaceResult.valid) {
|
|
96
603
|
throw new Error(ownershipValidationMessage('Workspace ownership metadata', workspaceResult.issues));
|
|
97
604
|
}
|
|
@@ -100,7 +607,7 @@ function requireUpgradePrerequisites(tree, target) {
|
|
|
100
607
|
}
|
|
101
608
|
if (target === 'foundation')
|
|
102
609
|
return;
|
|
103
|
-
const foundationResult = (0,
|
|
610
|
+
const foundationResult = (0, index_js_4.validateFoundationOwnershipRecord)(readJson(tree, 'packages/foundation/.ebk/ownership.json', 'Standard Foundation ownership metadata'));
|
|
104
611
|
if (!foundationResult.valid) {
|
|
105
612
|
throw new Error(ownershipValidationMessage('Standard Foundation ownership metadata', foundationResult.issues));
|
|
106
613
|
}
|
|
@@ -156,7 +663,7 @@ Compatible target line: ${current.name}@${transition.compatibilityLine}
|
|
|
156
663
|
Reason: ${reason}
|
|
157
664
|
${declarations.length > 0 ? `Available target declarations:\n${declarations.join('\n')}\n` : ''}No Blueprint files were rendered or changed. Keep using an exact compatible-line target, or create a reviewed replacement Product Slice with publisher guidance.`;
|
|
158
665
|
}
|
|
159
|
-
function gateBreakingBlueprintTransition(current, blueprint, apply) {
|
|
666
|
+
function gateBreakingBlueprintTransition(current, blueprint, apply, output) {
|
|
160
667
|
const transition = (0, index_js_1.classifyBlueprintTransition)(current, blueprint.manifest);
|
|
161
668
|
if (transition.kind === 'compatible')
|
|
162
669
|
return false;
|
|
@@ -183,7 +690,7 @@ function gateBreakingBlueprintTransition(current, blueprint, apply) {
|
|
|
183
690
|
manualSuccession: `${blueprint.manifest.name}@${blueprint.manifest.version}:${migration.manualSuccession}`,
|
|
184
691
|
verification: migration.verification,
|
|
185
692
|
};
|
|
186
|
-
|
|
693
|
+
output.info(`[ebk-upgrade] declared breaking Blueprint transition — manual succession only\n${JSON.stringify(report, null, 2)}\nNo Blueprint files were rendered or changed. The declared executor, if any, was not executed.`);
|
|
187
694
|
if (apply) {
|
|
188
695
|
throw new Error(`Breaking Blueprint migration ${migration.id} is report-only in v1 and was not applied. Follow ${report.manualSuccession}; do not restamp the target Blueprint as active until manual succession is complete.`);
|
|
189
696
|
}
|
|
@@ -197,20 +704,24 @@ function createUpgradeReport(currentFiles, currentOwnership, targetFiles, target
|
|
|
197
704
|
}) {
|
|
198
705
|
const report = {
|
|
199
706
|
addedSeeded: [],
|
|
707
|
+
appendedSeeded: [],
|
|
200
708
|
changed: [],
|
|
201
709
|
claimedJsonMembers: [...jsonOwnershipChanges.claimedJsonMembers],
|
|
202
710
|
conflicting: [],
|
|
203
711
|
conflictingJsonMembers: [...jsonOwnershipChanges.conflictingJsonMembers],
|
|
204
712
|
expandedJsonOwnership: [...jsonOwnershipChanges.expandedJsonOwnership],
|
|
713
|
+
incompatibleSeededMigrations: [],
|
|
205
714
|
missing: [],
|
|
206
715
|
obsolete: [],
|
|
207
716
|
preservedSeeded: [],
|
|
208
717
|
releasedJsonMembers: [...jsonOwnershipChanges.releasedJsonMembers],
|
|
718
|
+
seededReconciliation: [],
|
|
209
719
|
unchanged: [],
|
|
210
720
|
};
|
|
211
721
|
const targetPaths = new Set(targetOwnership.paths.map(({ path }) => path));
|
|
212
722
|
const currentPathOwnership = new Map(currentOwnership.paths.map((entry) => [entry.path, entry]));
|
|
213
|
-
for (const
|
|
723
|
+
for (const targetEntry of targetOwnership.paths) {
|
|
724
|
+
const { mode, path, sha256: targetSha256 } = targetEntry;
|
|
214
725
|
const current = currentFiles.get(path) ?? null;
|
|
215
726
|
const target = targetFiles.get(path);
|
|
216
727
|
const currentEntry = currentPathOwnership.get(path);
|
|
@@ -219,12 +730,36 @@ function createUpgradeReport(currentFiles, currentOwnership, targetFiles, target
|
|
|
219
730
|
}
|
|
220
731
|
if (mode === 'seeded') {
|
|
221
732
|
(current === null ? report.addedSeeded : report.preservedSeeded).push(path);
|
|
733
|
+
if (current !== null &&
|
|
734
|
+
currentEntry !== undefined &&
|
|
735
|
+
currentEntry.sha256 !== targetSha256 &&
|
|
736
|
+
path.startsWith('database/migrations/')) {
|
|
737
|
+
report.incompatibleSeededMigrations.push(path);
|
|
738
|
+
}
|
|
739
|
+
else if (current !== null &&
|
|
740
|
+
currentEntry?.sha256 !== targetSha256 &&
|
|
741
|
+
seededReconciliationDefinition(path) !== null) {
|
|
742
|
+
const reconciliation = seededReconciliationDefinition(path);
|
|
743
|
+
if (reconciliation === null) {
|
|
744
|
+
throw new Error(`Missing seeded reconciliation definition for ${path}.`);
|
|
745
|
+
}
|
|
746
|
+
report.seededReconciliation.push({
|
|
747
|
+
adopterContentSha256: (0, index_js_4.hashOwnedContent)(current, currentEntry ?? targetEntry),
|
|
748
|
+
category: reconciliation.category,
|
|
749
|
+
currentFrameworkSha256: currentEntry?.sha256 ?? null,
|
|
750
|
+
implications: [...reconciliation.implications],
|
|
751
|
+
markerReference: SEEDED_RECONCILIATION_MARKER_REFERENCE,
|
|
752
|
+
path,
|
|
753
|
+
requiredAction: 'review-and-reconcile-preserving-adopter-content',
|
|
754
|
+
targetFrameworkSha256: targetSha256,
|
|
755
|
+
});
|
|
756
|
+
}
|
|
222
757
|
}
|
|
223
758
|
else if (current === null) {
|
|
224
759
|
report.missing.push(path);
|
|
225
760
|
}
|
|
226
761
|
else if (currentEntry !== undefined &&
|
|
227
|
-
(0,
|
|
762
|
+
(0, index_js_4.hashOwnedContent)(current, currentEntry) !== currentEntry.sha256) {
|
|
228
763
|
report.conflicting.push(path);
|
|
229
764
|
}
|
|
230
765
|
else if (current === target) {
|
|
@@ -247,7 +782,7 @@ function createUpgradeReport(currentFiles, currentOwnership, targetFiles, target
|
|
|
247
782
|
const current = currentFiles.get(path) ?? null;
|
|
248
783
|
if (current === null)
|
|
249
784
|
continue;
|
|
250
|
-
if ((0,
|
|
785
|
+
if ((0, index_js_4.hashOwnedContent)(current, entry) === sha256) {
|
|
251
786
|
report.obsolete.push(path);
|
|
252
787
|
}
|
|
253
788
|
else if (!report.conflicting.includes(path)) {
|
|
@@ -264,8 +799,11 @@ function createUpgradeReport(currentFiles, currentOwnership, targetFiles, target
|
|
|
264
799
|
if (!report.conflicting.includes(path))
|
|
265
800
|
report.conflicting.push(path);
|
|
266
801
|
}
|
|
267
|
-
for (const paths of Object.values(report))
|
|
268
|
-
paths.sort()
|
|
802
|
+
for (const paths of Object.values(report)) {
|
|
803
|
+
paths.sort((left, right) => typeof left === 'string' && typeof right === 'string'
|
|
804
|
+
? (0, deterministic_order_js_1.compareUtf16)(left, right)
|
|
805
|
+
: (0, deterministic_order_js_1.compareUtf16)(left.path, right.path));
|
|
806
|
+
}
|
|
269
807
|
return report;
|
|
270
808
|
}
|
|
271
809
|
function mergeStructuredTargetFiles(currentFiles, currentOwnership, targetFiles, targetOwnership) {
|
|
@@ -295,7 +833,7 @@ function mergeStructuredTargetFiles(currentFiles, currentOwnership, targetFiles,
|
|
|
295
833
|
if (!targetEntry.managedJsonPointers)
|
|
296
834
|
continue;
|
|
297
835
|
if (currentEntry?.managedJsonPointers) {
|
|
298
|
-
const transition = (0,
|
|
836
|
+
const transition = (0, index_js_4.analyzeManagedJsonPointerTransition)(current, target, currentEntry.managedJsonPointers, targetEntry.managedJsonPointers);
|
|
299
837
|
changes.claimedJsonMembers.push(...transition.claimed.map((pointer) => `${targetEntry.path}#${pointer}`));
|
|
300
838
|
changes.conflictingJsonMembers.push(...transition.conflictingClaims.map((pointer) => `${targetEntry.path}#${pointer}`));
|
|
301
839
|
changes.releasedJsonMembers.push(...transition.released.map((pointer) => `${targetEntry.path}#${pointer}`));
|
|
@@ -304,26 +842,12 @@ function mergeStructuredTargetFiles(currentFiles, currentOwnership, targetFiles,
|
|
|
304
842
|
continue;
|
|
305
843
|
}
|
|
306
844
|
}
|
|
307
|
-
files.set(targetEntry.path, (0,
|
|
845
|
+
files.set(targetEntry.path, (0, index_js_4.mergeManagedJsonContents)(current, target, targetEntry.managedJsonPointers));
|
|
308
846
|
}
|
|
309
847
|
return { files, ...changes };
|
|
310
848
|
}
|
|
311
|
-
function renderCompositionUpgradePlan(ownership) {
|
|
849
|
+
function renderCompositionUpgradePlan(ownership, workspace, runtimeVersion, serviceAdapterOwner) {
|
|
312
850
|
const compositionPaths = ownership.paths.filter(({ origin }) => origin === 'composition');
|
|
313
|
-
const functionNames = new Set();
|
|
314
|
-
const workloads = new Map();
|
|
315
|
-
for (const { path } of compositionPaths) {
|
|
316
|
-
const functionMatch = /^infra\/functions\/([^/]+)\.ts$/.exec(path);
|
|
317
|
-
if (functionMatch?.[1])
|
|
318
|
-
functionNames.add(functionMatch[1]);
|
|
319
|
-
const workloadMatch = /^(services|jobs)\/([^/]+)\//.exec(path);
|
|
320
|
-
if (workloadMatch?.[1] && workloadMatch[2]) {
|
|
321
|
-
workloads.set(`${workloadMatch[1]}/${workloadMatch[2]}`, {
|
|
322
|
-
kind: workloadMatch[1] === 'services' ? 'service' : 'job',
|
|
323
|
-
name: workloadMatch[2],
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
851
|
const files = {};
|
|
328
852
|
const paths = new Map();
|
|
329
853
|
const addPlan = (planFiles, planPaths) => {
|
|
@@ -340,17 +864,20 @@ function renderCompositionUpgradePlan(ownership) {
|
|
|
340
864
|
mode: entry.mode ?? 'managed',
|
|
341
865
|
origin: 'composition',
|
|
342
866
|
path: entry.path,
|
|
343
|
-
sha256: (0,
|
|
867
|
+
sha256: (0, index_js_4.hashOwnedContent)(contents, entry),
|
|
344
868
|
});
|
|
345
869
|
}
|
|
346
870
|
};
|
|
347
|
-
for (const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
871
|
+
for (const composition of ownership.compositions) {
|
|
872
|
+
if (composition.kind === 'function') {
|
|
873
|
+
const plan = (0, function_js_1.createFunctionFilePlan)(workspace, ownership.slice, composition.name, composition.feature);
|
|
874
|
+
addPlan(plan.files, plan.paths);
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
const plan = (0, workload_js_1.createWorkloadFilePlan)(workspace, ownership.slice, composition.name, composition.kind, runtimeVersion, composition.feature, composition.kind === 'service' &&
|
|
878
|
+
composition.name === serviceAdapterOwner);
|
|
879
|
+
addPlan(plan.files, plan.paths);
|
|
880
|
+
}
|
|
354
881
|
}
|
|
355
882
|
for (const entry of compositionPaths) {
|
|
356
883
|
if (paths.has(entry.path))
|
|
@@ -359,12 +886,124 @@ function renderCompositionUpgradePlan(ownership) {
|
|
|
359
886
|
}
|
|
360
887
|
return { files, paths: [...paths.values()] };
|
|
361
888
|
}
|
|
362
|
-
|
|
889
|
+
function retainedServiceAdapterOwner(tree, root, ownership) {
|
|
890
|
+
const pathOwners = ownership.compositions
|
|
891
|
+
.filter(({ kind, name }) => kind === 'service' &&
|
|
892
|
+
ownership.paths.some(({ mode, origin, path }) => path === `services/${name}/src/performance.ts` &&
|
|
893
|
+
mode === 'managed' &&
|
|
894
|
+
origin === 'composition'))
|
|
895
|
+
.map(({ name }) => name);
|
|
896
|
+
if (ownership.blueprint.name !== index_js_1.BUILTIN_BLUEPRINT_NAME &&
|
|
897
|
+
pathOwners.length === 0) {
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
const operationsPath = node_path_1.posix.join(root, 'operations/performance.json');
|
|
901
|
+
if (!tree.exists(operationsPath)) {
|
|
902
|
+
if (pathOwners.length === 0)
|
|
903
|
+
return null;
|
|
904
|
+
throw new Error('Product Slice Service adapter owner cannot be reconciled for upgrade.');
|
|
905
|
+
}
|
|
906
|
+
const operations = readJson(tree, operationsPath, 'Product Slice performance operations registry');
|
|
907
|
+
const record = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
908
|
+
const load = record(operations) ? operations['load'] : undefined;
|
|
909
|
+
const allowlistedAdapters = record(load)
|
|
910
|
+
? load['allowlistedScenarioAdapters']
|
|
911
|
+
: undefined;
|
|
912
|
+
const owner = record(load) ? load['serviceAdapterOwner'] : undefined;
|
|
913
|
+
const status = record(load) ? load['serviceAdapterStatus'] : undefined;
|
|
914
|
+
if (!record(load) ||
|
|
915
|
+
!Array.isArray(allowlistedAdapters) ||
|
|
916
|
+
allowlistedAdapters.some((adapter) => typeof adapter !== 'string')) {
|
|
917
|
+
throw new Error('Product Slice Service adapter owner cannot be reconciled for upgrade.');
|
|
918
|
+
}
|
|
919
|
+
const scenarioDocument = readJson(tree, node_path_1.posix.join(root, 'performance/load-scenarios.json'), 'Product Slice protected-load scenario catalog');
|
|
920
|
+
const scenarios = record(scenarioDocument)
|
|
921
|
+
? scenarioDocument['scenarios']
|
|
922
|
+
: undefined;
|
|
923
|
+
const serviceScenarios = Array.isArray(scenarios)
|
|
924
|
+
? scenarios.filter((scenario) => record(scenario) && scenario['id'] === 'service-extension')
|
|
925
|
+
: [];
|
|
926
|
+
const serviceScenario = serviceScenarios[0];
|
|
927
|
+
const secretAccess = readJson(tree, node_path_1.posix.join(root, 'secrets/workload-access.json'), 'Product Slice secret workload access registry');
|
|
928
|
+
const bindings = record(secretAccess) ? secretAccess['bindings'] : undefined;
|
|
929
|
+
const logicalName = `${ownership.slice
|
|
930
|
+
.split('-')
|
|
931
|
+
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
932
|
+
.join('')}PerformanceLoadHmacKeys`;
|
|
933
|
+
const protectedLoadBindings = Array.isArray(bindings)
|
|
934
|
+
? bindings.filter((binding) => record(binding) &&
|
|
935
|
+
binding['logicalName'] === logicalName &&
|
|
936
|
+
typeof binding['workload'] === 'string' &&
|
|
937
|
+
binding['workload'].endsWith('-service-performance-task'))
|
|
938
|
+
: [];
|
|
939
|
+
if (status === 'requires-adopter-service-runtime-endpoint' &&
|
|
940
|
+
owner === null &&
|
|
941
|
+
pathOwners.length === 0 &&
|
|
942
|
+
!allowlistedAdapters.includes('ebk-service-v1') &&
|
|
943
|
+
serviceScenarios.length === 1 &&
|
|
944
|
+
record(serviceScenario) &&
|
|
945
|
+
serviceScenario['adapterId'] === 'ebk-service-v1' &&
|
|
946
|
+
serviceScenario['adapterStatus'] === 'requires-adopter-service-endpoint' &&
|
|
947
|
+
serviceScenario['saturationSignalRef'] ===
|
|
948
|
+
'adopter:service-saturation-percent' &&
|
|
949
|
+
serviceScenario['workload'] === 'service' &&
|
|
950
|
+
Array.isArray(bindings) &&
|
|
951
|
+
protectedLoadBindings.length === 0) {
|
|
952
|
+
return null;
|
|
953
|
+
}
|
|
954
|
+
if (status === 'managed-generated-service-runtime-endpoint' &&
|
|
955
|
+
typeof owner === 'string' &&
|
|
956
|
+
pathOwners.length === 1 &&
|
|
957
|
+
pathOwners[0] === owner &&
|
|
958
|
+
allowlistedAdapters.includes('ebk-service-v1') &&
|
|
959
|
+
serviceScenarios.length === 1 &&
|
|
960
|
+
record(serviceScenario) &&
|
|
961
|
+
serviceScenario['adapterId'] === 'ebk-service-v1' &&
|
|
962
|
+
serviceScenario['adapterStatus'] === 'managed' &&
|
|
963
|
+
serviceScenario['saturationSignalRef'] ===
|
|
964
|
+
`runtime:service-${owner}-per-task-concurrency-utilization-percent` &&
|
|
965
|
+
serviceScenario['workload'] === 'service' &&
|
|
966
|
+
Array.isArray(bindings) &&
|
|
967
|
+
protectedLoadBindings.length === 1 &&
|
|
968
|
+
record(protectedLoadBindings[0]) &&
|
|
969
|
+
protectedLoadBindings[0]['workload'] ===
|
|
970
|
+
`${ownership.slice}.${owner}-service-performance-task`) {
|
|
971
|
+
return owner;
|
|
972
|
+
}
|
|
973
|
+
throw new Error('Product Slice Service adapter owner cannot be reconciled for upgrade.');
|
|
974
|
+
}
|
|
975
|
+
function carryRetainedServiceAdapterAuthority(targetFiles, owner) {
|
|
976
|
+
const path = 'operations/performance.json';
|
|
977
|
+
const targetSource = targetFiles[path];
|
|
978
|
+
if (targetSource === undefined) {
|
|
979
|
+
throw new Error('Target Product Slice does not render the managed Service adapter authority.');
|
|
980
|
+
}
|
|
981
|
+
let target;
|
|
982
|
+
try {
|
|
983
|
+
target = JSON.parse(targetSource);
|
|
984
|
+
}
|
|
985
|
+
catch {
|
|
986
|
+
throw new Error('Target Product Slice performance operations registry is invalid JSON.');
|
|
987
|
+
}
|
|
988
|
+
if (!target.load ||
|
|
989
|
+
!Array.isArray(target.load.allowlistedScenarioAdapters) ||
|
|
990
|
+
target.load.allowlistedScenarioAdapters.some((adapter) => typeof adapter !== 'string')) {
|
|
991
|
+
throw new Error('Product Slice Service adapter owner cannot be carried into the target Blueprint.');
|
|
992
|
+
}
|
|
993
|
+
target.load.allowlistedScenarioAdapters = [
|
|
994
|
+
...new Set([...target.load.allowlistedScenarioAdapters, 'ebk-service-v1']),
|
|
995
|
+
].sort();
|
|
996
|
+
target.load.serviceAdapterOwner = owner;
|
|
997
|
+
target.load.serviceAdapterStatus =
|
|
998
|
+
'managed-generated-service-runtime-endpoint';
|
|
999
|
+
return { ...targetFiles, [path]: json(target) };
|
|
1000
|
+
}
|
|
1001
|
+
async function upgradeFoundation(tree, options, packageJson, output) {
|
|
363
1002
|
if (options.blueprint !== undefined || options.inputs !== undefined) {
|
|
364
1003
|
throw new Error('Standard Foundation upgrades do not accept Blueprint or input options.');
|
|
365
1004
|
}
|
|
366
1005
|
const root = 'packages/foundation';
|
|
367
|
-
const ownershipResult = (0,
|
|
1006
|
+
const ownershipResult = (0, index_js_4.validateFoundationOwnershipRecord)(readJson(tree, node_path_1.posix.join(root, '.ebk/ownership.json'), 'Standard Foundation ownership metadata'));
|
|
368
1007
|
if (!ownershipResult.valid) {
|
|
369
1008
|
throw new Error(ownershipValidationMessage('Standard Foundation ownership metadata', ownershipResult.issues));
|
|
370
1009
|
}
|
|
@@ -380,7 +1019,7 @@ async function upgradeFoundation(tree, options, packageJson) {
|
|
|
380
1019
|
...renderedTarget,
|
|
381
1020
|
files: await formatRenderedFiles(renderedTarget.files, root),
|
|
382
1021
|
};
|
|
383
|
-
const targetValidation = (0,
|
|
1022
|
+
const targetValidation = (0, index_js_4.validateFoundationOwnershipRecord)(target.ownership);
|
|
384
1023
|
if (!targetValidation.valid) {
|
|
385
1024
|
throw new Error(`Target Standard Foundation ownership metadata is invalid:\n${targetValidation.issues
|
|
386
1025
|
.map((issue) => `- ${issue.path}: ${issue.message}`)
|
|
@@ -396,9 +1035,12 @@ async function upgradeFoundation(tree, options, packageJson) {
|
|
|
396
1035
|
]));
|
|
397
1036
|
const mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(target.files)), target.ownership);
|
|
398
1037
|
const report = createUpgradeReport(currentFiles, currentOwnership, mergedTarget.files, target.ownership, mergedTarget);
|
|
399
|
-
|
|
1038
|
+
output.info(`[ebk-upgrade] foundation ${currentOwnership.frameworkVersion} -> ${target.ownership.frameworkVersion}\n${JSON.stringify(report, null, 2)}`);
|
|
400
1039
|
if (!options.apply)
|
|
401
1040
|
return;
|
|
1041
|
+
if (report.incompatibleSeededMigrations.length > 0) {
|
|
1042
|
+
throw new Error(seededMigrationUpgradeMessage('Standard Foundation', report));
|
|
1043
|
+
}
|
|
402
1044
|
if (report.conflicting.length > 0) {
|
|
403
1045
|
throw new Error(upgradeConflictMessage('Standard Foundation', report));
|
|
404
1046
|
}
|
|
@@ -419,19 +1061,20 @@ async function upgradeFoundation(tree, options, packageJson) {
|
|
|
419
1061
|
}
|
|
420
1062
|
if (!options.skipFormat)
|
|
421
1063
|
await (0, devkit_1.formatFiles)(tree);
|
|
422
|
-
(0,
|
|
1064
|
+
(0, index_js_4.restampFoundationOwnership)(tree);
|
|
423
1065
|
}
|
|
424
|
-
async function upgradeWorkspace(tree, options, packageJson) {
|
|
1066
|
+
async function upgradeWorkspace(tree, options, packageJson, output) {
|
|
425
1067
|
if (options.blueprint !== undefined || options.inputs !== undefined) {
|
|
426
1068
|
throw new Error('Workspace upgrades do not accept Blueprint or input options.');
|
|
427
1069
|
}
|
|
428
|
-
const ownershipResult = (0,
|
|
1070
|
+
const ownershipResult = (0, index_js_4.validateWorkspaceOwnershipRecord)(readJson(tree, '.ebk/ownership.json', 'Workspace ownership metadata'));
|
|
429
1071
|
if (!ownershipResult.valid) {
|
|
430
1072
|
throw new Error(ownershipValidationMessage('Workspace ownership metadata', ownershipResult.issues));
|
|
431
1073
|
}
|
|
432
1074
|
if (!packageJson.name) {
|
|
433
1075
|
throw new Error('Workspace package.json must declare a name.');
|
|
434
1076
|
}
|
|
1077
|
+
const sstVersionState = inspectWorkspaceSstVersion(tree, packageJson);
|
|
435
1078
|
const currentOwnership = ownershipResult.value;
|
|
436
1079
|
const renderedTarget = (0, workspace_files_js_1.renderWorkspaceRootFilePlan)({
|
|
437
1080
|
frameworkVersion: (0, generator_js_1.frameworkPackageVersion)(),
|
|
@@ -441,7 +1084,7 @@ async function upgradeWorkspace(tree, options, packageJson) {
|
|
|
441
1084
|
...renderedTarget,
|
|
442
1085
|
files: await formatRenderedFiles(renderedTarget.files),
|
|
443
1086
|
};
|
|
444
|
-
const targetValidation = (0,
|
|
1087
|
+
const targetValidation = (0, index_js_4.validateWorkspaceOwnershipRecord)(target.ownership);
|
|
445
1088
|
if (!targetValidation.valid) {
|
|
446
1089
|
throw new Error('Target workspace ownership metadata is invalid.');
|
|
447
1090
|
}
|
|
@@ -451,26 +1094,27 @@ async function upgradeWorkspace(tree, options, packageJson) {
|
|
|
451
1094
|
]);
|
|
452
1095
|
const currentFiles = new Map([...allPaths].map((path) => [path, tree.read(path, 'utf8')]));
|
|
453
1096
|
const mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(target.files)), target.ownership);
|
|
1097
|
+
const developerAgentInstructionAppend = planDeveloperAgentInstructionAppend(currentFiles.get('AGENTS.md') ?? null, target.files['AGENTS.md']);
|
|
1098
|
+
if (developerAgentInstructionAppend !== null) {
|
|
1099
|
+
mergedTarget.files.set(developerAgentInstructionAppend.path, developerAgentInstructionAppend.contents);
|
|
1100
|
+
}
|
|
454
1101
|
const report = createUpgradeReport(currentFiles, currentOwnership, mergedTarget.files, target.ownership, mergedTarget);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
catch {
|
|
468
|
-
// The upgrade preserves adopter-owned policy source. Its normal validator
|
|
469
|
-
// reports malformed JSON; this notice is only for the known missing member.
|
|
470
|
-
}
|
|
1102
|
+
if (developerAgentInstructionAppend !== null) {
|
|
1103
|
+
report.preservedSeeded = report.preservedSeeded.filter((path) => path !== developerAgentInstructionAppend.path);
|
|
1104
|
+
report.appendedSeeded.push(developerAgentInstructionAppend.path);
|
|
1105
|
+
}
|
|
1106
|
+
output.info(`[ebk-upgrade] workspace ${currentOwnership.frameworkVersion} -> ${target.ownership.frameworkVersion}\n${JSON.stringify({ ...report, tooling: { sst: sstVersionState } }, null, 2)}`);
|
|
1107
|
+
if (sstVersionState.classification === 'sst-version-drift') {
|
|
1108
|
+
const message = workspaceSstVersionDriftMessage(sstVersionState);
|
|
1109
|
+
if (options.apply)
|
|
1110
|
+
throw new Error(message);
|
|
1111
|
+
output.warn(message);
|
|
471
1112
|
}
|
|
472
1113
|
if (!options.apply)
|
|
473
1114
|
return;
|
|
1115
|
+
if (report.incompatibleSeededMigrations.length > 0) {
|
|
1116
|
+
throw new Error(seededMigrationUpgradeMessage('Workspace', report));
|
|
1117
|
+
}
|
|
474
1118
|
if (report.conflicting.length > 0) {
|
|
475
1119
|
throw new Error(upgradeConflictMessage('Workspace', report));
|
|
476
1120
|
}
|
|
@@ -480,32 +1124,43 @@ async function upgradeWorkspace(tree, options, packageJson) {
|
|
|
480
1124
|
...report.changed,
|
|
481
1125
|
...report.missing,
|
|
482
1126
|
...report.addedSeeded,
|
|
1127
|
+
...report.appendedSeeded,
|
|
483
1128
|
'.ebk/ownership.json',
|
|
484
1129
|
]);
|
|
485
1130
|
for (const path of writePaths) {
|
|
1131
|
+
if (path === developerAgentInstructionAppend?.path)
|
|
1132
|
+
continue;
|
|
486
1133
|
const contents = mergedTarget.files.get(path);
|
|
487
1134
|
if (contents === undefined) {
|
|
488
1135
|
throw new Error(`Target workspace did not render ${path}.`);
|
|
489
1136
|
}
|
|
490
1137
|
tree.write(path, contents);
|
|
491
1138
|
}
|
|
492
|
-
if (!options.skipFormat)
|
|
1139
|
+
if (!options.skipFormat) {
|
|
493
1140
|
await (0, devkit_1.formatFiles)(tree);
|
|
494
|
-
|
|
1141
|
+
for (const [path, contents] of Object.entries(target.files)) {
|
|
1142
|
+
if ((0, workspace_files_js_1.isRawWorkspaceAuthorityPath)(path))
|
|
1143
|
+
tree.write(path, contents);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
if (developerAgentInstructionAppend !== null) {
|
|
1147
|
+
tree.write(developerAgentInstructionAppend.path, developerAgentInstructionAppend.contents);
|
|
1148
|
+
}
|
|
1149
|
+
(0, index_js_4.restampWorkspaceOwnership)(tree);
|
|
495
1150
|
}
|
|
496
|
-
async function
|
|
1151
|
+
async function executeUpgradeGenerator(tree, options, output = devkit_1.logger, executionOptions = {}) {
|
|
497
1152
|
const name = requireName(options.name);
|
|
498
1153
|
const packageJson = readJson(tree, 'package.json', 'Workspace package.json');
|
|
499
1154
|
if (name === 'workspace') {
|
|
500
|
-
return upgradeWorkspace(tree, options, packageJson);
|
|
1155
|
+
return upgradeWorkspace(tree, options, packageJson, output);
|
|
501
1156
|
}
|
|
502
1157
|
if (name === 'foundation') {
|
|
503
1158
|
requireUpgradePrerequisites(tree, 'foundation');
|
|
504
|
-
return upgradeFoundation(tree, options, packageJson);
|
|
1159
|
+
return upgradeFoundation(tree, options, packageJson, output);
|
|
505
1160
|
}
|
|
506
1161
|
requireUpgradePrerequisites(tree, 'product-slice');
|
|
507
1162
|
const root = node_path_1.posix.join('packages', name);
|
|
508
|
-
const ownershipResult = (0,
|
|
1163
|
+
const ownershipResult = (0, index_js_4.validateGeneratedOwnershipRecord)(readJson(tree, node_path_1.posix.join(root, '.ebk/ownership.json'), 'Product Slice ownership metadata'));
|
|
509
1164
|
if (!ownershipResult.valid) {
|
|
510
1165
|
throw new Error(ownershipValidationMessage('Product Slice ownership metadata', ownershipResult.issues));
|
|
511
1166
|
}
|
|
@@ -513,38 +1168,46 @@ async function upgradeGenerator(tree, options) {
|
|
|
513
1168
|
if (currentOwnership.slice !== name) {
|
|
514
1169
|
throw new Error(`Ownership metadata belongs to ${currentOwnership.slice}, not ${name}.`);
|
|
515
1170
|
}
|
|
1171
|
+
for (const composition of currentOwnership.compositions) {
|
|
1172
|
+
(0, feature_registry_js_1.requireRegisteredSliceFeature)(tree, root, composition.feature);
|
|
1173
|
+
}
|
|
1174
|
+
const serviceAdapterOwner = retainedServiceAdapterOwner(tree, root, currentOwnership);
|
|
516
1175
|
const recordedReference = currentOwnership.blueprint.name === index_js_1.BUILTIN_BLUEPRINT_NAME
|
|
517
1176
|
? index_js_1.BUILTIN_BLUEPRINT_REFERENCE
|
|
518
1177
|
: `${currentOwnership.blueprint.name}@${currentOwnership.blueprint.version}`;
|
|
519
1178
|
const blueprint = (0, index_js_1.resolveBlueprint)({
|
|
1179
|
+
localAuthoringPackages: packageJson.ebk?.blueprints?.localAuthoringPackages ?? [],
|
|
520
1180
|
localPackages: packageJson.ebk?.blueprints?.localPackages,
|
|
521
1181
|
reference: options.blueprint ?? recordedReference,
|
|
522
|
-
trust: { packages: packageJson.ebk?.blueprints?.trustedPackages ?? [] },
|
|
523
1182
|
workspaceRoot: tree.root,
|
|
524
1183
|
});
|
|
1184
|
+
if (serviceAdapterOwner !== null && blueprint.source !== 'built-in') {
|
|
1185
|
+
throw new Error('External Blueprint upgrades cannot retain the managed generated Service adapter authority; remove or explicitly migrate the elected adapter before changing Blueprint authority.');
|
|
1186
|
+
}
|
|
525
1187
|
const inputResult = (0, index_js_1.validateBlueprintInputs)(blueprint.inputSchema, parseInputs(options.inputs, currentOwnership.inputs));
|
|
526
1188
|
if (!inputResult.valid) {
|
|
527
1189
|
throw new Error(`Blueprint inputs are invalid:\n${inputResult.issues
|
|
528
1190
|
.map((issue) => `- ${issue.path}: ${issue.message}`)
|
|
529
1191
|
.join('\n')}`);
|
|
530
1192
|
}
|
|
531
|
-
const compatibility = (0,
|
|
1193
|
+
const compatibility = (0, index_js_3.validateFoundationCompatibility)(blueprint.manifest.foundation, readJson(tree, 'packages/foundation/contracts/foundation.json', 'Standard Foundation descriptor'));
|
|
532
1194
|
if (!compatibility.valid) {
|
|
533
1195
|
throw new Error(`Standard Foundation is incompatible with the target Blueprint:\n${compatibility.issues
|
|
534
1196
|
.map((issue) => `- ${issue.path}: ${issue.message}`)
|
|
535
1197
|
.join('\n')}`);
|
|
536
1198
|
}
|
|
537
|
-
if (gateBreakingBlueprintTransition(currentOwnership.blueprint, blueprint, options.apply === true)) {
|
|
1199
|
+
if (gateBreakingBlueprintTransition(currentOwnership.blueprint, blueprint, options.apply === true, output)) {
|
|
538
1200
|
return;
|
|
539
1201
|
}
|
|
540
1202
|
let targetFiles;
|
|
541
1203
|
let targetOwnership;
|
|
1204
|
+
let externalBlueprintDestinationPaths;
|
|
542
1205
|
const scope = workspaceScope(packageJson);
|
|
543
1206
|
if (blueprint.source === 'built-in') {
|
|
544
1207
|
const runtimeVersion = packageJson.dependencies?.['@empire-builder-kit/runtime'];
|
|
545
1208
|
if (!runtimeVersion)
|
|
546
1209
|
throw new Error('Workspace must depend on @empire-builder-kit/runtime.');
|
|
547
|
-
const plan = (0,
|
|
1210
|
+
const plan = (0, built_in_plan_js_1.createBuiltInSlicePlan)(name, scope, runtimeVersion, blueprint.manifest, inputResult.value);
|
|
548
1211
|
targetFiles = Object.fromEntries(Object.entries(plan.files).map(([path, contents]) => {
|
|
549
1212
|
const current = tree.read(node_path_1.posix.join(root, path), 'utf8');
|
|
550
1213
|
return [
|
|
@@ -554,39 +1217,75 @@ async function upgradeGenerator(tree, options) {
|
|
|
554
1217
|
: preserveCompositionRegions(current, contents),
|
|
555
1218
|
];
|
|
556
1219
|
}));
|
|
557
|
-
targetOwnership =
|
|
1220
|
+
targetOwnership = {
|
|
1221
|
+
...plan.ownership,
|
|
1222
|
+
contracts: {
|
|
1223
|
+
...plan.ownership.contracts,
|
|
1224
|
+
consumes: currentContractConsumers(tree, root),
|
|
1225
|
+
},
|
|
1226
|
+
};
|
|
558
1227
|
}
|
|
559
1228
|
else {
|
|
1229
|
+
const nxVersion = packageJson.devDependencies?.['@empire-builder-kit/nx'];
|
|
1230
|
+
const runtimeVersion = packageJson.dependencies?.['@empire-builder-kit/runtime'];
|
|
1231
|
+
if (!nxVersion || !runtimeVersion) {
|
|
1232
|
+
throw new Error('External Blueprint upgrades require exact Nx and Runtime framework dependencies.');
|
|
1233
|
+
}
|
|
560
1234
|
if (!blueprint.generatorPath) {
|
|
561
1235
|
throw new Error('Resolved external Blueprint has no generator entry point.');
|
|
562
1236
|
}
|
|
1237
|
+
if (!blueprint.packageRoot) {
|
|
1238
|
+
throw new Error('Resolved external Blueprint has no package root.');
|
|
1239
|
+
}
|
|
1240
|
+
if (blueprint.source === 'installed' &&
|
|
1241
|
+
(!blueprint.registryIntegrity || !blueprint.lockfileDigest)) {
|
|
1242
|
+
throw new Error('Resolved installed Blueprint has no lockfile and registry-integrity authority.');
|
|
1243
|
+
}
|
|
1244
|
+
const executionSource = blueprint.source === 'installed'
|
|
1245
|
+
? {
|
|
1246
|
+
lockfileDigest: blueprint.lockfileDigest,
|
|
1247
|
+
registryIntegrity: blueprint.registryIntegrity,
|
|
1248
|
+
source: 'installed',
|
|
1249
|
+
}
|
|
1250
|
+
: { source: 'local' };
|
|
563
1251
|
const generated = await (0, index_js_1.executeBlueprintGenerator)(blueprint.generatorPath, {
|
|
564
1252
|
foundation: compatibility.value,
|
|
565
1253
|
inputs: inputResult.value,
|
|
566
1254
|
manifest: blueprint.manifest,
|
|
567
1255
|
name,
|
|
568
1256
|
root,
|
|
569
|
-
workspace: {
|
|
1257
|
+
workspace: {
|
|
1258
|
+
framework: { nx: nxVersion, runtime: runtimeVersion },
|
|
1259
|
+
name: packageJson.name ?? '',
|
|
1260
|
+
scope,
|
|
1261
|
+
},
|
|
1262
|
+
}, {
|
|
1263
|
+
diagnostics: executionOptions.externalBlueprintDiagnostics ?? 'inherit',
|
|
1264
|
+
packageRoot: blueprint.packageRoot,
|
|
1265
|
+
...executionSource,
|
|
1266
|
+
workspaceRoot: tree.root,
|
|
570
1267
|
});
|
|
1268
|
+
externalBlueprintDestinationPaths = generated.files.map(({ path }) => path);
|
|
571
1269
|
const paths = generated.files.map(({ contents, managedJsonPointers, mode, path }) => ({
|
|
572
1270
|
...(managedJsonPointers ? { managedJsonPointers } : {}),
|
|
573
1271
|
mode,
|
|
574
1272
|
origin: 'blueprint',
|
|
575
1273
|
path,
|
|
576
|
-
sha256: (0,
|
|
1274
|
+
sha256: (0, index_js_4.hashOwnedContent)(contents, { managedJsonPointers }),
|
|
577
1275
|
}));
|
|
578
|
-
paths.sort((left, right) => left.path
|
|
1276
|
+
paths.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.path, right.path));
|
|
579
1277
|
targetOwnership = {
|
|
580
1278
|
blueprint: {
|
|
581
1279
|
name: blueprint.manifest.name,
|
|
582
1280
|
version: blueprint.manifest.version,
|
|
583
1281
|
},
|
|
1282
|
+
compositions: [],
|
|
584
1283
|
contracts: generated.contracts,
|
|
585
1284
|
foundation: blueprint.manifest.foundation,
|
|
586
1285
|
inputs: inputResult.value,
|
|
587
1286
|
paths,
|
|
588
1287
|
projects: generated.projects,
|
|
589
|
-
schemaVersion:
|
|
1288
|
+
schemaVersion: index_js_4.GENERATED_OWNERSHIP_SCHEMA_VERSION,
|
|
590
1289
|
slice: name,
|
|
591
1290
|
verification: blueprint.manifest.verification,
|
|
592
1291
|
};
|
|
@@ -595,9 +1294,18 @@ async function upgradeGenerator(tree, options) {
|
|
|
595
1294
|
['.ebk/ownership.json', json(targetOwnership)],
|
|
596
1295
|
]);
|
|
597
1296
|
}
|
|
1297
|
+
if (blueprint.source === 'built-in' && serviceAdapterOwner !== null) {
|
|
1298
|
+
targetFiles = carryRetainedServiceAdapterAuthority(targetFiles, serviceAdapterOwner);
|
|
1299
|
+
}
|
|
598
1300
|
const targetPathSet = new Set(targetOwnership.paths.map(({ path }) => path));
|
|
599
|
-
const compositionPlan = renderCompositionUpgradePlan(currentOwnership);
|
|
1301
|
+
const compositionPlan = renderCompositionUpgradePlan(currentOwnership, packageJson.name ?? '', packageJson.dependencies?.['@empire-builder-kit/runtime'] ?? '', serviceAdapterOwner);
|
|
600
1302
|
const compositionPaths = compositionPlan.paths.filter(({ path }) => !targetPathSet.has(path));
|
|
1303
|
+
if (externalBlueprintDestinationPaths) {
|
|
1304
|
+
(0, index_js_1.assertBlueprintDestinationPaths)(tree.root, root, [
|
|
1305
|
+
...externalBlueprintDestinationPaths,
|
|
1306
|
+
...compositionPaths.map(({ path }) => path),
|
|
1307
|
+
]);
|
|
1308
|
+
}
|
|
601
1309
|
for (const entry of compositionPaths) {
|
|
602
1310
|
const contents = compositionPlan.files[entry.path] ??
|
|
603
1311
|
tree.read(node_path_1.posix.join(root, entry.path), 'utf8');
|
|
@@ -609,6 +1317,7 @@ async function upgradeGenerator(tree, options) {
|
|
|
609
1317
|
targetFiles = await formatRenderedFiles(targetFiles, root);
|
|
610
1318
|
targetOwnership = {
|
|
611
1319
|
...targetOwnership,
|
|
1320
|
+
compositions: currentOwnership.compositions,
|
|
612
1321
|
...(targetOwnership.migrationHistory === undefined &&
|
|
613
1322
|
currentOwnership.migrationHistory !== undefined
|
|
614
1323
|
? { migrationHistory: currentOwnership.migrationHistory }
|
|
@@ -618,7 +1327,7 @@ async function upgradeGenerator(tree, options) {
|
|
|
618
1327
|
if (contents === undefined) {
|
|
619
1328
|
throw new Error(`Target Blueprint did not render ${entry.path}.`);
|
|
620
1329
|
}
|
|
621
|
-
return { ...entry, sha256: (0,
|
|
1330
|
+
return { ...entry, sha256: (0, index_js_4.hashOwnedContent)(contents, entry) };
|
|
622
1331
|
}),
|
|
623
1332
|
projects: [
|
|
624
1333
|
...new Set([...targetOwnership.projects, ...currentOwnership.projects]),
|
|
@@ -628,7 +1337,7 @@ async function upgradeGenerator(tree, options) {
|
|
|
628
1337
|
...targetFiles,
|
|
629
1338
|
'.ebk/ownership.json': json(targetOwnership),
|
|
630
1339
|
};
|
|
631
|
-
const targetValidation = (0,
|
|
1340
|
+
const targetValidation = (0, index_js_4.validateGeneratedOwnershipRecord)(targetOwnership);
|
|
632
1341
|
if (!targetValidation.valid) {
|
|
633
1342
|
throw new Error(`Target ownership metadata is invalid:\n${targetValidation.issues
|
|
634
1343
|
.map((issue) => `- ${issue.path}: ${issue.message}`)
|
|
@@ -643,10 +1352,14 @@ async function upgradeGenerator(tree, options) {
|
|
|
643
1352
|
tree.read(node_path_1.posix.join(root, path), 'utf8'),
|
|
644
1353
|
]));
|
|
645
1354
|
const mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(targetFiles)), targetOwnership);
|
|
1355
|
+
requireTargetCompositionFeatures(mergedTarget.files, targetOwnership);
|
|
646
1356
|
const report = createUpgradeReport(currentFiles, currentOwnership, mergedTarget.files, targetOwnership, mergedTarget);
|
|
647
|
-
|
|
1357
|
+
output.info(`[ebk-upgrade] ${name} ${currentOwnership.blueprint.name}@${currentOwnership.blueprint.version} -> ${blueprint.manifest.name}@${blueprint.manifest.version}\n${JSON.stringify(report, null, 2)}`);
|
|
648
1358
|
if (!options.apply)
|
|
649
1359
|
return;
|
|
1360
|
+
if (report.incompatibleSeededMigrations.length > 0) {
|
|
1361
|
+
throw new Error(seededMigrationUpgradeMessage('Product Slice', report));
|
|
1362
|
+
}
|
|
650
1363
|
if (report.conflicting.length > 0) {
|
|
651
1364
|
throw new Error(upgradeConflictMessage('Product Slice', report));
|
|
652
1365
|
}
|
|
@@ -664,6 +1377,7 @@ async function upgradeGenerator(tree, options) {
|
|
|
664
1377
|
throw new Error(`Target Blueprint did not render ${path}.`);
|
|
665
1378
|
tree.write(node_path_1.posix.join(root, path), contents);
|
|
666
1379
|
}
|
|
1380
|
+
appendSeededReconciliationMarker(tree, root, report);
|
|
667
1381
|
if (blueprint.source === 'installed') {
|
|
668
1382
|
packageJson.devDependencies = {
|
|
669
1383
|
...packageJson.devDependencies,
|
|
@@ -673,10 +1387,34 @@ async function upgradeGenerator(tree, options) {
|
|
|
673
1387
|
}
|
|
674
1388
|
if (!options.skipFormat)
|
|
675
1389
|
await (0, devkit_1.formatFiles)(tree);
|
|
676
|
-
(0,
|
|
1390
|
+
(0, index_js_4.restampProductSliceOwnership)(tree, name, { preserveSeeded: true });
|
|
677
1391
|
return options.skipInstall
|
|
678
1392
|
? undefined
|
|
679
1393
|
: () => (0, devkit_1.installPackagesTask)(tree, true);
|
|
680
1394
|
}
|
|
1395
|
+
async function upgradeGenerator(tree, options, output = devkit_1.logger, executionOptions = {}) {
|
|
1396
|
+
const previewFile = await requireDeveloperAgentPreviewBinding(tree, options, executionOptions);
|
|
1397
|
+
if (!previewFile) {
|
|
1398
|
+
return executeUpgradeGenerator(tree, options, output, executionOptions);
|
|
1399
|
+
}
|
|
1400
|
+
const upgradeOptions = { ...options };
|
|
1401
|
+
delete upgradeOptions.developerAgentPreview;
|
|
1402
|
+
delete upgradeOptions.developerAgentPreviewDigest;
|
|
1403
|
+
const deferred = new preview_changes_js_1.DeferredDeveloperAgentTree(tree);
|
|
1404
|
+
const beforeModes = (0, preview_changes_js_1.developerAgentPreviewOwnershipModes)(tree, options.name);
|
|
1405
|
+
const install = await executeUpgradeGenerator(deferred, upgradeOptions, output, developerAgentUpgradeExecutionOptions(executionOptions));
|
|
1406
|
+
if (install !== undefined)
|
|
1407
|
+
return previewBindingFailure();
|
|
1408
|
+
const modes = new Map([
|
|
1409
|
+
...beforeModes,
|
|
1410
|
+
...(0, preview_changes_js_1.developerAgentPreviewOwnershipModes)(deferred, options.name),
|
|
1411
|
+
]);
|
|
1412
|
+
const changes = (0, preview_changes_js_1.createDeveloperAgentPreviewChanges)(deferred.listChanges(), modes);
|
|
1413
|
+
if (!(0, node_util_1.isDeepStrictEqual)(changes, previewFile.preview.changes)) {
|
|
1414
|
+
return previewBindingFailure();
|
|
1415
|
+
}
|
|
1416
|
+
await assertCurrentDeveloperAgentPreviewSource(tree.root, previewFile.preview, executionOptions);
|
|
1417
|
+
deferred.apply();
|
|
1418
|
+
}
|
|
681
1419
|
exports.default = upgradeGenerator;
|
|
682
1420
|
//# sourceMappingURL=upgrade.js.map
|