@atmem/architect 0.0.0-stage → 0.2.0-alpha.4.1
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/CONSTITUTION.md +144 -0
- package/README.md +33 -2
- package/agent-skills/discovery/SKILL.md +48 -0
- package/agent-skills/discovery/topics.json +139 -0
- package/agent-skills/generation-capabilities.json +760 -0
- package/agent-skills/service-lifecycle.json +21 -0
- package/agent-skills/specialists/architecture/SKILL.md +15 -0
- package/agent-skills/specialists/aws/SKILL.md +17 -0
- package/agent-skills/specialists/azure/SKILL.md +7 -0
- package/agent-skills/specialists/composition/SKILL.md +17 -0
- package/agent-skills/specialists/devops/SKILL.md +10 -0
- package/agent-skills/specialists/finops/SKILL.md +7 -0
- package/agent-skills/specialists/gcp/SKILL.md +7 -0
- package/agent-skills/specialists/ibm/SKILL.md +7 -0
- package/agent-skills/specialists/manifest.json +13 -0
- package/agent-skills/specialists/pulumi/SKILL.md +7 -0
- package/agent-skills/specialists/security/SKILL.md +7 -0
- package/agent-skills/specialists/terraform/SKILL.md +14 -0
- package/agent-skills/upstream/aws/LICENSE +175 -0
- package/agent-skills/upstream/aws/SKILL.md +125 -0
- package/agent-skills/upstream/azure/LICENSE +21 -0
- package/agent-skills/upstream/azure/SKILL.md +387 -0
- package/agent-skills/upstream/gcp/LICENSE +202 -0
- package/agent-skills/upstream/gcp/SKILL.md +159 -0
- package/agent-skills/upstream/manifest.json +57 -0
- package/agent-skills/upstream/pulumi/LICENSE +201 -0
- package/agent-skills/upstream/pulumi/SKILL.md +501 -0
- package/agent-skills/upstream/terraform/LICENSE +373 -0
- package/agent-skills/upstream/terraform/SKILL.md +316 -0
- package/agent-skills/workflows/workflows.json +601 -0
- package/cli/architect.mjs +3 -0
- package/cli/runtime.mjs +115 -0
- package/dist/assets/html2canvas.esm-QH1iLAAe.js +22 -0
- package/dist/assets/index-B97MkVMs.css +1 -0
- package/dist/assets/index-qtCM2D7O.js +21271 -0
- package/dist/assets/index.es-C6C0sneB.js +18 -0
- package/dist/assets/purify.es-CAi2OJFm.js +3 -0
- package/dist/assets/visual-export-DjbjgQbA.js +173 -0
- package/dist/favicon.svg +2 -0
- package/dist/fonts/DM-Sans-OFL.txt +93 -0
- package/dist/fonts/Manrope-OFL.txt +93 -0
- package/dist/fonts/NotoSans-Regular.ttf +0 -0
- package/dist/fonts/OFL.txt +94 -0
- package/dist/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/dist/index.html +4 -0
- package/dist/licenses/aws-architect-LICENSE.txt +17 -0
- package/dist/licenses/aws-mcp-LICENSE.txt +175 -0
- package/dist/licenses/aws-mcp-NOTICE.txt +1 -0
- package/dist/licenses/cloud-emulation-notices.txt +36619 -0
- package/dist/licenses/dependency-notices.txt +6379 -0
- package/dist/licenses/emulation-notices.txt +717 -0
- package/dist/licenses/github-copilot-sdk-LICENSE.txt +21 -0
- package/dist/licenses/memory-dependency-notices.txt +3319 -0
- package/dist/licenses/openarchflow-LICENSE.txt +21 -0
- package/dist/licenses/python-dependency-notices.txt +11951 -0
- package/docs/upstream-lock.json +26 -0
- package/knowledge/engineering-practices.json +536 -0
- package/package.json +30 -4
- package/packaging/uv-release-lock.json +54 -0
- package/public/licenses/aws-architect-LICENSE.txt +17 -0
- package/public/licenses/aws-mcp-LICENSE.txt +175 -0
- package/public/licenses/aws-mcp-NOTICE.txt +1 -0
- package/public/licenses/cloud-emulation-notices.txt +36619 -0
- package/public/licenses/dependency-notices.txt +6379 -0
- package/public/licenses/emulation-notices.txt +717 -0
- package/public/licenses/github-copilot-sdk-LICENSE.txt +21 -0
- package/public/licenses/memory-dependency-notices.txt +3319 -0
- package/public/licenses/openarchflow-LICENSE.txt +21 -0
- package/public/licenses/python-dependency-notices.txt +11951 -0
- package/scripts/terraform-render.mjs +8 -0
- package/server/__init__.py +0 -0
- package/server/abstraction.py +28 -0
- package/server/agent_runtime.py +153 -0
- package/server/app.py +257 -0
- package/server/architect.py +112 -0
- package/server/architecture_activity.py +67 -0
- package/server/attachments.py +101 -0
- package/server/cloud-emulation-requirements.txt +29 -0
- package/server/codex_app_server.py +219 -0
- package/server/codex_engineering_backend.py +266 -0
- package/server/codex_worker_policy.py +170 -0
- package/server/contracts.py +315 -0
- package/server/copilot_worker.py +16 -0
- package/server/dependency_mirror.py +54 -0
- package/server/design_patch.py +43 -0
- package/server/emulation-requirements.txt +8 -0
- package/server/emulation_adapters.py +20 -0
- package/server/emulation_routes.py +98 -0
- package/server/emulation_worker.py +351 -0
- package/server/engineering_artifacts.py +215 -0
- package/server/engineering_assets/application-runtime.json +4372 -0
- package/server/engineering_assets/architecture_work.schema.json +79 -0
- package/server/engineering_assets/materialize_runtime.py +62 -0
- package/server/engineering_assets/prepare_tools.py +96 -0
- package/server/engineering_assets/sql_validation.py +59 -0
- package/server/engineering_contexts.py +120 -0
- package/server/engineering_delivery.py +210 -0
- package/server/engineering_finalization.py +210 -0
- package/server/engineering_handoff.py +163 -0
- package/server/engineering_jobs.py +206 -0
- package/server/engineering_knowledge.py +75 -0
- package/server/engineering_reconciliation.py +159 -0
- package/server/engineering_routes.py +469 -0
- package/server/engineering_sessions.py +273 -0
- package/server/engineering_tools.py +166 -0
- package/server/generation_lint.py +18 -0
- package/server/local_providers.py +181 -0
- package/server/local_validation.py +236 -0
- package/server/memory-requirements.lock +181 -0
- package/server/memory-requirements.txt +6 -0
- package/server/memory_routes.py +82 -0
- package/server/memory_service.py +273 -0
- package/server/memory_worker.py +66 -0
- package/server/openai_voice.py +80 -0
- package/server/packaged_app.py +9 -0
- package/server/pricing.py +84 -0
- package/server/process_control_observation.py +31 -0
- package/server/prompts.py +123 -0
- package/server/public_faq_emulation_worker.py +44 -0
- package/server/requirements.lock +1618 -0
- package/server/requirements.txt +68 -0
- package/server/runtime_dependency_locks.py +27 -0
- package/server/runtime_evidence.py +93 -0
- package/server/settings.py +14 -0
- package/server/skills.py +103 -0
- package/server/storage_emulation_worker.py +160 -0
- package/server/structured_emulation_worker.py +48 -0
- package/server/terraform_routes.py +118 -0
- package/server/upstream/__init__.py +0 -0
- package/server/upstream/agent/__init__.py +1 -0
- package/server/upstream/agent/aws_architect.py +600 -0
- package/server/upstream/agent/config/__init__.py +1 -0
- package/server/upstream/agent/config/agent_config.py +82 -0
- package/server/upstream/agent/config/prompts.py +138 -0
- package/server/upstream/agent/rate_limiter.py +62 -0
- package/server/upstream/utils/__init__.py +1 -0
- package/server/upstream/utils/file_writer.py +43 -0
- package/server/validation_applicability.py +85 -0
- package/server/validation_jobs.py +252 -0
- package/server/validation_workers.py +48 -0
- package/server/voice_routes.py +91 -0
- package/server/voice_worker.py +26 -0
- package/specs/028-convergence-evaluation/evidence/20261110-ibm-invoice-native/registry-structured/qualification.json +72 -0
- package/specs/028-convergence-evaluation/evidence/20261110-invoice-runtime/durable-current/receipt.json +61 -0
- package/specs/029-general-purpose-engine/evidence/20261111-runtime-dependencies/sdk/receipt.json +22 -0
- package/src/ArchitectureActivity.jsx +54 -0
- package/src/ArchitectureWorkPanel.jsx +46 -0
- package/src/ArtifactChecks.jsx +49 -0
- package/src/BlockRequirements.jsx +13 -0
- package/src/BrainActivity.jsx +11 -0
- package/src/ChatMessage.jsx +19 -0
- package/src/ChatResizeHandle.jsx +6 -0
- package/src/CodePreview.jsx +8 -0
- package/src/ComponentReview.jsx +31 -0
- package/src/DeliveryViews.jsx +59 -0
- package/src/EmulationPanel.jsx +44 -0
- package/src/EngagementViews.jsx +385 -0
- package/src/EngineeringPanel.jsx +151 -0
- package/src/ImplementationDelivery.jsx +55 -0
- package/src/JourneyViews.jsx +400 -0
- package/src/MemoryPanel.jsx +46 -0
- package/src/OpenAIVoicePanel.jsx +65 -0
- package/src/OutputsView.jsx +65 -0
- package/src/TerraformView.jsx +57 -0
- package/src/WorkbenchDialogs.jsx +532 -0
- package/src/activity-presentation.mjs +28 -0
- package/src/ai-qualification-scenarios.mjs +31 -0
- package/src/approval-application-files.mjs +32 -0
- package/src/approval-applications.mjs +82 -0
- package/src/approval-spec-kit.mjs +30 -0
- package/src/architecture-activity.css +28 -0
- package/src/architecture-activity.mjs +63 -0
- package/src/architecture-work.mjs +176 -0
- package/src/artifact-work.mjs +103 -0
- package/src/async-documents.mjs +191 -0
- package/src/atflow.css +1140 -0
- package/src/atforma.css +748 -0
- package/src/atmem-tokens.css +79 -0
- package/src/aws-preflight.mjs +60 -0
- package/src/aws-public-faq.mjs +102 -0
- package/src/aws-validation-scenarios.mjs +10 -0
- package/src/aws-validation.mjs +48 -0
- package/src/azure-plan-mocks.mjs +25 -0
- package/src/azure-structured.mjs +133 -0
- package/src/bedrock-summary.mjs +152 -0
- package/src/bounded-rag.mjs +60 -0
- package/src/brand.css +9 -0
- package/src/canvas-view.mjs +28 -0
- package/src/capability-composition.mjs +44 -0
- package/src/chat-attachments.mjs +13 -0
- package/src/cloud-provider-locks.mjs +9 -0
- package/src/cloud-storage-scenarios.mjs +2 -0
- package/src/component-review.mjs +55 -0
- package/src/composition-spec-kit.mjs +30 -0
- package/src/consultation-context.mjs +15 -0
- package/src/consultation.mjs +52 -0
- package/src/container-contracts.mjs +5 -0
- package/src/container-inspection.mjs +75 -0
- package/src/container-runtime.mjs +30 -0
- package/src/container-security-inspection.mjs +49 -0
- package/src/container-terraform.mjs +109 -0
- package/src/conversation.mjs +17 -0
- package/src/core.mjs +863 -0
- package/src/cross-cloud-storage.mjs +100 -0
- package/src/delivery-capabilities.mjs +25 -0
- package/src/delivery.mjs +58 -0
- package/src/deployment-ownership.mjs +10 -0
- package/src/deployment-region.mjs +11 -0
- package/src/derive.mjs +31 -0
- package/src/design-build-flow.mjs +10 -0
- package/src/diagram-attention.mjs +24 -0
- package/src/discovery.mjs +359 -0
- package/src/document.mjs +170 -0
- package/src/emulation-feedback.mjs +61 -0
- package/src/emulation-guidance.mjs +37 -0
- package/src/engagement.mjs +274 -0
- package/src/engineering-client.mjs +73 -0
- package/src/engineering-defaults.mjs +17 -0
- package/src/engineering.css +31 -0
- package/src/enterprise-application.mjs +76 -0
- package/src/enterprise-aws-host-infrastructure.mjs +62 -0
- package/src/enterprise-aws-host-tests.mjs +15 -0
- package/src/enterprise-aws-infrastructure-tests.mjs +38 -0
- package/src/enterprise-aws-infrastructure.mjs +138 -0
- package/src/enterprise-google-infrastructure.mjs +84 -0
- package/src/enterprise-google-tests.mjs +25 -0
- package/src/estimate.mjs +188 -0
- package/src/existing-references.mjs +18 -0
- package/src/external-identities.mjs +17 -0
- package/src/faq-lambda-build.mjs +28 -0
- package/src/gcp-structured.mjs +104 -0
- package/src/generation-provider.mjs +7 -0
- package/src/generation-quality.mjs +69 -0
- package/src/handoff.mjs +141 -0
- package/src/ibm-registry.mjs +12 -0
- package/src/ibm-structured.mjs +103 -0
- package/src/identifiers.mjs +15 -0
- package/src/implementation-map.mjs +14 -0
- package/src/implementation-outcome.mjs +8 -0
- package/src/incomplete-terraform.mjs +9 -0
- package/src/integrations.ts +137 -0
- package/src/interface-contracts.mjs +30 -0
- package/src/invoice-application.mjs +66 -0
- package/src/invoice-aws-operations.mjs +136 -0
- package/src/invoice-aws.mjs +143 -0
- package/src/invoice-azure-operations.mjs +147 -0
- package/src/invoice-azure.mjs +134 -0
- package/src/invoice-builder.mjs +35 -0
- package/src/invoice-dependencies.mjs +43 -0
- package/src/invoice-gcp-operations.mjs +178 -0
- package/src/invoice-gcp.mjs +104 -0
- package/src/invoice-ibm-operations.mjs +278 -0
- package/src/invoice-ibm.mjs +142 -0
- package/src/invoice-operations.mjs +143 -0
- package/src/invoice-plan.mjs +45 -0
- package/src/invoice-region.mjs +6 -0
- package/src/invoice-spec-kit.mjs +61 -0
- package/src/invoice-state.mjs +7 -0
- package/src/invoice-terraform.mjs +29 -0
- package/src/invoice-tests.mjs +122 -0
- package/src/journey-workspace.css +72 -0
- package/src/journey.mjs +87 -0
- package/src/levels.mjs +145 -0
- package/src/local-agent.mjs +184 -0
- package/src/main.jsx +2458 -0
- package/src/model-policy-preflight.mjs +34 -0
- package/src/openai-voice.mjs +102 -0
- package/src/output-bundle.mjs +11 -0
- package/src/ownership-inspection.mjs +28 -0
- package/src/pack.mjs +201 -0
- package/src/pricing.mjs +31 -0
- package/src/production-state.mjs +8 -0
- package/src/project-copy.mjs +10 -0
- package/src/project-file.mjs +160 -0
- package/src/project-links.mjs +3 -0
- package/src/protected-state.mjs +43 -0
- package/src/public-faq-builder.mjs +19 -0
- package/src/public-faq-clouds.mjs +251 -0
- package/src/public-faq.mjs +122 -0
- package/src/pulumi.mjs +123 -0
- package/src/python-container.mjs +25 -0
- package/src/python-runtime.mjs +50 -0
- package/src/rag-handler.mjs +43 -0
- package/src/rag-web-assets.mjs +52 -0
- package/src/rag-web.mjs +68 -0
- package/src/records.mjs +177 -0
- package/src/resources.mjs +163 -0
- package/src/review.mjs +252 -0
- package/src/runtime/EnterpriseDocument.java +89 -0
- package/src/runtime/approved_http_destination.py +72 -0
- package/src/runtime/aws-lambda-qualification-lock.json +7 -0
- package/src/runtime/aws-python-lock.json +82 -0
- package/src/runtime/aws-web-python-lock.json +887 -0
- package/src/runtime/aws_json_model.py +42 -0
- package/src/runtime/azure-python-lock.json +863 -0
- package/src/runtime/azure-sources.json +8 -0
- package/src/runtime/azure-test-lock.json +23 -0
- package/src/runtime/azure_acceptance.py +192 -0
- package/src/runtime/azure_structured.py +153 -0
- package/src/runtime/bounded_rag.py +126 -0
- package/src/runtime/catalog_admin.py +70 -0
- package/src/runtime/cloud-sql-proxy-lock.json +8 -0
- package/src/runtime/cloud-sql-proxy-security-review.json +30 -0
- package/src/runtime/connector_cli.py +50 -0
- package/src/runtime/connector_sync.py +70 -0
- package/src/runtime/durable-python-lock.json +247 -0
- package/src/runtime/durable_workflow.py +325 -0
- package/src/runtime/enterprise-application-manifest.json +110 -0
- package/src/runtime/enterprise-application-sources.json +266 -0
- package/src/runtime/enterprise-auth-python-lock.json +592 -0
- package/src/runtime/enterprise-aws-host-bootstrap-source.json +1 -0
- package/src/runtime/enterprise-aws-host-probe-source.json +1 -0
- package/src/runtime/enterprise-aws-task-template.json +235 -0
- package/src/runtime/enterprise-document-lock.json +18 -0
- package/src/runtime/enterprise-document.Dockerfile +15 -0
- package/src/runtime/enterprise-runtime-aws-python-lock.json +1115 -0
- package/src/runtime/enterprise-runtime-azure-python-lock.json +1106 -0
- package/src/runtime/enterprise-runtime-gcp-python-lock.json +1060 -0
- package/src/runtime/enterprise-runtime-ibm-python-lock.json +1096 -0
- package/src/runtime/enterprise-runtime-python-lock.json +1058 -0
- package/src/runtime/enterprise-runtime.Dockerfile +15 -0
- package/src/runtime/enterprise-web-app.js +1 -0
- package/src/runtime/enterprise-web-entry.js +105 -0
- package/src/runtime/enterprise-web-lock.json +29 -0
- package/src/runtime/enterprise-web-notices.txt +229 -0
- package/src/runtime/enterprise-web.css +4 -0
- package/src/runtime/enterprise-web.html +8 -0
- package/src/runtime/enterprise_audit.py +91 -0
- package/src/runtime/enterprise_audit_schema.sql +25 -0
- package/src/runtime/enterprise_auth_schema.sql +67 -0
- package/src/runtime/enterprise_auth_store.py +241 -0
- package/src/runtime/enterprise_aws_host_bootstrap.py +120 -0
- package/src/runtime/enterprise_aws_host_probe.py +105 -0
- package/src/runtime/enterprise_aws_hosts.py +136 -0
- package/src/runtime/enterprise_aws_jobs.py +300 -0
- package/src/runtime/enterprise_aws_objects.py +93 -0
- package/src/runtime/enterprise_aws_transfer.py +83 -0
- package/src/runtime/enterprise_azure_batch_api.py +128 -0
- package/src/runtime/enterprise_azure_host.py +599 -0
- package/src/runtime/enterprise_azure_jobs.py +294 -0
- package/src/runtime/enterprise_azure_objects.py +234 -0
- package/src/runtime/enterprise_azure_pool.py +161 -0
- package/src/runtime/enterprise_azure_transfer.py +122 -0
- package/src/runtime/enterprise_configuration.py +136 -0
- package/src/runtime/enterprise_document.py +116 -0
- package/src/runtime/enterprise_document_cli.py +32 -0
- package/src/runtime/enterprise_document_contract.py +54 -0
- package/src/runtime/enterprise_document_job.py +109 -0
- package/src/runtime/enterprise_document_jobs.py +122 -0
- package/src/runtime/enterprise_document_jobs_schema.sql +23 -0
- package/src/runtime/enterprise_extraction_cache.py +186 -0
- package/src/runtime/enterprise_extraction_schema.sql +17 -0
- package/src/runtime/enterprise_google_jobs.py +275 -0
- package/src/runtime/enterprise_google_transfer.py +85 -0
- package/src/runtime/enterprise_http.py +212 -0
- package/src/runtime/enterprise_identity.py +52 -0
- package/src/runtime/enterprise_knowledge.py +152 -0
- package/src/runtime/enterprise_models.py +94 -0
- package/src/runtime/enterprise_native.py +181 -0
- package/src/runtime/enterprise_oauth.py +132 -0
- package/src/runtime/enterprise_operator.py +160 -0
- package/src/runtime/enterprise_parser_service.py +136 -0
- package/src/runtime/enterprise_parser_transport.py +68 -0
- package/src/runtime/enterprise_queries.py +255 -0
- package/src/runtime/enterprise_queries_schema.sql +27 -0
- package/src/runtime/enterprise_query_service.py +111 -0
- package/src/runtime/enterprise_secrets.py +110 -0
- package/src/runtime/enterprise_sessions.py +95 -0
- package/src/runtime/enterprise_sources.py +260 -0
- package/src/runtime/enterprise_web.py +39 -0
- package/src/runtime/enterprise_worker.py +68 -0
- package/src/runtime/export_contract_acceptance.py +18 -0
- package/src/runtime/faq-output-contract.json +40 -0
- package/src/runtime/faq-web-app.js +41 -0
- package/src/runtime/faq-web.css +1 -0
- package/src/runtime/faq-web.html +6 -0
- package/src/runtime/gcp-sources.json +9 -0
- package/src/runtime/gcp_acceptance.py +110 -0
- package/src/runtime/gcp_structured.py +150 -0
- package/src/runtime/http_acceptance.py +39 -0
- package/src/runtime/iap-web-app.js +36 -0
- package/src/runtime/iap-web-source.json +1 -0
- package/src/runtime/ibm-python-lock.json +856 -0
- package/src/runtime/ibm-sources.json +9 -0
- package/src/runtime/ibm_acceptance.py +133 -0
- package/src/runtime/ibm_structured.py +113 -0
- package/src/runtime/invoice-azapi-provider-lock.json +7 -0
- package/src/runtime/invoice-ibm-provider-lock.json +7 -0
- package/src/runtime/invoice-parser-lock.json +1199 -0
- package/src/runtime/invoice-parser-python-lock.json +56 -0
- package/src/runtime/invoice-parser.Dockerfile +190 -0
- package/src/runtime/invoice-sources.json +58 -0
- package/src/runtime/invoice-test-sources.json +24 -0
- package/src/runtime/invoice-web.css +2 -0
- package/src/runtime/invoice-web.html +12 -0
- package/src/runtime/invoice-web.js +112 -0
- package/src/runtime/invoice_configuration.py +17 -0
- package/src/runtime/invoice_document.py +95 -0
- package/src/runtime/invoice_extraction.py +96 -0
- package/src/runtime/invoice_http.py +129 -0
- package/src/runtime/invoice_identity.py +5 -0
- package/src/runtime/invoice_maintenance.py +40 -0
- package/src/runtime/invoice_native.py +77 -0
- package/src/runtime/invoice_object_store.py +153 -0
- package/src/runtime/invoice_operations.py +108 -0
- package/src/runtime/invoice_operator.py +79 -0
- package/src/runtime/invoice_operator_core.py +39 -0
- package/src/runtime/invoice_operator_job.py +147 -0
- package/src/runtime/invoice_parser_cli.py +17 -0
- package/src/runtime/invoice_parser_identity.py +39 -0
- package/src/runtime/invoice_parser_service.py +89 -0
- package/src/runtime/invoice_parser_transport.py +89 -0
- package/src/runtime/invoice_processing.py +24 -0
- package/src/runtime/invoice_retention.py +16 -0
- package/src/runtime/invoice_runtime_secrets.py +43 -0
- package/src/runtime/invoice_stage.py +80 -0
- package/src/runtime/invoice_web.py +39 -0
- package/src/runtime/invoice_worker.py +50 -0
- package/src/runtime/lambda_faq.py +5 -0
- package/src/runtime/parser-requirements.lock +4 -0
- package/src/runtime/policy_review.py +18 -0
- package/src/runtime/postgres-qualification-lock.json +21 -0
- package/src/runtime/public-faq-sources.json +22 -0
- package/src/runtime/public_catalog_admin.py +122 -0
- package/src/runtime/public_catalog_store.py +125 -0
- package/src/runtime/public_faq.py +144 -0
- package/src/runtime/public_faq_app.py +49 -0
- package/src/runtime/python-container-lock.json +18 -0
- package/src/runtime/rag-sources.json +10 -0
- package/src/runtime/rag_acceptance.py +60 -0
- package/src/runtime/rag_aws_adapter.py +95 -0
- package/src/runtime/rds-ca-source.json +9 -0
- package/src/runtime/rds-global-ca.pem +2888 -0
- package/src/runtime/state-contract-check-source.json +4 -0
- package/src/runtime/state_contract_check.py +338 -0
- package/src/runtime/structured-source.json +1 -0
- package/src/runtime/structured-web-app.js +71 -0
- package/src/runtime/structured-web-source.json +1 -0
- package/src/runtime/structured_http.py +105 -0
- package/src/runtime/structured_output.py +48 -0
- package/src/runtime/web-python-lock.json +802 -0
- package/src/runtime/web_user_admin.py +44 -0
- package/src/runtime/workflow_application.py +62 -0
- package/src/runtime/workflow_bindings.py +128 -0
- package/src/runtime/workflow_configuration.py +40 -0
- package/src/runtime/workflow_connection.py +105 -0
- package/src/runtime/workflow_contract.py +54 -0
- package/src/runtime/workflow_database.py +94 -0
- package/src/runtime/workflow_errors.py +6 -0
- package/src/runtime/workflow_http.py +178 -0
- package/src/runtime/workflow_identity.py +69 -0
- package/src/runtime/workflow_payload.py +118 -0
- package/src/runtime/workflow_process_stage.py +88 -0
- package/src/runtime/workflow_profile.py +91 -0
- package/src/runtime/workflow_review.py +106 -0
- package/src/runtime/workflow_role_bootstrap.py +104 -0
- package/src/runtime/workflow_schema.sql +72 -0
- package/src/runtime/workflow_worker.py +142 -0
- package/src/runtime-settings.mjs +15 -0
- package/src/s3-access.mjs +14 -0
- package/src/source-contracts.mjs +17 -0
- package/src/spec-kit.mjs +186 -0
- package/src/state-custody.mjs +32 -0
- package/src/state-inspection.mjs +45 -0
- package/src/state-spec-kit.mjs +13 -0
- package/src/storage-tests.mjs +25 -0
- package/src/structured-api.mjs +133 -0
- package/src/structured-contract.mjs +19 -0
- package/src/structured-operation-policy.mjs +2 -0
- package/src/structured-web.mjs +17 -0
- package/src/style.css +1 -0
- package/src/system-description.mjs +26 -0
- package/src/terraform-admission.mjs +66 -0
- package/src/terraform-composition.mjs +83 -0
- package/src/terraform-expressions.mjs +46 -0
- package/src/terraform-validation-coverage.mjs +11 -0
- package/src/terraform.mjs +128 -0
- package/src/text-statistics.mjs +51 -0
- package/src/upstream/openarchflow/format-payload.ts +26 -0
- package/src/upstream/openarchflow/import/mermaid.ts +205 -0
- package/src/upstream/openarchflow/import/sql-ddl.ts +109 -0
- package/src/upstream/openarchflow/layout.ts +54 -0
- package/src/upstream/openarchflow/providers/aws.ts +196 -0
- package/src/upstream/openarchflow/providers/azure.ts +126 -0
- package/src/upstream/openarchflow/providers/cloudnative.ts +71 -0
- package/src/upstream/openarchflow/providers/generic.ts +227 -0
- package/src/upstream/openarchflow/providers/integration.ts +22 -0
- package/src/upstream/openarchflow/providers/types.ts +2 -0
- package/src/upstream/openarchflow/templates.ts +937 -0
- package/src/upstream-catalog.mjs +10 -0
- package/src/useChatScroll.jsx +36 -0
- package/src/useEmulation.jsx +36 -0
- package/src/validation-receipt.mjs +10 -0
- package/src/visual-export.mjs +92 -0
- package/src/voice-conversation.mjs +117 -0
- package/src/work-intake.mjs +24 -0
- package/src/workflow-runtime-inventory.mjs +3 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {PROVIDER_REGION_PATTERNS,validProviderRegion} from './deployment-region.mjs';
|
|
2
|
+
import {containerContract} from './container-contracts.mjs';
|
|
3
|
+
import {resourceAddress} from './identifiers.mjs';
|
|
4
|
+
import {inspectContainerSecurity} from './container-security-inspection.mjs';
|
|
5
|
+
// Inspect emitted configuration independently of the allocation compiler. Exact
|
|
6
|
+
// quantity conversion is explicit; no platform default or rounded value is proof.
|
|
7
|
+
const bytes=value=>{
|
|
8
|
+
if(typeof value!=='string')return NaN;
|
|
9
|
+
const match=/^(\d+(?:\.\d+)?)(Mi|Gi|M|G)$/.exec(value);
|
|
10
|
+
return match?Number(match[1])*({Mi:1048576,Gi:1073741824,M:1000000,G:1000000000}[match[2]]):NaN;
|
|
11
|
+
};
|
|
12
|
+
export function inspectContainerConfiguration(node,row,config,plan,add,{root=config,scope=null}={}){
|
|
13
|
+
const contract=containerContract(node);if(!contract)return;
|
|
14
|
+
const cloud=node.data.provider,name=resourceAddress(node.id),settings=node.data.config||{},resource=config.resource||{};
|
|
15
|
+
const fail=message=>add('container-constraint-mismatch',message,node.id);
|
|
16
|
+
if(row.address!==name)fail('The resource schedule changed the canonical container identity.');
|
|
17
|
+
const expectedResources=new Set(['terraform_data.review_gate',contract.type+'.'+name,...(cloud==='aws'?['aws_ecs_cluster','aws_cloudwatch_log_group','aws_iam_role','aws_iam_role_policy','aws_ecs_task_definition'].map(type=>type+'.'+name).concat('aws_iam_role.'+name+'_task'):cloud==='gcp'?['google_service_account.'+name]:[])]);
|
|
18
|
+
for(const [type,entries]of Object.entries(resource))for(const id of Object.keys(entries)){if(!expectedResources.delete(type+'.'+id))fail('The supplied-image unit contains a managed resource outside its reviewed ownership footprint.');}
|
|
19
|
+
if(expectedResources.size)fail('The supplied-image unit is missing a required owned resource or review gate.');
|
|
20
|
+
const expectedData=cloud==='aws'?['aws_subnet','aws_security_group','aws_partition']:cloud==='azure'?['azurerm_container_app_environment']:cloud==='ibm'?['ibm_code_engine_project']:[];
|
|
21
|
+
for(const [type,entries]of Object.entries(config.data||{}))for(const id of Object.keys(entries))if(!expectedData.includes(type)||id!==name)fail('The supplied-image unit queries data outside its reviewed existing-system boundary.');
|
|
22
|
+
const body=resource[contract.type]?.[name];if(!body)return;
|
|
23
|
+
const rawRegion=settings.region,selected=rawRegion&&rawRegion!=='To be selected'&&validProviderRegion(cloud,rawRegion)?rawRegion:null;
|
|
24
|
+
const expectedValidation='${can(regex('+JSON.stringify(PROVIDER_REGION_PATTERNS[cloud])+', var.region))'+(selected?' && var.region == '+JSON.stringify(selected):'')+'}';
|
|
25
|
+
if(config.variable?.region?.default!==(selected??undefined)||config.variable?.region?.validation?.condition!==expectedValidation)fail('The deployment region input does not preserve the accepted placement and supported identifier contract.');
|
|
26
|
+
if(rawRegion&&rawRegion!=='To be selected'&&!selected&&!(plan.gapDetails||[]).some(g=>g.componentIds?.includes(node.id)&&g.id.endsWith('-region')))fail('Unsupported placement was discarded instead of remaining blocking scope.');
|
|
27
|
+
const rootName=key=>scope?scope.module+'__'+key:key,rootRef=key=>'${var.'+rootName(key)+'}';
|
|
28
|
+
const candidates=root.provider?.[contract.provider],providers=Array.isArray(candidates)?candidates:[candidates],provider=providers.find(p=>p&&(scope?p.alias===scope.module:!p.alias));
|
|
29
|
+
inspectContainerSecurity(cloud,name,config,provider,rootRef,fail);
|
|
30
|
+
if(!provider||cloud!=='azure'&&provider.region!==rootRef('region'))fail('The native provider is not bound to its own delivery-unit region input.');
|
|
31
|
+
if(cloud==='azure'&&provider?.subscription_id!==rootRef('subscription_id'))fail('The Azure lookup and application lost their owned subscription input.');
|
|
32
|
+
if(cloud==='gcp'&&provider?.project!==rootRef('project_id'))fail('The Google provider lost its reviewed project input.');
|
|
33
|
+
for(const [type,entries]of Object.entries(resource))if(type!=='terraform_data')for(const item of Object.values(entries)){
|
|
34
|
+
if(item.provider!==undefined&&item.provider!==contract.provider)fail('A container resource overrides its owned provider configuration.');
|
|
35
|
+
if(cloud==='aws'&&item.region!==undefined&&item.region!=='${var.region}')fail('A container resource overrides its owned deployment region.');
|
|
36
|
+
}
|
|
37
|
+
const conditions=body.lifecycle?.precondition||[],has=condition=>Array.isArray(conditions)&&conditions.some(rule=>rule.condition===condition);
|
|
38
|
+
if(cloud==='aws')for(const [type,key]of [['aws_subnet','subnets'],['aws_security_group','security_groups']]){
|
|
39
|
+
const lookup=config.data?.[type]?.[name];
|
|
40
|
+
if(!lookup||lookup.for_each!=='${toset(var.'+name+'_'+key+')}'||lookup.id!=='${each.value}'||Object.keys(lookup).some(key=>!['for_each','id','provider'].includes(key))||lookup.provider!==undefined&&lookup.provider!=='aws'||body.network_configuration?.[key]!=='${var.'+name+'_'+key+'}')fail('An AWS network lookup or service no longer follows its exact existing network inputs.');
|
|
41
|
+
if(!has('${alltrue([for item in values(data.'+type+'.'+name+') : item.vpc_id == var.'+name+'_vpc_id])}'))fail('The AWS existing network lost its native VPC membership check.');
|
|
42
|
+
}
|
|
43
|
+
if(cloud==='gcp'&&body.location!=='${var.region}')fail('Cloud Run location no longer uses the accepted unit region.');
|
|
44
|
+
if(cloud==='azure'){
|
|
45
|
+
const existing=config.data?.azurerm_container_app_environment?.[name];
|
|
46
|
+
if(!existing||existing.name!=='${try(split("/", var.environment_id)[8], "invalid")}'||existing.resource_group_name!=='${try(split("/", var.environment_id)[4], "invalid")}'||existing.provider!==undefined&&existing.provider!=='azurerm'||body.container_app_environment_id!=='${var.environment_id}')fail('The Azure existing-environment lookup no longer follows the exact selected resource ID.');
|
|
47
|
+
if(!has('${lower(replace(data.azurerm_container_app_environment.'+name+'.location, " ", "")) == var.region}')||!has('${lower(data.azurerm_container_app_environment.'+name+'.id) == lower(var.environment_id)}'))fail('The Azure existing environment lost its native region or subscription/resource-ID check.');
|
|
48
|
+
}
|
|
49
|
+
if(cloud==='ibm'){
|
|
50
|
+
const existing=config.data?.ibm_code_engine_project?.[name];
|
|
51
|
+
if(!existing||existing.project_id!=='${var.code_engine_project_id}'||existing.provider!==undefined&&existing.provider!=='ibm'||body.project_id!=='${var.code_engine_project_id}')fail('The IBM existing-project lookup no longer follows the reviewed project ID.');
|
|
52
|
+
if(!has('${data.ibm_code_engine_project.'+name+'.region == var.region}')||!has('${data.ibm_code_engine_project.'+name+'.account_id == var.account_id}'))fail('The IBM existing project lost its native region or account check.');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let actualMemory,privateIngress,explicitIdentity;
|
|
56
|
+
if(cloud==='aws'){
|
|
57
|
+
const task=resource.aws_ecs_task_definition?.[name];actualMemory=Number(task?.memory)*1048576;
|
|
58
|
+
privateIngress=body.network_configuration?.assign_public_ip===false;
|
|
59
|
+
explicitIdentity=!!resource.aws_iam_role?.[name]&&!!resource.aws_iam_role?.[name+'_task']&&task?.execution_role_arn==='${aws_iam_role.'+name+'.arn}'&&task?.task_role_arn==='${aws_iam_role.'+name+'_task.arn}';
|
|
60
|
+
if(settings.logRetentionDays!=null&&resource.aws_cloudwatch_log_group?.[name]?.retention_in_days!==settings.logRetentionDays)fail('CloudWatch retention does not retain the explicit finite setting.');
|
|
61
|
+
}else if(cloud==='azure'){
|
|
62
|
+
actualMemory=bytes(body.template?.container?.memory);privateIngress=body.ingress?.external_enabled===false;explicitIdentity=body.identity?.type==='SystemAssigned';
|
|
63
|
+
}else if(cloud==='gcp'){
|
|
64
|
+
actualMemory=bytes(body.template?.containers?.resources?.limits?.memory);privateIngress=body.ingress==='INGRESS_TRAFFIC_INTERNAL_ONLY';explicitIdentity=!!resource.google_service_account?.[name]&&body.template?.service_account==='${google_service_account.'+name+'.email}';
|
|
65
|
+
}else if(cloud==='ibm'){
|
|
66
|
+
actualMemory=bytes(body.scale_memory_limit);privateIngress=body.managed_domain_mappings==='local';explicitIdentity=body.run_service_account==='none';
|
|
67
|
+
}
|
|
68
|
+
if(!privateIngress)fail('The private supplied-image contract gained public or implicit ingress.');
|
|
69
|
+
if(!explicitIdentity)fail('The supplied-image contract lost its explicit scoped runtime identity.');
|
|
70
|
+
const memoryBlocked=(plan.gapDetails||[]).some(g=>g.componentIds?.includes(node.id)&&/container-setting-.*-(memoryMb|containerMemoryBytes)$/.test(g.id));
|
|
71
|
+
if(!memoryBlocked){
|
|
72
|
+
const targets=[...(settings.containerMemoryBytes==null?[]:[settings.containerMemoryBytes]),...(settings.memoryMb==null?[]:[settings.memoryMb*1048576])];
|
|
73
|
+
if(targets.some(expected=>actualMemory!==expected))fail('Emitted container memory does not exactly retain the explicit byte quantity.');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {runtimeSettings} from './runtime-settings.mjs';
|
|
2
|
+
const MiB=2**20,GiB=2**30;
|
|
3
|
+
// Exact quantities: never round client memory to a provider's size tier. CPU is
|
|
4
|
+
// a proposed compatible allocation, not an inferred CPU/performance requirement.
|
|
5
|
+
export function containerRuntime(node){
|
|
6
|
+
const provider=node.data.provider,settings=runtimeSettings(node.data.config),gaps=[];
|
|
7
|
+
const defaults={aws:512*MiB,azure:GiB,gcp:512*MiB,ibm:1e9};
|
|
8
|
+
const explicit=settings.containerMemoryBytes??(settings.memoryMb==null?null:settings.memoryMb*MiB);
|
|
9
|
+
const conflict=settings.containerMemoryBytes!=null&&settings.memoryMb!=null&&settings.containerMemoryBytes!==settings.memoryMb*MiB;
|
|
10
|
+
const bytes=explicit??defaults[provider];let memory,cpu,executionEnvironment;
|
|
11
|
+
if(provider==='aws'){
|
|
12
|
+
const gib=bytes/GiB;
|
|
13
|
+
const tier=bytes===512*MiB?256:Number.isInteger(gib)&&gib>=1?(gib<=2?256:gib<=4?512:gib<=8?1024:gib<=16?2048:gib<=30?4096:gib<=60&&gib%4===0?8192:gib<=120&&gib%8===0?16384:gib===244?32768:null):null;
|
|
14
|
+
if(tier){memory=String(bytes/MiB);cpu=String(tier);}
|
|
15
|
+
}else if(provider==='azure'){
|
|
16
|
+
// Existing environment has no declared workload-profile contract yet. Use the
|
|
17
|
+
// combinations valid for Consumption-only environments, rather than assume it.
|
|
18
|
+
if(bytes>=512*MiB&&bytes<=4*GiB&&bytes%(512*MiB)===0){memory=String(bytes/GiB)+'Gi';cpu=bytes/GiB/2;}
|
|
19
|
+
}else if(provider==='gcp'){
|
|
20
|
+
if(bytes>=128*MiB&&bytes<=32*GiB&&bytes%MiB===0){memory=String(bytes/MiB)+'Mi';cpu=String(bytes<=4*GiB?1:bytes<=8*GiB?2:bytes<=16*GiB?4:bytes<=24*GiB?6:8);executionEnvironment=bytes<512*MiB?'EXECUTION_ENVIRONMENT_GEN1':'EXECUTION_ENVIRONMENT_GEN2';}
|
|
21
|
+
}else if(provider==='ibm'){
|
|
22
|
+
const sizes=new Map([[250e6,'0.125'],[500e6,'0.25'],[1e9,'0.5'],[2e9,'0.5'],[4e9,'1'],[8e9,'2'],[12e9,'6'],[16e9,'4'],[20e9,'10'],[24e9,'6'],[32e9,'8'],[40e9,'10'],[48e9,'12']]);
|
|
23
|
+
if(sizes.has(bytes)){memory=String(bytes/1e9)+'G';cpu=sizes.get(bytes);}
|
|
24
|
+
}
|
|
25
|
+
if(conflict)gaps.push({key:'containerMemoryBytes',value:settings.containerMemoryBytes,reason:'conflicts with the preserved memoryMb requirement (MiB); resolve the conflicting quantities without discarding either'});
|
|
26
|
+
if(memory==null&&!conflict)gaps.push({key:settings.containerMemoryBytes==null?'memoryMb':'containerMemoryBytes',value:explicit,reason:'has no exact supported memory/CPU mapping in the selected provider/environment contract; no rounding or provider substitution was performed'});
|
|
27
|
+
// The old finite log-retention field is explicitly a CloudWatch contract.
|
|
28
|
+
for(const [key,value]of Object.entries(settings))if(!['memoryMb','containerMemoryBytes'].includes(key)&&!(key==='logRetentionDays'&&provider==='aws'))gaps.push({key,value,reason:'is not implemented by this supplied-image footprint; implement and validate the required behavior before applying'});
|
|
29
|
+
return {requestedMemoryBytes:explicit,memoryBytes:memory==null?defaults[provider]:bytes,memory:memory??({aws:'512',azure:'1Gi',gcp:'512Mi',ibm:'1G'}[provider]),cpu:cpu??({aws:'256',azure:0.5,gcp:'1',ibm:'0.5'}[provider]),executionEnvironment:executionEnvironment||'EXECUTION_ENVIRONMENT_GEN2',logRetentionDays:settings.logRetentionDays??30,gaps};
|
|
30
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Independent supplied-image security/lifecycle contract, expressed from native
|
|
2
|
+
// artifact semantics. Do not import the compiler or trust schedule metadata.
|
|
3
|
+
const canonical=value=>JSON.stringify(normalize(value));
|
|
4
|
+
function normalize(value){
|
|
5
|
+
if(Array.isArray(value))return value.map(normalize).sort((a,b)=>JSON.stringify(a).localeCompare(JSON.stringify(b)));
|
|
6
|
+
return value&&typeof value==='object'?Object.fromEntries(Object.keys(value).sort().map(key=>[key,normalize(value[key])])):value;
|
|
7
|
+
}
|
|
8
|
+
const parse=value=>{try{return JSON.parse(value);}catch{return null;}};
|
|
9
|
+
export function inspectContainerSecurity(cloud,name,config,provider,rootRef,fail){
|
|
10
|
+
const resources=config.resource||{},ref=(type,key)=>'${'+type+'.'+name+'.'+key+'}';
|
|
11
|
+
const providerKeys={aws:['region','allowed_account_ids','alias'],azure:['features','subscription_id','alias'],gcp:['region','project','alias'],ibm:['region','alias']}[cloud];
|
|
12
|
+
if(Object.keys(provider||{}).some(key=>!providerKeys.includes(key)))fail('The provider gained configuration outside its reviewed destination/credential-chain contract.');
|
|
13
|
+
const imageGuard='${can(regex("@sha256:[0-9a-f]{64}$", var.'+name+'_image))}';
|
|
14
|
+
if(config.variable?.[name+'_image']?.validation?.condition!==imageGuard)fail('The supplied-image input lost its immutable digest requirement.');
|
|
15
|
+
for(const [type,entries]of Object.entries(resources))if(type!=='terraform_data')for(const item of Object.values(entries)){
|
|
16
|
+
if(item.lifecycle?.prevent_destroy!==true||item.lifecycle.ignore_changes!==undefined)fail('A managed supplied-image resource lost destruction protection or hides configuration changes.');
|
|
17
|
+
if(item.count!==undefined||item.for_each!==undefined)fail('A supplied-image resource changed its reviewed instance ownership.');
|
|
18
|
+
if(!item.depends_on?.includes('terraform_data.review_gate'))fail('A supplied-image resource bypasses its review gate.');
|
|
19
|
+
if(cloud==='gcp'&&item.project!==undefined&&item.project!=='${var.project_id}')fail('A Google resource overrides the delivery-unit project.');
|
|
20
|
+
}
|
|
21
|
+
if(cloud==='gcp'&&resources.google_cloud_run_v2_service?.[name]?.deletion_protection!==true)fail('Cloud Run lost its native deletion protection.');
|
|
22
|
+
if(cloud!=='aws')return;
|
|
23
|
+
if(canonical(provider?.allowed_account_ids)!==canonical([rootRef('account_id')]))fail('The AWS provider lost its explicit account boundary.');
|
|
24
|
+
const partition=ref('data.aws_partition','partition'),lookup=config.data?.aws_partition?.[name];
|
|
25
|
+
if(!lookup||Object.keys(lookup).length)fail('AWS partition metadata must come from the owned native provider without query overrides.');
|
|
26
|
+
const trust={Version:'2012-10-17',Statement:[{Effect:'Allow',Principal:{Service:'ecs-tasks.amazonaws.com'},Action:'sts:AssumeRole',Condition:{StringEquals:{'aws:SourceAccount':'${var.account_id}'},ArnLike:{'aws:SourceArn':'arn:'+partition+':ecs:${var.region}:${var.account_id}:*'}}}]};
|
|
27
|
+
for(const id of [name,name+'_task']){
|
|
28
|
+
const role=resources.aws_iam_role?.[id];
|
|
29
|
+
if(canonical(parse(role?.assume_role_policy))!==canonical(trust)||role?.managed_policy_arns!==undefined||role?.inline_policy!==undefined)fail('An ECS role gained unreviewed trust, attachments or inline application permissions.');
|
|
30
|
+
}
|
|
31
|
+
const policy=resources.aws_iam_role_policy?.[name];
|
|
32
|
+
const expected={Version:'2012-10-17',Statement:[{Effect:'Allow',Action:['ecr:GetAuthorizationToken'],Resource:'*'},{Effect:'Allow',Action:['ecr:BatchCheckLayerAvailability','ecr:GetDownloadUrlForLayer','ecr:BatchGetImage'],Resource:'${var.'+name+'_repository_arn}'},{Effect:'Allow',Action:['logs:CreateLogStream','logs:PutLogEvents'],Resource:ref('aws_cloudwatch_log_group','arn')+':*'}]};
|
|
33
|
+
if(policy?.role!==ref('aws_iam_role','id')||canonical(parse(policy?.policy))!==canonical(expected))fail('ECS execution permissions no longer match exact image-pull and owned-log-stream scope.');
|
|
34
|
+
const repositoryValidation=config.variable?.[name+'_repository_arn']?.validation?.condition;
|
|
35
|
+
if(repositoryValidation!=='${can(regex("^arn:(aws|aws-cn|aws-us-gov):ecr:([a-z]{2}-[a-z]+|us-gov-[a-z]+)-[0-9]{1,2}:[0-9]{12}:repository/[a-z0-9][a-z0-9._/-]{0,255}$", var.'+name+'_repository_arn))}')fail('The ECR input no longer excludes wildcard repository grants.');
|
|
36
|
+
const repositoryRegion='try(split(":",var.'+name+'_repository_arn)[3],"")';
|
|
37
|
+
if(!policy?.lifecycle?.precondition?.some(p=>p.condition==='${startswith(var.'+name+'_repository_arn,"arn:'+partition+':ecr:") && (startswith('+repositoryRegion+',"cn-") ? "aws-cn" : startswith('+repositoryRegion+',"us-gov-") ? "aws-us-gov" : "aws") == data.aws_partition.'+name+'.partition}'))fail('The ECR grant lost its native deployment-partition/region-family check.');
|
|
38
|
+
const service=resources.aws_ecs_service?.[name],task=resources.aws_ecs_task_definition?.[name];
|
|
39
|
+
if(!service?.lifecycle?.precondition?.some(p=>p.condition==='${data.aws_partition.'+name+'.partition == (startswith(var.region,"cn-") ? "aws-cn" : startswith(var.region,"us-gov-") ? "aws-us-gov" : "aws")}'))fail('The native provider partition no longer agrees with the selected supported region family.');
|
|
40
|
+
if(service?.cluster!==ref('aws_ecs_cluster','id')||service?.task_definition!==ref('aws_ecs_task_definition','arn')||service?.launch_type!=='FARGATE'||service?.enable_execute_command===true)fail('The ECS service lost its owned task/cluster or gained remote execution.');
|
|
41
|
+
if(task?.network_mode!=='awsvpc'||canonical(task?.requires_compatibilities)!==canonical(['FARGATE']))fail('The task lost its explicit Fargate network contract.');
|
|
42
|
+
const containers=parse(task?.container_definitions);
|
|
43
|
+
if(!Array.isArray(containers)||containers.length!==1)fail('The supplied-image task gained unreviewed containers.');
|
|
44
|
+
else{
|
|
45
|
+
const container=containers[0];
|
|
46
|
+
if(container.image!=='${var.'+name+'_image}'||Object.keys(container).some(key=>!['name','image','essential','portMappings','logConfiguration'].includes(key)))fail('The task changed its image or gained unreviewed runtime inputs.');
|
|
47
|
+
if(container.logConfiguration?.logDriver!=='awslogs'||container.logConfiguration.options?.['awslogs-group']!==ref('aws_cloudwatch_log_group','name')||container.logConfiguration.options?.['awslogs-region']!=='${var.region}')fail('Container logs no longer use the owned log group and region.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {declaredRegion,PROVIDER_REGION_PATTERNS} from './deployment-region.mjs';
|
|
2
|
+
import {containerRuntime} from './container-runtime.mjs';
|
|
3
|
+
import ibmProviderLock from './runtime/invoice-ibm-provider-lock.json' with {type:'json'};
|
|
4
|
+
import {CONTAINER_SERVICES,containerContract} from './container-contracts.mjs';
|
|
5
|
+
import {existingReferenceFiles} from './existing-references.mjs';
|
|
6
|
+
import {generationProviders} from './generation-provider.mjs';
|
|
7
|
+
import {incompleteTerraform} from './incomplete-terraform.mjs';
|
|
8
|
+
import {CLOUD_PROVIDER_LOCKS} from './cloud-provider-locks.mjs';
|
|
9
|
+
const v=n=>'${var.'+n+'}',ref=(type,n,key)=>'${'+type+'.'+n+'.'+key+'}';
|
|
10
|
+
export function containerTerraform(project,plan,environment='staging'){
|
|
11
|
+
const providers=generationProviders(project),cloud=providers[0],d=CONTAINER_SERVICES[cloud];
|
|
12
|
+
if(providers.length!==1||!d)return incompleteTerraform(project,plan,environment);
|
|
13
|
+
const nodes=project.nodes.filter(containerContract),regions=[...new Set(nodes.map(node=>declaredRegion(node).region).filter(Boolean))];
|
|
14
|
+
if(regions.length>1)throw Error('Distinct placements require separate composed delivery units; no region was substituted.');
|
|
15
|
+
const selectedRegion=regions[0];
|
|
16
|
+
const variable={review_approved:{type:'bool',default:false},region:{type:'string',nullable:false,description:'Explicitly reviewed provider region; no default destination.'}};
|
|
17
|
+
const examples={review_approved:false,region:{aws:'ap-southeast-2',azure:'australiaeast',gcp:'australia-southeast1',ibm:'au-syd'}[cloud]};
|
|
18
|
+
if(selectedRegion){variable.region.default=selectedRegion;examples.region=selectedRegion;}
|
|
19
|
+
variable.region.description=selectedRegion?'Configured region from the current design; review approval is still required. Regenerate the design to change placement.':'Required canonical region; no deployment destination has been chosen by this package.';
|
|
20
|
+
variable.region.validation={condition:'${can(regex('+JSON.stringify(PROVIDER_REGION_PATTERNS[cloud])+', var.region))'+(selectedRegion?' && var.region == '+JSON.stringify(selectedRegion):'')+'}',error_message:'Use the supported canonical region and preserve the configured placement; change the design to change its destination.'};
|
|
21
|
+
const input=(name,description,example)=>{variable[name]={type:'string',nullable:false,description,validation:{condition:'${length(trimspace(var.'+name+')) > 0}',error_message:'Supply a reviewed nonempty value.'}};examples[name]=example;return v(name);};
|
|
22
|
+
const provider={[d.provider]:{region:v('region')}};
|
|
23
|
+
if(cloud==='azure')provider.azurerm={features:{},subscription_id:input('subscription_id','Reviewed Azure subscription.','11111111-1111-1111-1111-111111111111')};
|
|
24
|
+
if(cloud==='gcp')provider.google={region:v('region'),project:input('project_id','Existing destination Google Cloud project.','reviewed-project')};
|
|
25
|
+
if(cloud==='aws')provider.aws.allowed_account_ids=[input('account_id','Expected AWS account; provider refuses another account.','123456789012')];
|
|
26
|
+
const resource={terraform_data:{review_gate:{input:{design_revision:project.revision,environment},lifecycle:{precondition:[{condition:'${var.review_approved && length(local.unfinished_work) == 0}',error_message:'Review inputs and resolve all required implementations before applying.'}]}}}},data={},outputs={},tests=[],mockData=[];
|
|
27
|
+
const add=(type,name,body)=>((resource[type]||={})[name]={...body,lifecycle:{...body.lifecycle,prevent_destroy:true},depends_on:['terraform_data.review_gate',...(body.depends_on||[])]});
|
|
28
|
+
for(const node of nodes){
|
|
29
|
+
const n=plan.rows.find(r=>r.id===node.id).address,runtime=containerRuntime(node);
|
|
30
|
+
const name=input(n+'_name','Reviewed unique deployment name; application source is supplied separately.','architect-app-'+(nodes.indexOf(node)+1));
|
|
31
|
+
variable[n+'_name'].validation={condition:'${can(regex("^[a-z][a-z0-9-]{4,28}[a-z0-9]$", var.'+n+'_name))}',error_message:'Use a unique lowercase name of 6–30 letters, digits or hyphens, starting with a letter.'};
|
|
32
|
+
const image=input(n+'_image','Reviewed immutable Linux container image digest. No model-generated application code is implied.','registry.example.com/architect@sha256:'+'0'.repeat(64));
|
|
33
|
+
variable[n+'_image'].validation={condition:'${can(regex("@sha256:[0-9a-f]{64}$", var.'+n+'_image))}',error_message:'Pin the reviewed application image with its SHA-256 digest.'};
|
|
34
|
+
if(cloud==='gcp'){
|
|
35
|
+
add('google_service_account',n,{account_id:name,display_name:'Application runtime identity'});
|
|
36
|
+
add(d.type,n,{name,location:v('region'),deletion_protection:true,ingress:'INGRESS_TRAFFIC_INTERNAL_ONLY',template:{execution_environment:runtime.executionEnvironment,service_account:ref('google_service_account',n,'email'),scaling:{min_instance_count:0,max_instance_count:2},containers:{image,ports:{container_port:8080},resources:{limits:{cpu:runtime.cpu,memory:runtime.memory}},startup_probe:{tcp_socket:{port:8080}}}}});
|
|
37
|
+
outputs[n+'_uri']={value:ref(d.type,n,'uri')};
|
|
38
|
+
}else if(cloud==='azure'){
|
|
39
|
+
const environmentId=input('environment_id','Exact existing Container Apps environment resource ID; its native ID and region are checked.','/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/reviewed-rg/providers/Microsoft.App/managedEnvironments/reviewed-env');
|
|
40
|
+
variable.environment_id.validation={condition:'${can(regex("(?i)^/subscriptions/[0-9a-f-]{36}/resourcegroups/[^/]+/providers/microsoft[.]app/managedenvironments/[^/]+$", var.environment_id))}',error_message:'Supply the full existing managed environment ARM resource ID.'};
|
|
41
|
+
data.azurerm_container_app_environment||={};data.azurerm_container_app_environment[n]={name:'${try(split("/", var.environment_id)[8], "invalid")}',resource_group_name:'${try(split("/", var.environment_id)[4], "invalid")}'};
|
|
42
|
+
add(d.type,n,{name,resource_group_name:input('resource_group_name','Existing destination application resource group.','reviewed-rg'),container_app_environment_id:environmentId,revision_mode:'Single',identity:{type:'SystemAssigned'},template:{min_replicas:0,max_replicas:2,container:{name:'application',image,cpu:runtime.cpu,memory:runtime.memory,readiness_probe:{transport:'TCP',port:8080},liveness_probe:{transport:'TCP',port:8080}}},ingress:{external_enabled:false,target_port:8080,transport:'http',traffic_weight:{latest_revision:true,percentage:100}},lifecycle:{prevent_destroy:true,precondition:[{condition:'${lower(replace(data.azurerm_container_app_environment.'+n+'.location, " ", "")) == var.region}',error_message:'The existing environment is outside the configured region.'},{condition:'${lower(data.azurerm_container_app_environment.'+n+'.id) == lower(var.environment_id)}',error_message:'The existing environment lookup resolved a different subscription or resource ID.'}]}});
|
|
43
|
+
mockData.push('mock_data "azurerm_container_app_environment" { defaults = '+JSON.stringify({id:examples.environment_id,location:examples.region})+' }');
|
|
44
|
+
for(const mutation of ['region','identity']){
|
|
45
|
+
const values={id:examples.environment_id,location:examples.region};
|
|
46
|
+
if(mutation==='region')values.location=examples.region==='westus2'?'australiaeast':'westus2';else values.id=examples.environment_id.replace('11111111-1111-1111-1111-111111111111','22222222-2222-2222-2222-222222222222');
|
|
47
|
+
tests.push('run "'+n+'_reject_existing_environment_'+mutation+'" {\n command = plan\n override_data {\n target = data.azurerm_container_app_environment.'+n+'\n values = '+JSON.stringify(values)+'\n }\n expect_failures = [azurerm_container_app.'+n+']\n}');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
outputs[n+'_id']={value:ref(d.type,n,'id')};
|
|
51
|
+
}else if(cloud==='ibm'){
|
|
52
|
+
const projectId=input('code_engine_project_id','Exact existing Code Engine project ID; its native account and region are checked.','11111111-1111-1111-1111-111111111111');
|
|
53
|
+
input('account_id','Expected existing IBM account ID; reject a project belonging to another account.','11111111111111111111111111111111');
|
|
54
|
+
variable.account_id.validation={condition:'${can(regex("^[0-9a-f]{32}$", var.account_id))}',error_message:'Supply the expected 32-character IBM account ID.'};
|
|
55
|
+
data.ibm_code_engine_project||={};data.ibm_code_engine_project[n]={project_id:projectId};
|
|
56
|
+
add(d.type,n,{project_id:projectId,name,image_reference:image,image_port:8080,managed_domain_mappings:'local',run_service_account:'none',scale_min_instances:0,scale_max_instances:2,scale_cpu_limit:runtime.cpu,scale_memory_limit:runtime.memory,lifecycle:{prevent_destroy:true,precondition:[{condition:'${data.ibm_code_engine_project.'+n+'.region == var.region}',error_message:'The existing Code Engine project is outside the configured region.'},{condition:'${data.ibm_code_engine_project.'+n+'.account_id == var.account_id}',error_message:'The existing Code Engine project belongs to another account.'}]}});
|
|
57
|
+
mockData.push('mock_data "ibm_code_engine_project" { defaults = '+JSON.stringify({id:examples.code_engine_project_id,region:examples.region,account_id:examples.account_id})+' }');
|
|
58
|
+
for(const mutation of ['region','identity']){
|
|
59
|
+
const values={id:examples.code_engine_project_id,region:examples.region,account_id:examples.account_id};
|
|
60
|
+
if(mutation==='region')values.region=examples.region==='eu-de'?'au-syd':'eu-de';else values.account_id='22222222222222222222222222222222';
|
|
61
|
+
tests.push('run "'+n+'_reject_existing_project_'+mutation+'" {\n command = plan\n override_data {\n target = data.ibm_code_engine_project.'+n+'\n values = '+JSON.stringify(values)+'\n }\n expect_failures = [ibm_code_engine_app.'+n+']\n}');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
outputs[n+'_id']={value:ref(d.type,n,'id')};
|
|
65
|
+
}else{
|
|
66
|
+
variable.account_id.validation={condition:'${can(regex("^[0-9]{12}$", var.account_id))}',error_message:'Supply the expected 12-digit AWS account ID.'};
|
|
67
|
+
data.aws_partition||={};data.aws_partition[n]={};
|
|
68
|
+
const partition=ref('data.aws_partition',n,'partition'),examplePartition=examples.region.startsWith('cn-')?'aws-cn':examples.region.startsWith('us-gov-')?'aws-us-gov':'aws';
|
|
69
|
+
const partitionCheck='${data.aws_partition.'+n+'.partition == (startswith(var.region,"cn-") ? "aws-cn" : startswith(var.region,"us-gov-") ? "aws-us-gov" : "aws")}';
|
|
70
|
+
mockData.push('mock_data "aws_partition" { defaults = '+JSON.stringify({partition:examplePartition})+' }');
|
|
71
|
+
const assume=JSON.stringify({Version:'2012-10-17',Statement:[{Effect:'Allow',Principal:{Service:'ecs-tasks.amazonaws.com'},Action:'sts:AssumeRole',Condition:{StringEquals:{'aws:SourceAccount':v('account_id')},ArnLike:{'aws:SourceArn':'arn:'+partition+':ecs:'+v('region')+':'+v('account_id')+':*'}}}]});
|
|
72
|
+
add('aws_ecs_cluster',n,{name});add('aws_cloudwatch_log_group',n,{name:input(n+'_log_group','Explicit log group name.','/architect/application'),retention_in_days:runtime.logRetentionDays});
|
|
73
|
+
add('aws_iam_role',n,{assume_role_policy:assume});add('aws_iam_role',n+'_task',{assume_role_policy:assume});
|
|
74
|
+
add('aws_iam_role_policy',n,{role:ref('aws_iam_role',n,'id'),policy:JSON.stringify({Version:'2012-10-17',Statement:[{Effect:'Allow',Action:['ecr:GetAuthorizationToken'],Resource:'*'},{Effect:'Allow',Action:['ecr:BatchCheckLayerAvailability','ecr:GetDownloadUrlForLayer','ecr:BatchGetImage'],Resource:input(n+'_repository_arn','Exact ECR repository ARN for the supplied private image.','arn:aws:ecr:ap-southeast-2:123456789012:repository/architect')},{Effect:'Allow',Action:['logs:CreateLogStream','logs:PutLogEvents'],Resource:ref('aws_cloudwatch_log_group',n,'arn')+':*'}]})});
|
|
75
|
+
variable[n+'_repository_arn'].validation={condition:'${can(regex("^arn:(aws|aws-cn|aws-us-gov):ecr:([a-z]{2}-[a-z]+|us-gov-[a-z]+)-[0-9]{1,2}:[0-9]{12}:repository/[a-z0-9][a-z0-9._/-]{0,255}$", var.'+n+'_repository_arn))}',error_message:'Supply one explicit ECR repository ARN in a supported partition, without wildcards.'};
|
|
76
|
+
const repositoryRegion='try(split(":",var.'+n+'_repository_arn)[3],"")';
|
|
77
|
+
resource.aws_iam_role_policy[n].lifecycle.precondition=[{condition:'${startswith(var.'+n+'_repository_arn,"arn:'+partition+':ecr:") && (startswith('+repositoryRegion+',"cn-") ? "aws-cn" : startswith('+repositoryRegion+',"us-gov-") ? "aws-us-gov" : "aws") == data.aws_partition.'+n+'.partition}',error_message:'The image repository ARN and its region family must belong to the native deployment partition.'}];
|
|
78
|
+
examples[n+'_repository_arn']='arn:'+examplePartition+':ecr:'+examples.region+':123456789012:repository/architect';
|
|
79
|
+
add('aws_ecs_task_definition',n,{family:name,network_mode:'awsvpc',requires_compatibilities:['FARGATE'],cpu:runtime.cpu,memory:runtime.memory,execution_role_arn:ref('aws_iam_role',n,'arn'),task_role_arn:ref('aws_iam_role',n+'_task','arn'),container_definitions:JSON.stringify([{name:'application',image,essential:true,portMappings:[{containerPort:8080,protocol:'tcp'}],logConfiguration:{logDriver:'awslogs',options:{'awslogs-group':ref('aws_cloudwatch_log_group',n,'name'),'awslogs-region':v('region'),'awslogs-stream-prefix':'application'}}}])});
|
|
80
|
+
input(n+'_vpc_id','Exact existing VPC shared by the selected subnets and security groups.','vpc-11111111111111111');
|
|
81
|
+
variable[n+'_vpc_id'].validation={condition:'${can(regex("^vpc-([0-9a-f]{8}|[0-9a-f]{17})$", var.'+n+'_vpc_id))}',error_message:'Supply the exact existing VPC ID.'};
|
|
82
|
+
for(const [key,prefix]of [['subnets','subnet'],['security_groups','sg']]){
|
|
83
|
+
variable[n+'_'+key]={type:'list(string)',nullable:false,validation:{condition:'${length(var.'+n+'_'+key+') > 0 && length(distinct(var.'+n+'_'+key+')) == length(var.'+n+'_'+key+') && alltrue([for id in var.'+n+'_'+key+' : can(regex("^'+prefix+'-([0-9a-f]{8}|[0-9a-f]{17})$", id))])}',error_message:'Supply distinct existing '+key+' IDs; network access policy requires separate review.'}};examples[n+'_'+key]=[prefix+'-11111111111111111'];
|
|
84
|
+
}
|
|
85
|
+
data.aws_subnet||={};data.aws_subnet[n]={for_each:'${toset(var.'+n+'_subnets)}',id:'${each.value}'};
|
|
86
|
+
data.aws_security_group||={};data.aws_security_group[n]={for_each:'${toset(var.'+n+'_security_groups)}',id:'${each.value}'};
|
|
87
|
+
add(d.type,n,{name,cluster:ref('aws_ecs_cluster',n,'id'),task_definition:ref('aws_ecs_task_definition',n,'arn'),desired_count:1,launch_type:'FARGATE',platform_version:'1.4.0',network_configuration:{subnets:v(n+'_subnets'),security_groups:v(n+'_security_groups'),assign_public_ip:false},depends_on:['aws_iam_role_policy.'+n],lifecycle:{precondition:['aws_subnet','aws_security_group'].map(type=>({condition:'${alltrue([for item in values(data.'+type+'.'+n+') : item.vpc_id == var.'+n+'_vpc_id])}',error_message:'Selected existing network resources must belong to the configured VPC.'}))}});outputs[n+'_id']={value:ref(d.type,n,'id')};
|
|
88
|
+
mockData.push(...['aws_subnet','aws_security_group'].map(type=>'mock_data "'+type+'" { defaults = '+JSON.stringify({vpc_id:examples[n+'_vpc_id']})+' }'));
|
|
89
|
+
resource.aws_ecs_service[n].lifecycle.precondition.push({condition:partitionCheck,error_message:'The provider partition does not match the selected supported region family.'});
|
|
90
|
+
const foreignPartition=examplePartition==='aws'?'aws-cn':'aws';
|
|
91
|
+
tests.push('run "'+n+'_reject_foreign_repository_partition" {\n command = plan\n variables { '+n+'_repository_arn = '+JSON.stringify(examples[n+'_repository_arn'].replace('arn:'+examplePartition+':','arn:'+foreignPartition+':'))+' }\n expect_failures = [aws_iam_role_policy.'+n+']\n}');
|
|
92
|
+
tests.push('run "'+n+'_reject_foreign_provider_partition" {\n command = plan\n override_data {\n target = data.aws_partition.'+n+'\n values = {partition = '+JSON.stringify(foreignPartition)+'}\n }\n expect_failures = [aws_iam_role_policy.'+n+']\n}');
|
|
93
|
+
const foreignRepository='arn:'+foreignPartition+':ecr:'+(foreignPartition==='aws-cn'?'cn-north-1':'eu-west-1')+':123456789012:repository/architect';
|
|
94
|
+
tests.push('run "'+n+'_reject_partition_region_mismatch" {\n command = plan\n variables { '+n+'_repository_arn = '+JSON.stringify(foreignRepository)+' }\n override_data {\n target = data.aws_partition.'+n+'\n values = {partition = '+JSON.stringify(foreignPartition)+'}\n }\n expect_failures = [aws_ecs_service.'+n+']\n}');
|
|
95
|
+
for(const [type,key]of [['aws_subnet','subnets'],['aws_security_group','security_groups']])tests.push('run "'+n+'_reject_foreign_'+type+'" {\n command = plan\n override_data {\n target = data.'+type+'.'+n+'['+JSON.stringify(examples[n+'_'+key][0])+']\n values = {vpc_id = "vpc-22222222222222222"}\n }\n expect_failures = [aws_ecs_service.'+n+']\n}');
|
|
96
|
+
}
|
|
97
|
+
const imagePath={aws:`jsondecode(aws_ecs_task_definition.${n}.container_definitions)[0].image`,azure:`azurerm_container_app.${n}.template[0].container[0].image`,gcp:`google_cloud_run_v2_service.${n}.template[0].containers[0].image`,ibm:`ibm_code_engine_app.${n}.image_reference`}[cloud];
|
|
98
|
+
const privateCondition={aws:`aws_ecs_service.${n}.network_configuration[0].assign_public_ip == false`,azure:`azurerm_container_app.${n}.ingress[0].external_enabled == false`,gcp:`google_cloud_run_v2_service.${n}.ingress == "INGRESS_TRAFFIC_INTERNAL_ONLY"`,ibm:`ibm_code_engine_app.${n}.managed_domain_mappings == "local"`}[cloud];
|
|
99
|
+
tests.push(`run "${n}_security" {\n command = plan\n assert {\n condition = ${imagePath} == var.${n}_image\n error_message = "Use the reviewed immutable image."\n }\n assert {\n condition = ${privateCondition}\n error_message = "Unrequested public exposure is forbidden."\n }\n}\nrun "${n}_reject_mutable_image" {\n command = plan\n variables { ${n}_image = "registry.example.com/app:latest" }\n expect_failures = [var.${n}_image]\n}`);
|
|
100
|
+
tests.push(`run "${n}_footprint" {\n command = plan\n assert {\n condition = ${d.type}.${n}.name == var.${n}_name\n error_message = "Container service name must use the reviewed input."\n }\n}`);
|
|
101
|
+
}
|
|
102
|
+
if(nodes.length>1&&mockData.length)throw Error('Existing-system test contracts require one independently scoped unit.');
|
|
103
|
+
tests.push('run "invalid_region_blocked" {\n command = plan\n variables { region = "Sydney (proposed)" }\n expect_failures = [var.region]\n}');
|
|
104
|
+
if(selectedRegion)tests.push('run "changed_accepted_region_blocked" {\n command = plan\n variables { region = '+JSON.stringify({aws:'us-east-1',azure:'westus2',gcp:'us-central1',ibm:'eu-de'}[cloud]===selectedRegion?{aws:'ap-southeast-2',azure:'australiaeast',gcp:'australia-southeast1',ibm:'au-syd'}[cloud]:{aws:'us-east-1',azure:'westus2',gcp:'us-central1',ibm:'eu-de'}[cloud])+' }\n expect_failures = [var.region]\n}');
|
|
105
|
+
const gaps=[...plan.gapDetails.map(g=>g.id),...(environment==='production'?['production-state-and-operations-review-required']:[])];
|
|
106
|
+
const config={terraform:{required_version:'>= 1.7.0, < 2.0.0',required_providers:{[d.provider]:{source:d.source,version:d.version}}},provider,variable,locals:{unfinished_work:gaps},...(Object.keys(data).length?{data}:{}),resource,output:outputs};
|
|
107
|
+
const values=Object.entries({...examples,review_approved:true}).map(([k,val])=>k+' = '+JSON.stringify(val)).join('\n');
|
|
108
|
+
return {'.gitignore':'.terraform/\n*.tfstate*\n*.tfplan\n*.tfvars\n*.tfvars.json\n!deployment.tfvars.json.example\n',...existingReferenceFiles(project),...(CLOUD_PROVIDER_LOCKS[cloud]?{'.terraform.lock.hcl':cloud==='ibm'?ibmProviderLock.lock:CLOUD_PROVIDER_LOCKS[cloud]}:{}),'main.tf.json':JSON.stringify(config,null,2),'resource-schedule.json':JSON.stringify(plan,null,2),'deployment.tfvars.json.example':JSON.stringify(examples,null,2),'tests/container.tftest.hcl':`mock_provider "${d.provider}" {\n${mockData.join('\n')}\n}\nvariables {\n${values}\n}\n${tests.join('\n')}\nrun "unapproved_blocked" {\n command = plan\n variables { review_approved = false }\n expect_failures = [terraform_data.review_gate]\n}\n`,'README.md':`# ${d.service} container footprint\n\nA native deployment footprint for an explicitly selected, supplied Linux application image listening on port 8080. Pin and build the real application image before use. This compiler does not implement application authentication, payments, durable memory or unspecified connections. It never packages the local loopback sidecar as a hosted application.\n\nMemory requirements use config.containerMemoryBytes as an exact integer quantity; legacy memoryMb retains MiB semantics (1048576 bytes). Provider-native allocation is literal in main.tf.json. Compatible CPU allocation is an engineering proposal, not measured performance. Decimal IBM GB is not GiB. Unsupported exact sizes, conflicting quantities and other unimplemented settings remain in resource-schedule.json and block review approval; no rounding or provider fallback is performed. Azure uses combinations valid for Consumption-only environments until an explicit workload-profile contract is implemented.\n\nConfigured canonical regions are retained as validated inputs. A configured value can still be a proposal: generation does not accept requirements or decisions, and review_approved remains false. Changing that destination requires changing and regenerating the design; unresolved regions have no deployment default. Identifier syntax is not regional service availability or a residency/compliance claim. Azure reads the existing managed environment to check its native location and exact resource ID/subscription; IBM reads the existing project to check its native region and account. These are read-only references, not imports or replacement resources. Mock data in local tests is an explicit fixture, not an observed cloud environment. Parent composition gates can defer child data reads until apply; unit mock plans exercise the checks with resolved fixture data. No account plan or apply is performed by these local checks.\n\nManaged native resources retain prevent_destroy. Terraform rejects their destruction or replacement while these lifecycle rules remain in configuration; removing the resource or editing its configuration can remove that protection. Image revisions that require replacement need a separately reviewed lifecycle change and plan. This is not a backup, state lock or migration mechanism.\n\n${cloud==='aws'?'AWS reads exactly the selected existing subnets and security groups in the configured provider region and checks that they share the supplied VPC. It does not create or modify those networks. VPC membership and no public task IP do not prove route, firewall, egress or end-to-end access policy. Review those policies and local connection tests separately, including shared-VPC ownership. ECS role trust is scoped to the configured source account and regional ECS ARN; execution permissions cover only image retrieval and owned log streams. Native aws_partition metadata supplies the ARN partition for commercial, China and GovCloud region families. Native guards reject region-family and ECR repository partition mismatches. This does not establish regional service availability or cross-partition application/network integration. Other adapters retain their separate partition policies. The application task role has no application-data grants.':''}\n\nIngress is private; public website routing and user authentication are separate contracts. Runtime identity has no application-data grants. Existing network/environment/project prerequisites must be reviewed; image-pull and platform logging configuration must be verified for the destination. Azure and IBM private-registry credentials require a separate secret integration. No credentials belong in this directory.\n\nUse Terraform 1.7+, copy deployment.tfvars.json.example to a private inputs file, supply every reviewed input and image digest, run terraform init -backend=false, terraform validate and terraform test. Mock tests inspect configuration only. An authorized account plan, real image startup checks, access tests, rollback and approval are required before deployment. Production remains blocked pending state and operational review.\n`};
|
|
109
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Conversation belongs to the project file, without changing the design revision.
|
|
2
|
+
export function conversationMessages(project, fallback = []) {
|
|
3
|
+
const messages = project.extensions?.conversation?.messages;
|
|
4
|
+
return Array.isArray(messages) && messages.length ? cleanMessages(messages) : fallback;
|
|
5
|
+
}
|
|
6
|
+
function cleanMessages(messages) {
|
|
7
|
+
return messages.filter(m => m && ['user','assistant'].includes(m.role) && typeof m.text === 'string').map(m => ({
|
|
8
|
+
role:m.role, text:m.text,
|
|
9
|
+
...(typeof m.activityId==='string'&&/^[a-f0-9-]{36}$/.test(m.activityId)?{activityId:m.activityId}:{}),
|
|
10
|
+
...(m.requestId?{requestId:String(m.requestId).slice(0,100)}:{}),
|
|
11
|
+
...(['queued','processing','complete','superseded','failed','cancelled'].includes(m.workState)?{workState:m.workState}:{}),
|
|
12
|
+
...(Array.isArray(m.attachments) && m.attachments.length ? {attachments:m.attachments.filter(a=>a && typeof a === "object").map(a=>({id:String(a.id || a.name),name:String(a.name || 'Attachment'),mime:String(a.mime || ''),originalNotSaved:true}))} : {}),
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
export function withConversation(project, messages) {
|
|
16
|
+
return {...project, extensions:{...project.extensions, conversation:{version:1,messages:cleanMessages(messages)}}};
|
|
17
|
+
}
|