@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
package/src/core.mjs
ADDED
|
@@ -0,0 +1,863 @@
|
|
|
1
|
+
import {approvalProfiles} from './approval-applications.mjs';
|
|
2
|
+
import {validateArchitectureWork} from './architecture-work.mjs';
|
|
3
|
+
import {validateStateCustody} from './state-custody.mjs';
|
|
4
|
+
import {validateExternalReferences} from './external-identities.mjs';
|
|
5
|
+
import {validateDeploymentOwnership} from './deployment-ownership.mjs';
|
|
6
|
+
import { runtimeSettings } from "./runtime-settings.mjs";
|
|
7
|
+
import { UPSTREAM_DESCRIPTIONS } from "./upstream-catalog.mjs";
|
|
8
|
+
import { cleanEngagement, cleanMeasures } from "./engagement.mjs";
|
|
9
|
+
export const PROVIDERS = {
|
|
10
|
+
aws: { name: "AWS", color: "#1f777c", letter: "a" },
|
|
11
|
+
azure: { name: "Azure", color: "#2687d5", letter: "A" },
|
|
12
|
+
gcp: { name: "Google Cloud", color: "#44956b", letter: "G" },
|
|
13
|
+
ibm: { name: "IBM", color: "#6b6cce", letter: "ibm" },
|
|
14
|
+
tools: { name: "Tools & data", color: "#7b879b", letter: "⌘" },
|
|
15
|
+
};
|
|
16
|
+
export const STAGES = ["Discovery", "Architecture", "Cost Analysis", "Review"];
|
|
17
|
+
export const CLOUDS = ["aws", "azure", "gcp", "ibm"];
|
|
18
|
+
export const KINDS = [
|
|
19
|
+
"source",
|
|
20
|
+
"predict",
|
|
21
|
+
"agent",
|
|
22
|
+
"guard",
|
|
23
|
+
"output",
|
|
24
|
+
"tool",
|
|
25
|
+
"resource",
|
|
26
|
+
"stream",
|
|
27
|
+
"history",
|
|
28
|
+
"features",
|
|
29
|
+
"train",
|
|
30
|
+
"registry",
|
|
31
|
+
"monitor",
|
|
32
|
+
"note",
|
|
33
|
+
];
|
|
34
|
+
// What a sketch block is for, when it has no runnable fixture (kind "resource").
|
|
35
|
+
export const ROLES = ["data", "ingest", "index", "llm", "guard", "human", "app", "output", "model", "monitor"];
|
|
36
|
+
// Blocks that start a flow: they take no input.
|
|
37
|
+
export const SOURCE_KINDS = ["source", "stream", "history"];
|
|
38
|
+
// Predictive maintenance building blocks, one row per cloud, in PDM_KINDS order.
|
|
39
|
+
const PDM_KINDS = ["stream", "history", "features", "train", "registry", "predict", "monitor", "agent", "guard"];
|
|
40
|
+
const PDM_LABELS = {
|
|
41
|
+
aws: ["AWS IoT Core", "Amazon S3 maintenance history", "SageMaker feature pipeline", "SageMaker Pipelines training", "SageMaker Model Registry", "SageMaker endpoint", "SageMaker Model Monitor", "Amazon Bedrock", "Bedrock Guardrails + IAM"],
|
|
42
|
+
azure: ["Azure IoT Hub", "Azure Data Lake maintenance history", "Azure ML feature pipeline", "Azure ML pipelines training", "Azure ML model registry", "Azure ML online endpoint", "Azure ML model monitoring", "Microsoft Foundry models", "Azure AI Content Safety + Entra ID"],
|
|
43
|
+
gcp: ["Pub/Sub sensor ingestion", "BigQuery maintenance history", "Vertex AI Feature Store", "Vertex AI Pipelines training", "Vertex AI Model Registry", "Vertex AI endpoint", "Vertex AI Model Monitoring", "Gemini on Vertex AI", "Model Armor + Cloud IAM"],
|
|
44
|
+
ibm: ["IBM Event Streams", "Db2 maintenance history", "watsonx.data feature pipeline", "watsonx.ai training", "watsonx.governance model inventory", "watsonx.ai deployment", "watsonx.governance monitoring", "watsonx.ai Granite", "watsonx.governance guardrails + IAM"],
|
|
45
|
+
};
|
|
46
|
+
const PDM_DESCRIPTIONS = [
|
|
47
|
+
"Stream vibration, temperature and pressure readings",
|
|
48
|
+
"Work orders and failure records",
|
|
49
|
+
"Join readings with maintenance history into features",
|
|
50
|
+
"Train the failure-risk model on history",
|
|
51
|
+
"Version and approve models before use",
|
|
52
|
+
"Score failure risk for each asset",
|
|
53
|
+
"Watch for data and prediction drift",
|
|
54
|
+
"Explain risk to engineers with cited evidence",
|
|
55
|
+
"Block ungrounded or unauthorised insights",
|
|
56
|
+
];
|
|
57
|
+
export const CATALOG = [
|
|
58
|
+
["tools", "source", "Customer dataset", "Sample input records", "database"],
|
|
59
|
+
[
|
|
60
|
+
"tools",
|
|
61
|
+
"predict",
|
|
62
|
+
"Prediction service",
|
|
63
|
+
"Existing analytics endpoint",
|
|
64
|
+
"model",
|
|
65
|
+
],
|
|
66
|
+
["tools", "agent", "AI assistant", "Explain results with context", "agent"],
|
|
67
|
+
[
|
|
68
|
+
"tools",
|
|
69
|
+
"guard",
|
|
70
|
+
"Approval & policy",
|
|
71
|
+
"Check access before output",
|
|
72
|
+
"shield",
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"tools",
|
|
76
|
+
"output",
|
|
77
|
+
"Response & assertions",
|
|
78
|
+
"Verify the end-to-end result",
|
|
79
|
+
"output",
|
|
80
|
+
],
|
|
81
|
+
["tools", "tool", "REST API", "Connect a business tool", "tool"],
|
|
82
|
+
["tools", "source", "PostgreSQL", "Relational data source", "database"],
|
|
83
|
+
[
|
|
84
|
+
"aws",
|
|
85
|
+
"agent",
|
|
86
|
+
"Amazon Bedrock",
|
|
87
|
+
"Generative AI application layer",
|
|
88
|
+
"agent",
|
|
89
|
+
],
|
|
90
|
+
["aws", "predict", "SageMaker AI", "Predictive model endpoint", "model"],
|
|
91
|
+
["aws", "source", "Amazon S3", "Object storage source", "database"],
|
|
92
|
+
["aws", "tool", "AWS Lambda", "Serverless integration", "tool"],
|
|
93
|
+
["aws", "guard", "IAM policy", "Identity & access boundary", "shield"],
|
|
94
|
+
[
|
|
95
|
+
"azure",
|
|
96
|
+
"agent",
|
|
97
|
+
"Microsoft Foundry",
|
|
98
|
+
"Generative AI application layer",
|
|
99
|
+
"agent",
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"azure",
|
|
103
|
+
"predict",
|
|
104
|
+
"Azure Machine Learning",
|
|
105
|
+
"Predictive model endpoint",
|
|
106
|
+
"model",
|
|
107
|
+
],
|
|
108
|
+
["azure", "source", "Azure SQL", "Relational data source", "database"],
|
|
109
|
+
["azure", "tool", "Azure Functions", "Serverless integration", "tool"],
|
|
110
|
+
[
|
|
111
|
+
"azure",
|
|
112
|
+
"guard",
|
|
113
|
+
"Microsoft Entra ID",
|
|
114
|
+
"Identity & access boundary",
|
|
115
|
+
"shield",
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"gcp",
|
|
119
|
+
"agent",
|
|
120
|
+
"Gemini on Google Cloud",
|
|
121
|
+
"Generative AI application layer",
|
|
122
|
+
"agent",
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"gcp",
|
|
126
|
+
"predict",
|
|
127
|
+
"Vertex AI endpoint",
|
|
128
|
+
"Predictive model endpoint",
|
|
129
|
+
"model",
|
|
130
|
+
],
|
|
131
|
+
["gcp", "source", "BigQuery", "Analytics data source", "database"],
|
|
132
|
+
["gcp", "tool", "Cloud Run", "Application integration", "tool"],
|
|
133
|
+
["gcp", "guard", "Cloud IAM", "Identity & access boundary", "shield"],
|
|
134
|
+
["ibm", "agent", "watsonx.ai", "Generative AI application layer", "agent"],
|
|
135
|
+
[
|
|
136
|
+
"ibm",
|
|
137
|
+
"predict",
|
|
138
|
+
"watsonx model deployment",
|
|
139
|
+
"Predictive model endpoint",
|
|
140
|
+
"model",
|
|
141
|
+
],
|
|
142
|
+
["ibm", "source", "IBM Db2", "Relational data source", "database"],
|
|
143
|
+
["ibm", "tool", "watsonx Orchestrate", "Business tool orchestration", "tool"],
|
|
144
|
+
["ibm", "guard", "IBM Cloud IAM", "Identity & access boundary", "shield"],
|
|
145
|
+
...CLOUDS.flatMap((cloud) =>
|
|
146
|
+
PDM_KINDS.map((kind, i) => [cloud, kind, PDM_LABELS[cloud][i], PDM_DESCRIPTIONS[i], kind]),
|
|
147
|
+
),
|
|
148
|
+
["tools", "tool", "Existing maintenance app", "Client's work-order system (API)", "tool"],
|
|
149
|
+
["tools", "output", "Success measures", "Check PoC success measures", "output"],
|
|
150
|
+
].map(([provider, kind, label, description, icon], i) => ({
|
|
151
|
+
id: `component-${i}`,
|
|
152
|
+
provider,
|
|
153
|
+
kind,
|
|
154
|
+
label,
|
|
155
|
+
description: UPSTREAM_DESCRIPTIONS[label] || description,
|
|
156
|
+
icon,
|
|
157
|
+
}));
|
|
158
|
+
const labels = {
|
|
159
|
+
tools: [
|
|
160
|
+
"Customer dataset",
|
|
161
|
+
"Prediction service",
|
|
162
|
+
"AI assistant",
|
|
163
|
+
"Approval & policy",
|
|
164
|
+
"Response & assertions",
|
|
165
|
+
],
|
|
166
|
+
aws: [
|
|
167
|
+
"Amazon S3",
|
|
168
|
+
"SageMaker AI",
|
|
169
|
+
"Amazon Bedrock",
|
|
170
|
+
"IAM policy",
|
|
171
|
+
"Response & assertions",
|
|
172
|
+
],
|
|
173
|
+
azure: [
|
|
174
|
+
"Azure SQL",
|
|
175
|
+
"Azure Machine Learning",
|
|
176
|
+
"Microsoft Foundry",
|
|
177
|
+
"Microsoft Entra ID",
|
|
178
|
+
"Response & assertions",
|
|
179
|
+
],
|
|
180
|
+
gcp: [
|
|
181
|
+
"BigQuery",
|
|
182
|
+
"Vertex AI endpoint",
|
|
183
|
+
"Gemini on Google Cloud",
|
|
184
|
+
"Cloud IAM",
|
|
185
|
+
"Response & assertions",
|
|
186
|
+
],
|
|
187
|
+
ibm: [
|
|
188
|
+
"IBM Db2",
|
|
189
|
+
"watsonx model deployment",
|
|
190
|
+
"watsonx.ai",
|
|
191
|
+
"IBM Cloud IAM",
|
|
192
|
+
"Response & assertions",
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
export function template(provider = "azure") {
|
|
196
|
+
const kinds = ["source", "predict", "agent", "guard", "output"];
|
|
197
|
+
const positions = [
|
|
198
|
+
{ x: 65, y: 170 },
|
|
199
|
+
{ x: 355, y: 170 },
|
|
200
|
+
{ x: 645, y: 170 },
|
|
201
|
+
{ x: 645, y: 395 },
|
|
202
|
+
{ x: 355, y: 395 },
|
|
203
|
+
];
|
|
204
|
+
return {
|
|
205
|
+
version: 1,
|
|
206
|
+
revision: 1,
|
|
207
|
+
name: "Predictive analytics → AI assistant",
|
|
208
|
+
provider,
|
|
209
|
+
nodes: kinds.map((kind, i) => ({
|
|
210
|
+
id: `block-${i}`,
|
|
211
|
+
type: "resource",
|
|
212
|
+
position: positions[i],
|
|
213
|
+
data: {
|
|
214
|
+
label: labels[provider][i],
|
|
215
|
+
kind,
|
|
216
|
+
inputPosition: i === 3 ? "top" : i === 4 ? "right" : "left",
|
|
217
|
+
outputPosition: i === 2 ? "bottom" : i === 3 ? "left" : "right",
|
|
218
|
+
provider: i === 4 ? "tools" : provider,
|
|
219
|
+
description: [
|
|
220
|
+
"Read sample customer signals",
|
|
221
|
+
"Call an existing prediction model",
|
|
222
|
+
"Explain the prediction with evidence",
|
|
223
|
+
"Enforce access and output policy",
|
|
224
|
+
"Check response and evidence",
|
|
225
|
+
][i],
|
|
226
|
+
config: {
|
|
227
|
+
region: "To be selected",
|
|
228
|
+
classification: "Internal",
|
|
229
|
+
timeout: 5000,
|
|
230
|
+
},
|
|
231
|
+
origin: "proposed",
|
|
232
|
+
},
|
|
233
|
+
})),
|
|
234
|
+
edges: kinds
|
|
235
|
+
.slice(1)
|
|
236
|
+
.map((_, i) => ({
|
|
237
|
+
id: `wire-${i}`,
|
|
238
|
+
source: `block-${i}`,
|
|
239
|
+
target: `block-${i + 1}`,
|
|
240
|
+
type: "smoothstep",
|
|
241
|
+
label: ["records", "prediction", "draft response", "approved result"][
|
|
242
|
+
i
|
|
243
|
+
],
|
|
244
|
+
animated: false,
|
|
245
|
+
})),
|
|
246
|
+
requirements:
|
|
247
|
+
"Help an analyst understand a churn prediction. Retain the existing prediction service; require evidence and authorised access.",
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export const DEFAULT_MEASURES = [
|
|
251
|
+
{ label: "Model precision", path: "training.precision", op: ">=", target: 0.8 },
|
|
252
|
+
{ label: "Warning lead time (days)", path: "prediction.days_to_failure", op: ">=", target: 7 },
|
|
253
|
+
{ label: "Insight grounded in sources", path: "grounded", op: "==", target: true },
|
|
254
|
+
{ label: "Planner approves every work order", path: "human_review", op: "==", target: true },
|
|
255
|
+
];
|
|
256
|
+
export function pdmTemplate(provider = "aws") {
|
|
257
|
+
const at = (x, y) => ({ x: x * 290, y: y * 190 });
|
|
258
|
+
const blocks = [
|
|
259
|
+
["sensors", "stream", at(0, 0)],
|
|
260
|
+
["history", "history", at(0, 1)],
|
|
261
|
+
["features", "features", at(1, 0)],
|
|
262
|
+
["training", "train", at(1, 1)],
|
|
263
|
+
["registry", "registry", at(2, 1)],
|
|
264
|
+
["endpoint", "predict", at(2, 0)],
|
|
265
|
+
["monitor", "monitor", at(3, 0)],
|
|
266
|
+
["insights", "agent", at(4, 0), { outputPosition: "bottom" }],
|
|
267
|
+
["guardrail", "guard", at(4, 1), { inputPosition: "top", outputPosition: "bottom" }],
|
|
268
|
+
["app", "tool", at(4, 2), { inputPosition: "top", outputPosition: "left" }],
|
|
269
|
+
["measures", "output", at(3, 2), { inputPosition: "right" }],
|
|
270
|
+
];
|
|
271
|
+
const label = (id, i) =>
|
|
272
|
+
id === "app" ? "Existing maintenance app" : id === "measures" ? "Success measures" : PDM_LABELS[provider][i];
|
|
273
|
+
const description = (id, i) =>
|
|
274
|
+
id === "app" ? "Client's work-order system; drafts orders for planners" : id === "measures" ? "Checks the PoC success measures" : PDM_DESCRIPTIONS[i];
|
|
275
|
+
const wires = [
|
|
276
|
+
["sensors", "features", "readings"],
|
|
277
|
+
["history", "features", "work orders"],
|
|
278
|
+
["history", "training", "labelled failures"],
|
|
279
|
+
["training", "registry", "candidate model"],
|
|
280
|
+
["features", "endpoint", "features"],
|
|
281
|
+
["registry", "endpoint", "approved model"],
|
|
282
|
+
["endpoint", "monitor", "risk score"],
|
|
283
|
+
["monitor", "insights", "monitored score"],
|
|
284
|
+
["insights", "guardrail", "draft insight"],
|
|
285
|
+
["guardrail", "app", "approved insight"],
|
|
286
|
+
["app", "measures", "draft work order"],
|
|
287
|
+
];
|
|
288
|
+
return {
|
|
289
|
+
version: 1,
|
|
290
|
+
revision: 1,
|
|
291
|
+
name: `Predictive maintenance · ${PROVIDERS[provider].name}`,
|
|
292
|
+
provider,
|
|
293
|
+
domain: "maintenance",
|
|
294
|
+
requirements:
|
|
295
|
+
"Predict equipment failures early enough to plan maintenance, explain each alert to engineers with evidence, and raise draft work orders in the client's existing maintenance app. Planners approve every order.",
|
|
296
|
+
nodes: blocks.map(([id, kind, position, sides = {}], i) => ({
|
|
297
|
+
id,
|
|
298
|
+
type: "resource",
|
|
299
|
+
position,
|
|
300
|
+
data: {
|
|
301
|
+
label: label(id, i),
|
|
302
|
+
kind,
|
|
303
|
+
provider: ["app", "measures"].includes(id) ? "tools" : provider,
|
|
304
|
+
description: description(id, i),
|
|
305
|
+
inputPosition: sides.inputPosition || "left",
|
|
306
|
+
outputPosition: sides.outputPosition || "right",
|
|
307
|
+
config: { region: "To be selected", classification: id === "history" ? "Confidential" : "Internal", timeout: 5000 },
|
|
308
|
+
origin: id === "app" ? "existing" : "proposed",
|
|
309
|
+
poc: id !== "monitor",
|
|
310
|
+
...(id === "measures" ? { measures: DEFAULT_MEASURES } : {}),
|
|
311
|
+
},
|
|
312
|
+
})),
|
|
313
|
+
edges: wires.map(([source, target, wire]) => ({
|
|
314
|
+
id: `${source}-${target}`,
|
|
315
|
+
source,
|
|
316
|
+
target,
|
|
317
|
+
type: "smoothstep",
|
|
318
|
+
label: wire,
|
|
319
|
+
})),
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export function checkProject(project) {
|
|
323
|
+
const issues = [];
|
|
324
|
+
// Comments are annotations: they never count as part of the system.
|
|
325
|
+
const notes = new Set(project.nodes.filter((n) => n.data.kind === "note").map((n) => n.id));
|
|
326
|
+
const p = notes.size ? { ...project, nodes: project.nodes.filter((n) => !notes.has(n.id)), edges: project.edges.filter((e) => !notes.has(e.source) && !notes.has(e.target)) } : project;
|
|
327
|
+
const ids = new Set(p.nodes.map((n) => n.id));
|
|
328
|
+
if (!p.nodes.length)
|
|
329
|
+
issues.push({
|
|
330
|
+
level: "error",
|
|
331
|
+
text: "Add a source and connect an end-to-end flow.",
|
|
332
|
+
});
|
|
333
|
+
if (!p.nodes.some((n) => SOURCE_KINDS.includes(n.data.kind)))
|
|
334
|
+
issues.push({ level: "error", text: "A data source is required." });
|
|
335
|
+
if (!p.nodes.some((n) => n.data.kind === "output"))
|
|
336
|
+
issues.push({
|
|
337
|
+
level: "error",
|
|
338
|
+
text: "Add a response block to verify the result.",
|
|
339
|
+
});
|
|
340
|
+
for (const e of p.edges)
|
|
341
|
+
if (!ids.has(e.source) || !ids.has(e.target))
|
|
342
|
+
issues.push({
|
|
343
|
+
level: "error",
|
|
344
|
+
text: "A connection points to a missing block.",
|
|
345
|
+
});
|
|
346
|
+
for (const n of p.nodes) {
|
|
347
|
+
if (n.data.kind === "resource")
|
|
348
|
+
issues.push({
|
|
349
|
+
level: "warning",
|
|
350
|
+
nodeId: n.id,
|
|
351
|
+
text: `${n.data.label} is an architecture reference with no fixture executor.`,
|
|
352
|
+
});
|
|
353
|
+
if (!p.edges.some((e) => e.source === n.id || e.target === n.id))
|
|
354
|
+
issues.push({
|
|
355
|
+
level: "error",
|
|
356
|
+
nodeId: n.id,
|
|
357
|
+
text: `${n.data.label} is disconnected.`,
|
|
358
|
+
});
|
|
359
|
+
if (!SOURCE_KINDS.includes(n.data.kind) && !p.edges.some((e) => e.target === n.id))
|
|
360
|
+
issues.push({
|
|
361
|
+
level: "error",
|
|
362
|
+
nodeId: n.id,
|
|
363
|
+
text: `${n.data.label} has no input.`,
|
|
364
|
+
});
|
|
365
|
+
if (SOURCE_KINDS.includes(n.data.kind) && p.edges.some((e) => e.target === n.id))
|
|
366
|
+
issues.push({
|
|
367
|
+
level: "error",
|
|
368
|
+
nodeId: n.id,
|
|
369
|
+
text: `${n.data.label} is a source and cannot accept an input.`,
|
|
370
|
+
});
|
|
371
|
+
if (n.data.kind !== "output" && !p.edges.some((e) => e.source === n.id))
|
|
372
|
+
issues.push({
|
|
373
|
+
level: "error",
|
|
374
|
+
nodeId: n.id,
|
|
375
|
+
text: `${n.data.label} has no downstream result.`,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
try {
|
|
379
|
+
orderProject(p);
|
|
380
|
+
} catch {
|
|
381
|
+
issues.push({
|
|
382
|
+
level: "error",
|
|
383
|
+
text: "The flow contains a cycle. This MVP supports directed flows.",
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
const guards = new Set(
|
|
387
|
+
p.nodes.filter((n) => n.data.kind === "guard").map((n) => n.id),
|
|
388
|
+
);
|
|
389
|
+
function unguarded(id, visited = new Set()) {
|
|
390
|
+
if (guards.has(id)) return false;
|
|
391
|
+
if (visited.has(id)) return false;
|
|
392
|
+
visited.add(id);
|
|
393
|
+
const n = p.nodes.find((n) => n.id === id);
|
|
394
|
+
if (SOURCE_KINDS.includes(n?.data.kind)) return true;
|
|
395
|
+
return p.edges
|
|
396
|
+
.filter((e) => e.target === id)
|
|
397
|
+
.some((e) => unguarded(e.source, new Set(visited)));
|
|
398
|
+
}
|
|
399
|
+
if (
|
|
400
|
+
p.nodes.filter((n) => n.data.kind === "output").some((n) => unguarded(n.id))
|
|
401
|
+
)
|
|
402
|
+
issues.push({
|
|
403
|
+
level: "error",
|
|
404
|
+
text: "Every source-to-response path must pass through an access policy block.",
|
|
405
|
+
});
|
|
406
|
+
issues.push({
|
|
407
|
+
level: "info",
|
|
408
|
+
text: "Cloud resources are design components. Runs use local fixtures; no cloud APIs are called.",
|
|
409
|
+
});
|
|
410
|
+
return issues;
|
|
411
|
+
}
|
|
412
|
+
export function orderProject(p) {
|
|
413
|
+
const remaining = new Set(p.nodes.map((n) => n.id)),
|
|
414
|
+
result = [];
|
|
415
|
+
while (remaining.size) {
|
|
416
|
+
const next = p.nodes.filter(
|
|
417
|
+
(n) =>
|
|
418
|
+
remaining.has(n.id) &&
|
|
419
|
+
!p.edges.some((e) => e.target === n.id && remaining.has(e.source)),
|
|
420
|
+
);
|
|
421
|
+
if (!next.length) throw Error("cycle");
|
|
422
|
+
for (const n of next) {
|
|
423
|
+
result.push(n);
|
|
424
|
+
remaining.delete(n.id);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return result;
|
|
428
|
+
}
|
|
429
|
+
function readPath(value, path) {
|
|
430
|
+
return path.split(".").reduce((v, key) => (v == null ? undefined : v[key]), value);
|
|
431
|
+
}
|
|
432
|
+
export function checkMeasures(measures = [], payload = {}) {
|
|
433
|
+
return measures.map((m) => {
|
|
434
|
+
const value = readPath(payload, m.path);
|
|
435
|
+
const pass =
|
|
436
|
+
m.op === ">=" ? typeof value === "number" && value >= m.target
|
|
437
|
+
: m.op === "<=" ? typeof value === "number" && value <= m.target
|
|
438
|
+
: value === m.target;
|
|
439
|
+
return { label: m.label, value: value ?? null, target: `${m.op} ${m.target}`, pass };
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
// Predictive maintenance fixtures. Deterministic, local, no cloud calls.
|
|
443
|
+
function maintenanceBlock(kind, n, input, scenario) {
|
|
444
|
+
if (kind === "stream")
|
|
445
|
+
return {
|
|
446
|
+
asset_id: "pump-P07",
|
|
447
|
+
window: "last 14 days",
|
|
448
|
+
coverage: scenario === "sensor-dropout" ? 0.55 : 0.98,
|
|
449
|
+
readings: {
|
|
450
|
+
vibration_rms: scenario === "sensor-dropout" ? null : 7.1,
|
|
451
|
+
temperature_c: 82,
|
|
452
|
+
pressure_bar: 5.2,
|
|
453
|
+
},
|
|
454
|
+
authorised: scenario !== "denied",
|
|
455
|
+
source: "local-fixture",
|
|
456
|
+
};
|
|
457
|
+
if (kind === "history")
|
|
458
|
+
return {
|
|
459
|
+
asset_id: "pump-P07",
|
|
460
|
+
hours_since_service: 1400,
|
|
461
|
+
prior_failures: [{ work_order: "WO-1182", cause: "bearing wear", date: "2025-03-11" }],
|
|
462
|
+
};
|
|
463
|
+
if (kind === "train")
|
|
464
|
+
return {
|
|
465
|
+
model_version: "pdm-risk-v3",
|
|
466
|
+
training: {
|
|
467
|
+
precision: scenario === "weak-model" ? 0.72 : 0.84,
|
|
468
|
+
recall: 0.78,
|
|
469
|
+
dataset: "maintenance history 2019–2026 (fixture)",
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
if (!input) throw Error("No input payload received.");
|
|
473
|
+
if (kind === "features") {
|
|
474
|
+
if (!input.readings) throw Error("Feature pipeline needs sensor readings.");
|
|
475
|
+
if (input.coverage < 0.8)
|
|
476
|
+
throw Error(`Data quality gate: sensor coverage ${Math.round(input.coverage * 100)}% is below the 80% minimum.`);
|
|
477
|
+
return {
|
|
478
|
+
...input,
|
|
479
|
+
features: {
|
|
480
|
+
vibration_trend_14d: 0.35,
|
|
481
|
+
temperature_delta_c: 9,
|
|
482
|
+
hours_since_service: input.hours_since_service ?? null,
|
|
483
|
+
similar_past_failures: input.prior_failures?.length ?? 0,
|
|
484
|
+
},
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
if (kind === "registry") {
|
|
488
|
+
if (!input.model_version) throw Error("Registry needs a trained model version.");
|
|
489
|
+
return { ...input, approved_model: input.model_version, model_card: "fixture model card" };
|
|
490
|
+
}
|
|
491
|
+
if (kind === "predict") {
|
|
492
|
+
if (!input.features) throw Error("Model endpoint needs features. Connect the feature pipeline.");
|
|
493
|
+
if (!input.approved_model) throw Error("No approved model version. Connect the model registry.");
|
|
494
|
+
return {
|
|
495
|
+
...input,
|
|
496
|
+
prediction: { failure_probability: 0.71, days_to_failure: 12, failure_mode: "bearing wear" },
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
if (kind === "monitor") {
|
|
500
|
+
if (!input.prediction) throw Error("Monitor needs predictions to watch.");
|
|
501
|
+
if (scenario === "drift")
|
|
502
|
+
throw Error("Drift detected: vibration feature PSI 0.31 exceeds 0.20. Retrain before trusting new scores.");
|
|
503
|
+
return { ...input, drift: { psi: 0.07, status: "stable" } };
|
|
504
|
+
}
|
|
505
|
+
if (kind === "agent") {
|
|
506
|
+
if (!input.prediction) throw Error("Insights need a risk score. Connect the model endpoint.");
|
|
507
|
+
const grounded = scenario !== "ungrounded";
|
|
508
|
+
return {
|
|
509
|
+
...input,
|
|
510
|
+
answer: grounded
|
|
511
|
+
? `Pump P07: ${Math.round(input.prediction.failure_probability * 100)}% risk of ${input.prediction.failure_mode} within about ${input.prediction.days_to_failure} days. Vibration is up 35% over 14 days and temperature is 9 °C above baseline; the same pattern preceded WO-1182. Inspect at the next planned stop.`
|
|
512
|
+
: "Pump P07 will probably fail soon; replace it this week.",
|
|
513
|
+
evidence: grounded ? ["sensor.vibration_rms trend", "WO-1182 bearing wear", "maintenance manual §4.2"] : [],
|
|
514
|
+
grounded,
|
|
515
|
+
generated_by: "local-template (no LLM call)",
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
if (kind === "guard") {
|
|
519
|
+
if (!input.authorised) throw Error("Access denied: this fixture does not authorise the request.");
|
|
520
|
+
if (input.answer && !input.grounded)
|
|
521
|
+
throw Error("Guardrail blocked: the insight cites no maintenance records or manuals.");
|
|
522
|
+
return { ...input, policy: "passed" };
|
|
523
|
+
}
|
|
524
|
+
if (kind === "tool") {
|
|
525
|
+
if (scenario === "tool-error") throw Error("Existing maintenance app unavailable: work-order API timed out.");
|
|
526
|
+
return {
|
|
527
|
+
...input,
|
|
528
|
+
work_order: { id: "WO-DRAFT-2207", status: "draft", owner: "maintenance planner" },
|
|
529
|
+
human_review: true,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
if (kind === "output") {
|
|
533
|
+
if (input.policy !== "passed") throw Error("Assertion failed: access and grounding policy must pass.");
|
|
534
|
+
const results = checkMeasures(n.data.measures, input);
|
|
535
|
+
const missed = results.filter((r) => !r.pass);
|
|
536
|
+
if (missed.length)
|
|
537
|
+
throw Error(`Success measure not met: ${missed.map((r) => `${r.label} = ${r.value} (target ${r.target})`).join("; ")}.`);
|
|
538
|
+
return { work_order: input.work_order, answer: input.answer, measures: results, status: "passed" };
|
|
539
|
+
}
|
|
540
|
+
throw Error("This block has no fixture for predictive maintenance.");
|
|
541
|
+
}
|
|
542
|
+
const MAINTENANCE_ONLY = ["stream", "history", "features", "train", "registry", "monitor"];
|
|
543
|
+
export function executeBlock(n, input, scenario = "happy") {
|
|
544
|
+
const kind = n.data.kind;
|
|
545
|
+
if (kind === "resource")
|
|
546
|
+
throw Error(
|
|
547
|
+
"Architecture reference has no executor. Assign a fixture behaviour explicitly.",
|
|
548
|
+
);
|
|
549
|
+
if (MAINTENANCE_ONLY.includes(kind) || input?.asset_id)
|
|
550
|
+
return maintenanceBlock(kind, n, input, scenario);
|
|
551
|
+
if (kind === "source")
|
|
552
|
+
return {
|
|
553
|
+
customer_id: "sample-1042",
|
|
554
|
+
usage_drop: scenario === "missing" ? null : 0.42,
|
|
555
|
+
support_tickets: 3,
|
|
556
|
+
authorised: scenario !== "denied",
|
|
557
|
+
source: "local-fixture",
|
|
558
|
+
};
|
|
559
|
+
if (!input) throw Error("No input payload received.");
|
|
560
|
+
if (kind === "predict") {
|
|
561
|
+
if (typeof input.usage_drop !== "number")
|
|
562
|
+
throw Error("Schema check failed: usage_drop must be a number.");
|
|
563
|
+
return {
|
|
564
|
+
...input,
|
|
565
|
+
churn_probability: Number(
|
|
566
|
+
Math.min(
|
|
567
|
+
1,
|
|
568
|
+
0.2 + input.usage_drop + input.support_tickets * 0.06,
|
|
569
|
+
).toFixed(2),
|
|
570
|
+
),
|
|
571
|
+
model: "deterministic-test-fixture",
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
if (kind === "agent") {
|
|
575
|
+
if (typeof input.churn_probability !== "number")
|
|
576
|
+
throw Error(
|
|
577
|
+
"Agent needs a prediction. Connect the prediction service first.",
|
|
578
|
+
);
|
|
579
|
+
return {
|
|
580
|
+
...input,
|
|
581
|
+
answer: `Customer ${input.customer_id} has a simulated churn score of ${Math.round(input.churn_probability * 100)}%. The fixture uses a ${Math.round(input.usage_drop * 100)}% usage drop and ${input.support_tickets} support tickets. This is a test explanation, not a causal conclusion.`,
|
|
582
|
+
evidence: ["fixture.usage_drop", "fixture.support_tickets"],
|
|
583
|
+
generated_by: "local-template (no LLM call)",
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
if (kind === "guard") {
|
|
587
|
+
if (!input.authorised)
|
|
588
|
+
throw Error(
|
|
589
|
+
"Access denied: this fixture does not authorise the request.",
|
|
590
|
+
);
|
|
591
|
+
return { ...input, policy: "passed" };
|
|
592
|
+
}
|
|
593
|
+
if (kind === "output") {
|
|
594
|
+
if (input.policy !== "passed")
|
|
595
|
+
throw Error("Assertion failed: access policy must pass.");
|
|
596
|
+
if (!input.answer || !input.evidence?.length)
|
|
597
|
+
throw Error(
|
|
598
|
+
"Assertion failed: response and supporting evidence are required.",
|
|
599
|
+
);
|
|
600
|
+
return {
|
|
601
|
+
answer: input.answer,
|
|
602
|
+
evidence: input.evidence,
|
|
603
|
+
assertions: {
|
|
604
|
+
response_present: true,
|
|
605
|
+
evidence_present: true,
|
|
606
|
+
access_approved: true,
|
|
607
|
+
},
|
|
608
|
+
status: "passed",
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
if (scenario === "tool-error")
|
|
612
|
+
throw Error("Simulated tool failure: upstream API unavailable.");
|
|
613
|
+
return { ...input, tool_result: "Local tool fixture succeeded" };
|
|
614
|
+
}
|
|
615
|
+
export function validateImport(p) {
|
|
616
|
+
if (
|
|
617
|
+
!p ||
|
|
618
|
+
p.version !== 1 ||
|
|
619
|
+
!Number.isInteger(p.revision) ||
|
|
620
|
+
p.revision < 1 ||
|
|
621
|
+
typeof p.name !== "string" ||
|
|
622
|
+
!Array.isArray(p.nodes) ||
|
|
623
|
+
!Array.isArray(p.edges) ||
|
|
624
|
+
p.nodes.length > 200 ||
|
|
625
|
+
p.edges.length > 600
|
|
626
|
+
)
|
|
627
|
+
throw Error("Unsupported or oversized project file.");
|
|
628
|
+
if(String(p.requirements||"").length>64000)throw Error("Project requirements exceed 64,000 characters; no content was truncated.");
|
|
629
|
+
if(p.extensions?.architectureWork!==undefined)validateArchitectureWork(p.extensions.architectureWork);
|
|
630
|
+
validateStateCustody(p.extensions?.terraformState);
|
|
631
|
+
validateExternalReferences(p);
|
|
632
|
+
approvalProfiles(p);
|
|
633
|
+
const ids = new Set();
|
|
634
|
+
for (const n of p.nodes) {
|
|
635
|
+
if (
|
|
636
|
+
typeof n.id !== "string" ||
|
|
637
|
+
ids.has(n.id) ||
|
|
638
|
+
!n.data ||
|
|
639
|
+
!Object.hasOwn(PROVIDERS, n.data.provider) ||
|
|
640
|
+
!KINDS.includes(n.data.kind) ||
|
|
641
|
+
typeof n.data.label !== "string" ||
|
|
642
|
+
n.data.label.length > (n.data.kind === "note" ? 16000 : 150) ||
|
|
643
|
+
!Number.isFinite(n.position?.x) ||
|
|
644
|
+
!Number.isFinite(n.position?.y)
|
|
645
|
+
)
|
|
646
|
+
throw Error("Invalid component in project.");
|
|
647
|
+
if(String(n.data.description||"").length>16000)throw Error("Component description exceeds 16,000 characters; split it into linked requirements. Nothing was truncated.");
|
|
648
|
+
if(n.data.topologyGroup!=null&&(typeof n.data.topologyGroup!=="string"||n.data.topologyGroup.length>100))throw Error("Topology responsibility names must have at most 100 characters; no content was truncated.");
|
|
649
|
+
validateDeploymentOwnership(n.data);
|
|
650
|
+
ids.add(n.id);
|
|
651
|
+
}
|
|
652
|
+
const edgeIds = new Set();
|
|
653
|
+
for (const e of p.edges) {
|
|
654
|
+
if (
|
|
655
|
+
typeof e.id !== "string" ||
|
|
656
|
+
edgeIds.has(e.id) ||
|
|
657
|
+
!ids.has(e.source) ||
|
|
658
|
+
!ids.has(e.target) ||
|
|
659
|
+
e.source === e.target
|
|
660
|
+
)
|
|
661
|
+
throw Error("Invalid connection in project.");
|
|
662
|
+
edgeIds.add(e.id);
|
|
663
|
+
}
|
|
664
|
+
return {
|
|
665
|
+
...p,
|
|
666
|
+
...cleanEngagement(p),
|
|
667
|
+
nodes: p.nodes.map((n) => ({
|
|
668
|
+
id: n.id,
|
|
669
|
+
type: "resource",
|
|
670
|
+
position: n.position,
|
|
671
|
+
data: {
|
|
672
|
+
inputPosition: ["left", "right", "top", "bottom"].includes(
|
|
673
|
+
n.data.inputPosition,
|
|
674
|
+
)
|
|
675
|
+
? n.data.inputPosition
|
|
676
|
+
: "left",
|
|
677
|
+
outputPosition: ["left", "right", "top", "bottom"].includes(
|
|
678
|
+
n.data.outputPosition,
|
|
679
|
+
)
|
|
680
|
+
? n.data.outputPosition
|
|
681
|
+
: "right",
|
|
682
|
+
label: n.data.label,
|
|
683
|
+
provider: n.data.provider,
|
|
684
|
+
kind: n.data.kind,
|
|
685
|
+
description: String(n.data.description || ""),
|
|
686
|
+
config: {
|
|
687
|
+
...runtimeSettings(n.data.config),
|
|
688
|
+
region: String(n.data.config?.region || "To be selected").slice(
|
|
689
|
+
0,
|
|
690
|
+
100,
|
|
691
|
+
),
|
|
692
|
+
classification: String(
|
|
693
|
+
n.data.config?.classification || "Internal",
|
|
694
|
+
).slice(0, 100),
|
|
695
|
+
timeout: 5000,
|
|
696
|
+
},
|
|
697
|
+
...(n.data.approvalProfile!=null ? {approvalProfile:structuredClone(n.data.approvalProfile)}:{}),
|
|
698
|
+
...(n.data.topologyGroup ? {topologyGroup:String(n.data.topologyGroup)}:{}),
|
|
699
|
+
...(["reference","create"].includes(n.data.deploymentMode)?{deploymentMode:n.data.deploymentMode}:{}),
|
|
700
|
+
origin: String(n.data.origin || "proposed").slice(0, 100),
|
|
701
|
+
...(n.data.poc ? { poc: true } : {}),
|
|
702
|
+
...(["public-catalog-editor","cloud-storage-principal","aws-iam-principal","aws-bedrock-model","normalized-source-contract","web-browser","existing-service"].includes(n.data.binding) ? { binding: n.data.binding } : {}),
|
|
703
|
+
...(["approval-workflow","invoice-workflow","public-faq-app","ibm-structured-app","gcp-structured-app","azure-structured-app","container-service","private-object-storage","rag-web-app","rag-user-pool","bounded-keyword-rag","iam-rag-api","bounded-rag-catalog","text-statistics","bedrock-summary","bedrock-structured","structured-api","structured-web-app","structured-user-pool","async-word-count","sqs-standard","sqs-dead-letter","word-count-results"].includes(n.data.implementation) ? { implementation: n.data.implementation } : {}),
|
|
704
|
+
...(ROLES.includes(n.data.role) ? { role: n.data.role } : {}),
|
|
705
|
+
...(Array.isArray(n.data.measures) ? { measures: cleanMeasures(n.data.measures) } : {}),
|
|
706
|
+
...(n.data.service
|
|
707
|
+
? { service: String(n.data.service).slice(0, 150) }
|
|
708
|
+
: {}),
|
|
709
|
+
...(n.data.category
|
|
710
|
+
? { category: String(n.data.category).slice(0, 150) }
|
|
711
|
+
: {}),
|
|
712
|
+
...(n.data.metadata
|
|
713
|
+
? {
|
|
714
|
+
metadata: {
|
|
715
|
+
columns: Array.isArray(n.data.metadata.columns)
|
|
716
|
+
? n.data.metadata.columns
|
|
717
|
+
.slice(0, 100)
|
|
718
|
+
.map((c) => ({
|
|
719
|
+
name: String(c.name || "").slice(0, 100),
|
|
720
|
+
type: String(c.type || "").slice(0, 100),
|
|
721
|
+
isPrimaryKey: !!c.isPrimaryKey,
|
|
722
|
+
isForeignKey: !!c.isForeignKey,
|
|
723
|
+
}))
|
|
724
|
+
: [],
|
|
725
|
+
},
|
|
726
|
+
}
|
|
727
|
+
: {}),
|
|
728
|
+
},
|
|
729
|
+
})),
|
|
730
|
+
edges: p.edges.map((e) => ({
|
|
731
|
+
id: e.id,
|
|
732
|
+
source: e.source,
|
|
733
|
+
target: e.target,
|
|
734
|
+
type: "smoothstep",
|
|
735
|
+
label: String(e.label || "data").slice(0, 80),
|
|
736
|
+
...(["storage-object-admin","s3-read", "s3-read-write", "lambda-invoke", "api-invoke"].includes(e.access) ? { access: e.access } : {}),
|
|
737
|
+
...(["approved-accounting-api","public-catalog-edit","browser-https","web-rag-api","oauth-pkce","jwt-authorizer","source-catalog-sync","http-api-lambda","lambda-catalog-read","bedrock-converse","s3-object-created","sqs-lambda","lambda-s3-read","lambda-dynamodb-write","sqs-redrive"].includes(e.integration) ? { integration: e.integration } : {}),
|
|
738
|
+
})),
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
export function propose(message, p) {
|
|
742
|
+
const text = message.toLowerCase();
|
|
743
|
+
const provider = text.includes("azure")
|
|
744
|
+
? "azure"
|
|
745
|
+
: /google|gcp/.test(text)
|
|
746
|
+
? "gcp"
|
|
747
|
+
: /ibm|watson/.test(text)
|
|
748
|
+
? "ibm"
|
|
749
|
+
: /aws|bedrock|sagemaker/.test(text)
|
|
750
|
+
? "aws"
|
|
751
|
+
: null;
|
|
752
|
+
if (/compare|options|all (four|4)|which cloud/.test(text))
|
|
753
|
+
return {
|
|
754
|
+
action: "options",
|
|
755
|
+
body: "Opening Options. Score the current approach, AWS, Azure, Google Cloud and IBM on cost, risk, scalability and security, then record the recommendation as a decision. Use “Show design” on any cloud to review its architecture as a proposal.",
|
|
756
|
+
};
|
|
757
|
+
if (/cost|price|spend/.test(text))
|
|
758
|
+
return {
|
|
759
|
+
body: "Main cost drivers for this design: always-on model endpoints, GenAI tokens per insight, sensor ingestion volume and feature storage. Compare them per cloud in Options; local patterns have no live pricing, so treat any figures as estimates to confirm with the client's account team.",
|
|
760
|
+
};
|
|
761
|
+
if (provider && (/maint|pdm|sensor|failure/.test(text) || p.domain === "maintenance"))
|
|
762
|
+
return {
|
|
763
|
+
baseRevision: p.revision,
|
|
764
|
+
title: `Predictive maintenance on ${PROVIDERS[provider].name}`,
|
|
765
|
+
body: `Draft a ${PROVIDERS[provider].name} predictive maintenance architecture: sensor ingestion and maintenance history → features → training, registry and endpoint → drift monitoring → GenAI insights behind a guardrail → draft work orders in the client's existing app. Service names are design choices to validate with the client.`,
|
|
766
|
+
next: pdmTemplate(provider),
|
|
767
|
+
};
|
|
768
|
+
if (provider)
|
|
769
|
+
return {
|
|
770
|
+
baseRevision: p.revision,
|
|
771
|
+
title: `Explore a ${PROVIDERS[provider].name} architecture`,
|
|
772
|
+
body: `Replace the canvas with an illustrative ${PROVIDERS[provider].name} pattern: data → prediction → assistant → policy → response. This is a design alternative, not a validated service integration.`,
|
|
773
|
+
next: template(provider),
|
|
774
|
+
};
|
|
775
|
+
if (/tool|api/.test(text) && p.domain !== "maintenance") {
|
|
776
|
+
const next = structuredClone(p);
|
|
777
|
+
const target = next.nodes.find((n) => n.data.kind === "agent");
|
|
778
|
+
if (!target)
|
|
779
|
+
return {
|
|
780
|
+
body: "Add an assistant block first, then I can insert a tool before it.",
|
|
781
|
+
};
|
|
782
|
+
const id = `tool-${crypto.randomUUID()}`;
|
|
783
|
+
next.nodes.push({
|
|
784
|
+
id,
|
|
785
|
+
type: "resource",
|
|
786
|
+
position: { x: 645, y: -40 },
|
|
787
|
+
data: {
|
|
788
|
+
kind: "tool",
|
|
789
|
+
provider: "tools",
|
|
790
|
+
label: "Business API",
|
|
791
|
+
description: "A local fixture for a business tool",
|
|
792
|
+
config: {
|
|
793
|
+
region: "Local fixture",
|
|
794
|
+
classification: "Internal",
|
|
795
|
+
timeout: 5000,
|
|
796
|
+
},
|
|
797
|
+
origin: "proposed",
|
|
798
|
+
},
|
|
799
|
+
});
|
|
800
|
+
const incoming = next.edges.find((e) => e.target === target.id);
|
|
801
|
+
if (incoming) {
|
|
802
|
+
next.edges = next.edges.filter((e) => e.id !== incoming.id);
|
|
803
|
+
next.edges.push({
|
|
804
|
+
id: `${id}-in`,
|
|
805
|
+
source: incoming.source,
|
|
806
|
+
target: id,
|
|
807
|
+
type: "smoothstep",
|
|
808
|
+
label: "request",
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
next.edges.push({
|
|
812
|
+
id: `${id}-out`,
|
|
813
|
+
source: id,
|
|
814
|
+
target: target.id,
|
|
815
|
+
type: "smoothstep",
|
|
816
|
+
label: "tool context",
|
|
817
|
+
});
|
|
818
|
+
return {
|
|
819
|
+
baseRevision: p.revision,
|
|
820
|
+
title: "Connect a business tool",
|
|
821
|
+
body: "Insert a REST API fixture before the assistant. In Staging / Test, choose “Tool unavailable” to see the failure propagate.",
|
|
822
|
+
next,
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
if (/review|risk|secur|valid/.test(text))
|
|
826
|
+
return {
|
|
827
|
+
body: `Local review: ${checkProject(p).filter((i) => i.level === "error").length} structural issues. Before real deployment, verify identity, network boundaries, data residency, endpoint contracts, and model evaluation. Cloud documentation and pricing are not connected in this MVP.`,
|
|
828
|
+
};
|
|
829
|
+
if (/test|run|fail|poc|proof/.test(text) && p.domain === "maintenance")
|
|
830
|
+
return {
|
|
831
|
+
body: "Open PoC and press Run. Try Sensor dropout, Weak model, Drift, Ungrounded insight or App unavailable to show stakeholders how each failure is caught. The success measures on the last block decide whether the PoC passes.",
|
|
832
|
+
};
|
|
833
|
+
if (/test|run|fail/.test(text))
|
|
834
|
+
return {
|
|
835
|
+
body: "Open Staging / Test and run a sample. Try “Missing input field” or “Access denied”. Click any executed block to inspect its input, output and error. Add a business API to test tool failures.",
|
|
836
|
+
};
|
|
837
|
+
return {
|
|
838
|
+
body: "I’m the guided demo assistant; I use local patterns, not a live language model. I can draft predictive maintenance on AWS, Azure, Google Cloud or IBM, compare the four clouds, review risks, or explain the PoC tests. Connect a model in Connections for open-ended design.",
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
export function makePlan(p, run, environment) {
|
|
842
|
+
const tested = run?.status === "passed" && run.revision === p.revision;
|
|
843
|
+
return {
|
|
844
|
+
kind: "architecture-plan-only",
|
|
845
|
+
environment,
|
|
846
|
+
project: p.name,
|
|
847
|
+
revision: p.revision,
|
|
848
|
+
generatedAt: new Date().toISOString(),
|
|
849
|
+
simulationPassed: tested,
|
|
850
|
+
liveDeploymentEnabled: false,
|
|
851
|
+
pocScope: p.nodes.filter((n) => n.data.poc).map((n) => n.data.label),
|
|
852
|
+
blocks: p.nodes.map((n) => ({ id: n.id, ...n.data })),
|
|
853
|
+
connections: p.edges,
|
|
854
|
+
blockers: [
|
|
855
|
+
...(!tested ? ["Pass a simulation against the current revision."] : []),
|
|
856
|
+
"Connect a cloud account and select target regions.",
|
|
857
|
+
"Implement and verify provider-specific deployment adapters.",
|
|
858
|
+
"Review IAM, networking, secrets, data residency and costs.",
|
|
859
|
+
"Obtain staging integration-test results before production.",
|
|
860
|
+
],
|
|
861
|
+
note: "This is not executable infrastructure code or evidence of a deployed environment.",
|
|
862
|
+
};
|
|
863
|
+
}
|