@atmem/architect 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONSTITUTION.md +144 -0
- package/LICENSE +202 -0
- package/NOTICE +6 -0
- package/README.md +31 -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-BTLHaa3J.css +1 -0
- package/dist/assets/index-CQ2C1gKF.js +21338 -0
- package/dist/assets/index.es-DTyqIdaO.js +18 -0
- package/dist/assets/purify.es-CAi2OJFm.js +3 -0
- package/dist/assets/visual-export-Ox0j5xj5.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/atmem-APACHE-2.0.txt +202 -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/atmem-APACHE-2.0.txt +202 -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 +193 -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 +221 -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 +172 -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 +483 -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 +185 -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_context.py +58 -0
- package/server/memory_routes.py +141 -0
- package/server/memory_service.py +306 -0
- package/server/memory_worker.py +129 -0
- package/server/openai_voice.py +80 -0
- package/server/orca_handoff.py +90 -0
- package/server/packaged_app.py +9 -0
- package/server/pricing.py +190 -0
- package/server/process_control_observation.py +31 -0
- package/server/prompts.py +136 -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/server/windows_snapshot.py +119 -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 +39 -0
- package/src/ArtifactChecks.jsx +49 -0
- package/src/BlockRequirements.jsx +13 -0
- package/src/BrainActivity.jsx +11 -0
- package/src/ChatMessage.jsx +29 -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 +387 -0
- package/src/EngineeringPanel.jsx +151 -0
- package/src/FileTree.jsx +7 -0
- package/src/FinalChecklist.jsx +15 -0
- package/src/HelpNote.jsx +3 -0
- package/src/ImplementationDelivery.jsx +91 -0
- package/src/JourneyViews.jsx +403 -0
- package/src/LocationChoices.jsx +12 -0
- package/src/MemoryPanel.jsx +58 -0
- package/src/OpenAIVoicePanel.jsx +66 -0
- package/src/OutputsView.jsx +71 -0
- package/src/ProjectChecks.jsx +44 -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 +18 -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 +190 -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/final-package.mjs +34 -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 +106 -0
- package/src/journey.mjs +97 -0
- package/src/levels.mjs +145 -0
- package/src/local-agent.mjs +184 -0
- package/src/main.jsx +2481 -0
- package/src/model-policy-preflight.mjs +34 -0
- package/src/openai-voice.mjs +102 -0
- package/src/output-bundle.mjs +13 -0
- package/src/ownership-inspection.mjs +28 -0
- package/src/pack.mjs +201 -0
- package/src/pricing.mjs +85 -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 +37 -0
- package/src/useEmulation.jsx +36 -0
- package/src/useEngineeringStatus.mjs +17 -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,191 @@
|
|
|
1
|
+
import {compileTextStatistics} from './text-statistics.mjs';
|
|
2
|
+
export const ASYNC_INTEGRATIONS=['s3-object-created','sqs-lambda','lambda-s3-read','lambda-dynamodb-write','sqs-redrive'];
|
|
3
|
+
export function asyncPipelinePlan(project,rows){
|
|
4
|
+
const byId=new Map(rows.map(r=>[r.id,r])),nodes=new Map(project.nodes.map(n=>[n.id,n]));
|
|
5
|
+
const edges=(source,type)=>project.edges.filter(e=>e.source===source&&e.integration===type);
|
|
6
|
+
const typed=(id,implementation,service)=>{const n=nodes.get(id),r=byId.get(id);return n?.data.implementation===implementation&&r?.provider==='aws'&&!r.existing&&r.service===service;};
|
|
7
|
+
const candidates=[];
|
|
8
|
+
for(const worker of rows){
|
|
9
|
+
if(!typed(worker.id,'async-word-count','AWS Lambda'))continue;
|
|
10
|
+
const trigger=project.edges.filter(e=>e.target===worker.id&&e.integration==='sqs-lambda');
|
|
11
|
+
const reads=edges(worker.id,'lambda-s3-read'),writes=edges(worker.id,'lambda-dynamodb-write');
|
|
12
|
+
if(trigger.length!==1||reads.length!==1||writes.length!==1)continue;
|
|
13
|
+
const queue=byId.get(trigger[0].source),bucket=byId.get(reads[0].target),table=byId.get(writes[0].target);
|
|
14
|
+
if(!queue||!bucket?.foundation||!table||!typed(queue.id,'sqs-standard','Amazon SQS')||!typed(table.id,'word-count-results','Amazon DynamoDB'))continue;
|
|
15
|
+
const notifications=edges(bucket.id,'s3-object-created').filter(e=>e.target===queue.id),redrives=edges(queue.id,'sqs-redrive');
|
|
16
|
+
if(notifications.length!==1||redrives.length!==1)continue;
|
|
17
|
+
const dlq=byId.get(redrives[0].target);
|
|
18
|
+
if(!dlq||dlq.id===queue.id||!typed(dlq.id,'sqs-dead-letter','Amazon SQS'))continue;
|
|
19
|
+
candidates.push({worker,queue,bucket,table,dlq,edges:[trigger[0],reads[0],writes[0],notifications[0],redrives[0]]});
|
|
20
|
+
}
|
|
21
|
+
// Shared ownership and overlapping S3 notification filters require a separate fan-out contract.
|
|
22
|
+
const counts=new Map();for(const p of candidates)for(const r of [p.worker,p.queue,p.table,p.dlq,p.bucket])counts.set(r.id,(counts.get(r.id)||0)+1);
|
|
23
|
+
const pipelines=candidates.filter(p=>[p.worker,p.queue,p.table,p.dlq,p.bucket].every(r=>counts.get(r.id)===1));
|
|
24
|
+
return {pipelines,componentIds:pipelines.flatMap(p=>[p.worker.id,p.queue.id,p.table.id,p.dlq.id]),edgeIds:pipelines.flatMap(p=>p.edges.map(e=>e.id))};
|
|
25
|
+
}
|
|
26
|
+
export const ASYNC_HANDLER=`"""Version-specific, bounded, idempotent S3 text processing with partial batch failures."""
|
|
27
|
+
import hashlib
|
|
28
|
+
import json
|
|
29
|
+
import logging
|
|
30
|
+
import os
|
|
31
|
+
from urllib.parse import unquote_plus
|
|
32
|
+
import boto3
|
|
33
|
+
from botocore.config import Config
|
|
34
|
+
from botocore.exceptions import ClientError
|
|
35
|
+
|
|
36
|
+
_clients = None
|
|
37
|
+
logger = logging.getLogger(__name__)
|
|
38
|
+
|
|
39
|
+
def clients():
|
|
40
|
+
global _clients
|
|
41
|
+
if _clients is None:
|
|
42
|
+
config=Config(connect_timeout=3,read_timeout=5,retries={"max_attempts":2})
|
|
43
|
+
_clients=(boto3.client("s3",config=config),boto3.client("dynamodb",config=config))
|
|
44
|
+
return _clients
|
|
45
|
+
|
|
46
|
+
def process(body):
|
|
47
|
+
if not isinstance(body,dict):raise ValueError("Invalid storage notification")
|
|
48
|
+
if body.get("Event")=="s3:TestEvent":return
|
|
49
|
+
records=body.get("Records")
|
|
50
|
+
if not isinstance(records,list) or not 1 <= len(records) <= 10:raise ValueError("Invalid notification batch")
|
|
51
|
+
s3,db=clients()
|
|
52
|
+
for record in records:
|
|
53
|
+
if record.get("eventSource")!="aws:s3" or not str(record.get("eventName","")).startswith("ObjectCreated:"):raise ValueError("Unsupported storage event")
|
|
54
|
+
bucket=record["s3"]["bucket"]["name"]
|
|
55
|
+
key=unquote_plus(record["s3"]["object"]["key"])
|
|
56
|
+
version=record["s3"]["object"].get("versionId")
|
|
57
|
+
if bucket!=os.environ["SOURCE_BUCKET"] or not isinstance(version,str) or not version or version=="null":raise ValueError("Wrong bucket or missing exact object version")
|
|
58
|
+
limit=int(os.environ["MAX_INPUT_BYTES"])
|
|
59
|
+
result=s3.get_object(Bucket=bucket,Key=key,VersionId=version,ExpectedBucketOwner=os.environ["EXPECTED_ACCOUNT_ID"])
|
|
60
|
+
stream=result["Body"]
|
|
61
|
+
try:
|
|
62
|
+
if result.get("ContentLength",0)>limit:raise ValueError("Document too large")
|
|
63
|
+
data=stream.read(limit+1)
|
|
64
|
+
finally:stream.close()
|
|
65
|
+
if len(data)>limit:raise ValueError("Document too large")
|
|
66
|
+
text=data.decode("utf-8")
|
|
67
|
+
object_id=hashlib.sha256(json.dumps([bucket,key,version],ensure_ascii=False,separators=(",",":")).encode()).hexdigest()
|
|
68
|
+
item={"objectId":{"S":object_id},"wordCount":{"N":str(len(text.split()))},"characterCount":{"N":str(len(text))},"sourceVersion":{"S":version},"contentSha256":{"S":hashlib.sha256(data).hexdigest()},"processorVersion":{"S":"1"}}
|
|
69
|
+
try:db.put_item(TableName=os.environ["RESULTS_TABLE"],Item=item,ConditionExpression="attribute_not_exists(objectId)")
|
|
70
|
+
except ClientError as error:
|
|
71
|
+
if error.response.get("Error",{}).get("Code")!="ConditionalCheckFailedException":raise
|
|
72
|
+
|
|
73
|
+
def handler(event,context):
|
|
74
|
+
records=event.get("Records") if isinstance(event,dict) else None
|
|
75
|
+
if not isinstance(records,list) or len(records)>10:raise ValueError("Invalid queue batch")
|
|
76
|
+
failures=[]
|
|
77
|
+
for record in records:
|
|
78
|
+
message_id=record.get("messageId")
|
|
79
|
+
if not isinstance(message_id,str) or not message_id:raise ValueError("Queue message ID is missing")
|
|
80
|
+
try:
|
|
81
|
+
if record.get("eventSource")!="aws:sqs" or record.get("eventSourceARN")!=os.environ["QUEUE_ARN"]:raise ValueError("Wrong event source")
|
|
82
|
+
process(json.loads(record["body"]))
|
|
83
|
+
except Exception as error:
|
|
84
|
+
logger.warning(json.dumps({"event":"record_failed","errorType":type(error).__name__}))
|
|
85
|
+
failures.append({"itemIdentifier":message_id})
|
|
86
|
+
return {"batchItemFailures":failures}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
export function compileAsyncDocuments(plan,environment='staging'){
|
|
90
|
+
const resources={},variables={},outputs={},files={},preconditions=[],builds=[];
|
|
91
|
+
const add=(type,name,body)=>(resources[type]||={})[name]={...body,depends_on:[...(body.depends_on||[]),'terraform_data.review_gate']};
|
|
92
|
+
const ref=(type,row,field)=>`\u0024{${type}.${row.address}.${field}}`;
|
|
93
|
+
const notifications=new Map();
|
|
94
|
+
for(const pipeline of plan.asyncPlan.pipelines){
|
|
95
|
+
const {worker,queue,bucket,table,dlq}=pipeline,n=worker.address,tags={ManagedBy:'AtMem AI Architect',Environment:environment,Component:n};
|
|
96
|
+
const settings={memoryMb:256,functionTimeoutSeconds:30,concurrency:2,maxInputBytes:1000000,...worker.settings};
|
|
97
|
+
const base=compileTextStatistics({...plan,rows:[{...worker,compute:true,settings}]},environment);
|
|
98
|
+
for(const [type,items]of Object.entries(base.resources))resources[type]={...(resources[type]||{}),...items};
|
|
99
|
+
Object.assign(variables,base.variables);Object.assign(outputs,base.outputs);Object.assign(files,base.files);
|
|
100
|
+
files[`handlers/${n}.py`]=ASYNC_HANDLER;
|
|
101
|
+
files[`app-tests/${n}_test.py`]=asyncHandlerTests(n);
|
|
102
|
+
builds.push({address:n,sdk:true});
|
|
103
|
+
const functionResource=resources.aws_lambda_function[n];
|
|
104
|
+
functionResource.environment.variables={...functionResource.environment.variables,SOURCE_BUCKET:ref('aws_s3_bucket',bucket,'id'),RESULTS_TABLE:ref('aws_dynamodb_table',table,'name'),QUEUE_ARN:ref('aws_sqs_queue',queue,'arn'),EXPECTED_ACCOUNT_ID:'${var.aws_account_id}'};
|
|
105
|
+
variables[`${n}_concurrency`].validation={condition:`\u0024{var.${n}_concurrency >= 2 && var.${n}_concurrency <= 1000 && floor(var.${n}_concurrency) == var.${n}_concurrency}`,error_message:'SQS event source maximum concurrency requires an integer from 2 to 1000.'};
|
|
106
|
+
const window=`${n}_batch_window_seconds`,attempts=`${n}_max_receive_count`,alerts=`${n}_alert_topic_arns`;
|
|
107
|
+
variables[window]={type:'number',default:0,validation:{condition:`\u0024{var.${window} >= 0 && var.${window} <= 300 && floor(var.${window}) == var.${window}}`,error_message:'Batch window must be an integer from 0 to 300 seconds.'}};
|
|
108
|
+
variables[attempts]={type:'number',default:5,validation:{condition:`\u0024{var.${attempts} >= 1 && var.${attempts} <= 20 && floor(var.${attempts}) == var.${attempts}}`,error_message:'Choose 1–20 bounded delivery attempts.'}};
|
|
109
|
+
variables[alerts]={type:'list(string)',default:[],description:'Reviewed existing standard SNS topics for DLQ alarms. Required for production; no notification destination is invented.',validation:{condition:`\u0024{alltrue([for arn in var.${alerts} : can(regex("^arn:aws:sns:[a-z0-9-]+:[0-9]{12}:[A-Za-z0-9_-]+$", arn))])}`,error_message:'Use existing standard SNS topic ARNs.'}};
|
|
110
|
+
if(environment==='production')preconditions.push({condition:`\u0024{length(var.${alerts}) > 0}`,error_message:'Production queue processing requires a reviewed alarm notification topic.'});
|
|
111
|
+
preconditions.push({condition:`\u0024{alltrue([for arn in var.${alerts} : startswith(arn, format("arn:aws:sns:%s:%s:", var.aws_region, var.aws_account_id))])}`,error_message:'Alarm topics must use the selected account and region.'});
|
|
112
|
+
add('aws_sqs_queue',dlq.address,{name_prefix:`atmem-dlq-${dlq.address.slice(0,20)}-`,sqs_managed_sse_enabled:true,message_retention_seconds:1209600,tags});
|
|
113
|
+
add('aws_sqs_queue',queue.address,{name_prefix:`atmem-work-${queue.address.slice(0,20)}-`,sqs_managed_sse_enabled:true,message_retention_seconds:345600,visibility_timeout_seconds:`\u0024{6 * var.${n}_timeout_seconds + var.${window}}`,redrive_policy:`\u0024{jsonencode({deadLetterTargetArn=aws_sqs_queue.${dlq.address}.arn,maxReceiveCount=var.${attempts}})}`,tags});
|
|
114
|
+
add('aws_sqs_queue_policy',dlq.address,{queue_url:ref('aws_sqs_queue',dlq,'id'),policy:JSON.stringify({Version:'2012-10-17',Statement:[{Effect:'Deny',Principal:'*',Action:'sqs:*',Resource:ref('aws_sqs_queue',dlq,'arn'),Condition:{Bool:{'aws:SecureTransport':'false','aws:PrincipalIsAWSService':'false'}}}]})});
|
|
115
|
+
add('aws_sqs_queue_redrive_allow_policy',dlq.address,{queue_url:ref('aws_sqs_queue',dlq,'id'),redrive_allow_policy:`\u0024{jsonencode({redrivePermission="byQueue",sourceQueueArns=[aws_sqs_queue.${queue.address}.arn]})}`});
|
|
116
|
+
add('aws_sqs_queue_policy',queue.address,{queue_url:ref('aws_sqs_queue',queue,'id'),policy:JSON.stringify({Version:'2012-10-17',Statement:[{Effect:'Allow',Principal:{Service:'s3.amazonaws.com'},Action:'sqs:SendMessage',Resource:ref('aws_sqs_queue',queue,'arn'),Condition:{ArnEquals:{'aws:SourceArn':ref('aws_s3_bucket',bucket,'arn')},StringEquals:{'aws:SourceAccount':'${var.aws_account_id}'}}},{Effect:'Deny',Principal:'*',Action:'sqs:*',Resource:ref('aws_sqs_queue',queue,'arn'),Condition:{Bool:{'aws:SecureTransport':'false','aws:PrincipalIsAWSService':'false'}}}]})});
|
|
117
|
+
add('aws_dynamodb_table',table.address,{name:`atmem-results-${ref('aws_iam_role',worker,'name')}`,billing_mode:'PAY_PER_REQUEST',hash_key:'objectId',attribute:[{name:'objectId',type:'S'}],point_in_time_recovery:{enabled:true},server_side_encryption:{enabled:true},deletion_protection_enabled:environment==='production',lifecycle:{prevent_destroy:environment==='production'},tags});
|
|
118
|
+
const policy=JSON.parse(resources.aws_iam_role_policy[n].policy);
|
|
119
|
+
policy.Statement.push({Effect:'Allow',Action:['s3:GetObjectVersion'],Resource:`${ref('aws_s3_bucket',bucket,'arn')}/*`},{Effect:'Allow',Action:['dynamodb:PutItem'],Resource:ref('aws_dynamodb_table',table,'arn')},{Effect:'Allow',Action:['sqs:ReceiveMessage','sqs:DeleteMessage','sqs:GetQueueAttributes'],Resource:ref('aws_sqs_queue',queue,'arn')});
|
|
120
|
+
resources.aws_iam_role_policy[n].policy=JSON.stringify(policy);
|
|
121
|
+
add('aws_lambda_event_source_mapping',n,{event_source_arn:ref('aws_sqs_queue',queue,'arn'),function_name:ref('aws_lambda_alias',worker,'arn'),batch_size:10,maximum_batching_window_in_seconds:`\u0024{var.${window}}`,function_response_types:['ReportBatchItemFailures'],scaling_config:{maximum_concurrency:`\u0024{var.${n}_concurrency}`},depends_on:[`aws_iam_role_policy.${n}`]});
|
|
122
|
+
add('aws_cloudwatch_metric_alarm',dlq.address,{alarm_name:`atmem-dlq-${ref('aws_sqs_queue',dlq,'name')}`,namespace:'AWS/SQS',metric_name:'ApproximateNumberOfMessagesVisible',dimensions:{QueueName:ref('aws_sqs_queue',dlq,'name')},statistic:'Maximum',period:60,evaluation_periods:1,threshold:0,comparison_operator:'GreaterThanThreshold',treat_missing_data:'notBreaching',alarm_actions:`\u0024{var.${alerts}}`,tags});
|
|
123
|
+
const notification=notifications.get(bucket.address)||{bucket,queue:[],policies:[]};notification.queue.push({id:n,queue_arn:ref('aws_sqs_queue',queue,'arn'),events:['s3:ObjectCreated:*']});notification.policies.push(`aws_sqs_queue_policy.${queue.address}`);notifications.set(bucket.address,notification);
|
|
124
|
+
outputs[`${n}_pipeline`]={value:{source_bucket:ref('aws_s3_bucket',bucket,'id'),queue_url:ref('aws_sqs_queue',queue,'id'),dead_letter_queue_url:ref('aws_sqs_queue',dlq,'id'),results_table:ref('aws_dynamodb_table',table,'name')}};
|
|
125
|
+
}
|
|
126
|
+
for(const [address,entry]of notifications)add('aws_s3_bucket_notification',address,{bucket:ref('aws_s3_bucket',entry.bucket,'id'),queue:entry.queue,depends_on:[...entry.policies,`aws_s3_bucket_versioning.${address}`]});
|
|
127
|
+
return {resources,variables,outputs,files,preconditions,builds};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function asyncHandlerTests(address){
|
|
131
|
+
return `import importlib.util
|
|
132
|
+
import io
|
|
133
|
+
import json
|
|
134
|
+
import os
|
|
135
|
+
from pathlib import Path
|
|
136
|
+
import sys
|
|
137
|
+
import unittest
|
|
138
|
+
from unittest.mock import MagicMock
|
|
139
|
+
root=Path(__file__).resolve().parents[1]
|
|
140
|
+
sys.path.insert(0,str(root/"build/${address}"))
|
|
141
|
+
from botocore.exceptions import ClientError
|
|
142
|
+
spec=importlib.util.spec_from_file_location("worker",root/"build/${address}/${address}.py")
|
|
143
|
+
module=importlib.util.module_from_spec(spec)
|
|
144
|
+
spec.loader.exec_module(module)
|
|
145
|
+
class WorkerTests(unittest.TestCase):
|
|
146
|
+
def setUp(self):
|
|
147
|
+
os.environ.update(SOURCE_BUCKET="test-bucket",RESULTS_TABLE="results",QUEUE_ARN="arn:aws:sqs:ap-southeast-2:123456789012:queue",EXPECTED_ACCOUNT_ID="123456789012",MAX_INPUT_BYTES="100")
|
|
148
|
+
self.s3=MagicMock();self.db=MagicMock();module._clients=(self.s3,self.db)
|
|
149
|
+
self.s3.get_object.side_effect=lambda **kwargs:{"Body":io.BytesIO(b"one two three"),"ContentLength":13}
|
|
150
|
+
def message(self,version="v1",bucket="test-bucket",message_id="record-1"):
|
|
151
|
+
body={"Records":[{"eventSource":"aws:s3","eventName":"ObjectCreated:Put","s3":{"bucket":{"name":bucket},"object":{"key":"synthetic+text.txt","versionId":version}}}]}
|
|
152
|
+
return {"messageId":message_id,"eventSource":"aws:sqs","eventSourceARN":os.environ["QUEUE_ARN"],"body":json.dumps(body)}
|
|
153
|
+
def test_exact_version_and_conditional_result(self):
|
|
154
|
+
self.assertEqual(module.handler({"Records":[self.message()]},None),{"batchItemFailures":[]})
|
|
155
|
+
self.s3.get_object.assert_called_once_with(Bucket="test-bucket",Key="synthetic text.txt",VersionId="v1",ExpectedBucketOwner="123456789012")
|
|
156
|
+
call=self.db.put_item.call_args.kwargs
|
|
157
|
+
self.assertEqual(call["ConditionExpression"],"attribute_not_exists(objectId)")
|
|
158
|
+
self.assertEqual(call["Item"]["wordCount"],{"N":"3"})
|
|
159
|
+
self.assertEqual(call["Item"]["sourceVersion"],{"S":"v1"})
|
|
160
|
+
def test_duplicate_is_success_without_overwriting(self):
|
|
161
|
+
self.db.put_item.side_effect=[{},ClientError({"Error":{"Code":"ConditionalCheckFailedException"}},"PutItem")]
|
|
162
|
+
event={"Records":[self.message()]}
|
|
163
|
+
self.assertEqual(module.handler(event,None),{"batchItemFailures":[]})
|
|
164
|
+
self.assertEqual(module.handler(event,None),{"batchItemFailures":[]})
|
|
165
|
+
calls=self.db.put_item.call_args_list
|
|
166
|
+
self.assertEqual(calls[0].kwargs["Item"]["objectId"],calls[1].kwargs["Item"]["objectId"])
|
|
167
|
+
self.assertTrue(all(c.kwargs["ConditionExpression"]=="attribute_not_exists(objectId)" for c in calls))
|
|
168
|
+
def test_new_version_has_distinct_result(self):
|
|
169
|
+
module.handler({"Records":[self.message("v1"),self.message("v2",message_id="record-2")]},None)
|
|
170
|
+
calls=self.db.put_item.call_args_list
|
|
171
|
+
self.assertNotEqual(calls[0].kwargs["Item"]["objectId"],calls[1].kwargs["Item"]["objectId"])
|
|
172
|
+
def test_partial_failure_and_redacted_diagnostics(self):
|
|
173
|
+
bad=self.message(bucket="private-secret-title",message_id="bad")
|
|
174
|
+
with self.assertLogs(module.logger,level="WARNING") as logs:
|
|
175
|
+
result=module.handler({"Records":[bad,self.message(message_id="good")]},None)
|
|
176
|
+
self.assertEqual(result,{"batchItemFailures":[{"itemIdentifier":"bad"}]})
|
|
177
|
+
self.assertNotIn("private-secret-title"," ".join(logs.output))
|
|
178
|
+
self.assertEqual(self.db.put_item.call_count,1)
|
|
179
|
+
def test_oversized_document_closes_stream_and_does_not_write(self):
|
|
180
|
+
stream=io.BytesIO(b"x"*101);self.s3.get_object.side_effect=None;self.s3.get_object.return_value={"Body":stream,"ContentLength":101}
|
|
181
|
+
with self.assertLogs(module.logger,level="WARNING"):
|
|
182
|
+
result=module.handler({"Records":[self.message()]},None)
|
|
183
|
+
self.assertEqual(len(result["batchItemFailures"]),1);self.assertTrue(stream.closed);self.db.put_item.assert_not_called()
|
|
184
|
+
def test_storage_test_event_and_retryable_database_failure(self):
|
|
185
|
+
test=self.message();test["body"]=json.dumps({"Event":"s3:TestEvent"})
|
|
186
|
+
self.assertEqual(module.handler({"Records":[test]},None),{"batchItemFailures":[]});self.s3.get_object.assert_not_called()
|
|
187
|
+
self.db.put_item.side_effect=ClientError({"Error":{"Code":"ProvisionedThroughputExceededException"}},"PutItem")
|
|
188
|
+
with self.assertLogs(module.logger,level="WARNING"):
|
|
189
|
+
self.assertEqual(module.handler({"Records":[self.message()]},None),{"batchItemFailures":[{"itemIdentifier":"record-1"}]})
|
|
190
|
+
`;
|
|
191
|
+
}
|