# Multicloud Placement Advisor Helps you understand where a workload could run across multiple cloud providers. An AI-based advisor guides you through a structured assessment of the workload's people, process and technology, then analyses your answers with proven [mathematical methods](./docs/reference/calculation-methods.md) to give you two findings: how ready the workload is for multicloud, and which providers it is most strongly tied to. For the full architecture guide, see [Architecture](./docs/reference/architecture.md). > [!IMPORTANT] > Generative AI can make mistakes. Check the AI's interpretation in Review & Adjust, and the findings, before > acting on them: they inform a placement decision, they do not make it. Each analysis uses Amazon Bedrock, which > is billed to your account (see [Cost](#cost)). See the [AWS Responsible AI Policy](https://aws.amazon.com/ai/responsible-ai/policy/). > [!WARNING] > **Disclaimer.** This application is provided as a deployable solution for internal use and illustration purposes. > It is designed to be deployed within your own AWS environment. Amazon Cognito authentication is enabled by default. > Unauthenticated public access is available only through an explicit opt-in at deploy time. If you choose > unauthenticated public access, you must implement access controls appropriate to your organisation's security > policies. > > The application represents a baseline implementation and may not address all security considerations for your > specific environment. Review it against your own requirements before any use. --- ## Contents - [Background](#background) - [Quick start](#quick-start) - [Install](#install) - [Usage](#usage): [deploy to an AWS account](#deploy-to-an-aws-account), [run locally](#run-locally), [remove a deployment](#remove-a-deployment), [inputs and outputs](#inputs-and-outputs) - [Security](#security): [access control](#access-control), [stack controls](#stack-controls), [threat model](#self-deployed-threat-model) - [Understanding the Results](#understanding-the-results) · [Scoring Model](#scoring-model) · [Cost](#cost) · [API Reference](#api-reference) - [Project Structure](#project-structure) · [Documentation](#documentation) · [Contributing](#contributing) · [License](#license) --- ## Background ### How It Works The tool answers two questions about a workload: **readiness**, can it move? And **gravity**, which provider is it pulled towards? Every score comes from proven [mathematical methods](./docs/reference/calculation-methods.md), not from the AI. 1. **Workload context.** Describe the workload, where it runs today and the providers it could run on, and set the priority of each of your five strategic drivers. 2. **Assessment.** Answer questions about the people, process and technology realities of the workload and your organisation. The AI checks each answer and asks follow-up questions where more detail is needed. 3. **Review & Adjust.** The AI proposes the scoring inputs from your answers, with its rationale. You review each one and change any you disagree with. 4. **Analysis.** The scoring engine calculates readiness and provider gravity, and shows how every score is calculated. A chat answers questions about the results. 5. **Findings Summary.** The key findings in one view: the highest gravity provider, how firm its lead is, readiness and migration complexity. It reports what your evidence shows; the decision is yours. The AI proposes, you review, the maths scores, and you make the call. See [How the AI Is Used](./docs/explanation/ai/how-the-ai-is-used.md) and the [Findings Summary](./docs/explanation/findings-summary.md). --- ## Quick start New to the tool? These four steps take you from nothing to your first results. 1. **Get the code and the prerequisites.** See [Install](#install). 2. **Run it.** Either try it on your own machine with [Run locally](#run-locally), or deploy the full app, with login, to your AWS account with [Deploy to an AWS account](#deploy-to-an-aws-account). 3. **Open it and run your first assessment.** The [User Guide](./docs/guides/user-guide.md) walks you through every stage, from describing your workload to reading the Findings Summary. 4. **Understand and check the results.** [Multicloud Readiness](./docs/explanation/readiness.md) and [Gravity](./docs/explanation/gravity.md) explain how the results are worked out, and [How the Tool Is Tested](./docs/testing/how-the-tool-is-tested.md) explains how the tool's answers are proved. When you are done, [Remove a deployment](#remove-a-deployment) deletes everything a deployment created. --- ## Install The app is installed and run with Python scripts that work the same on **Windows, macOS and Linux** (no Bash or WSL needed on Windows). You need: - Python 3.13 or newer (the Lambda runtime is 3.13), Node.js 20 or newer with npm, and the AWS CLI v2 - An AWS account and credentials with access to the AI model's inference profile in your region (see [Deploy to an AWS account](#deploy-to-an-aws-account); used by analysis in both modes) - To deploy: IAM permissions for CloudFormation, S3, Lambda, API Gateway, CloudFront, KMS, IAM, Logs/CloudWatch, DynamoDB, Bedrock, Cognito, CodeBuild and STS ```bash git clone https://github.com//MultiCloud-Placement-Agent.git cd MultiCloud-Placement-Agent ``` On Windows, use `py` in place of `python3` in the commands below, and `\` in paths. --- ## Usage There are two ways to run it: [**deploy to an AWS account**](#deploy-to-an-aws-account) (the full app, with login, for real use) or [**run locally**](#run-locally) (the same web interface on your machine, to try it or develop it). Full detail for both is in the [Deployment Guide](./docs/guides/deployment.md). ### Deploy to an AWS account The application deploys as one regional CloudFormation stack. The repository-tested allowlist is: | AWS deployment region | Geography | Inference-profile prefix | Non-US name suffix | |---|---|---|---| | `us-east-1` | US | `us` | none (`us-east-1` names have no suffix) | | `eu-west-1` | EU | `eu` | `euw1` | | `ap-southeast-2` | AU (Australia) | `au` | `aps2` | | `ap-northeast-1` | JP (Japan) | `jp` | `apn1` | The deploy calls the model through `.`, for example `eu.anthropic.claude-sonnet-4-6` for the default model in `eu-west-1`. Model and inference-profile availability can change. Treat this table as the repository-tested allowlist, not a guarantee of current AWS availability; revalidate access in the target account and region before deployment. Regional geography inference is the default. `--allow-global-inference` deliberately selects the model's global inference profile, which can route inference outside the deployment region's geography. #### Models tested The following models are tested as working with the Multicloud Placement Advisor. Choose one with `--model`, giving its Bedrock ID without the `us.` prefix (for example `--model anthropic.claude-opus-4-8`); the deploy calls it through the region's geography profile. The deploy accepts any Claude Sonnet, Claude Opus or GPT model, and the stack's IAM role allows those three families, so a new version needs no template change. A model that is not in this table deploys, and the deploy summary marks it untested: run the [AI evals](docs/testing/running-the-tests.md#running-the-live-ai-evals) before you rely on its results. | Model | Bedrock ID | |---|---| | Claude Sonnet 4.6 (the default) | `us.anthropic.claude-sonnet-4-6` | | Claude Sonnet 4.5 | `us.anthropic.claude-sonnet-4-5-20250929-v1:0` | | Claude Sonnet 5 | `us.anthropic.claude-sonnet-5` | | Claude Sonnet 5.5 | `us.anthropic.claude-sonnet-5-5` | | Claude Opus 4.6 | `us.anthropic.claude-opus-4-6-v1` | | Claude Opus 4.7 | `us.anthropic.claude-opus-4-7` | | Claude Opus 4.8 | `us.anthropic.claude-opus-4-8` | | Claude Opus 5 | `us.anthropic.claude-opus-5` | | GPT-5.4 | `us.openai.gpt-5.4` | | GPT-5.5 | `us.openai.gpt-5.5` | | GPT-5.6 Luna | `us.openai.gpt-5.6-luna` | | GPT-5.6 Sol | `us.openai.gpt-5.6-sol` | | GPT-5.6 Terra | `us.openai.gpt-5.6-terra` | | GPT-6 Astra | `us.openai.gpt-6-astra` | | GPT-6 Luna | `us.openai.gpt-6-luna` | | GPT-6 Sol | `us.openai.gpt-6-sol` | | GPT-6.1 Sol | `us.openai.gpt-6.1-sol` | | GPT-6.1 Terra | `us.openai.gpt-6.1-terra` | Not every model is offered in every geography. With regional inference (the default), the deploy calls the model through the region's geography profile, and Bedrock offers these models through these profiles: | Models | US | EU | AU | JP | |---|---|---|---|---| | Claude Sonnet 4.6, Sonnet 4.5, Opus 4.7, Opus 4.8 | Yes | Yes | Yes | Yes | | Claude Sonnet 5, Sonnet 5.5, Opus 4.6, Opus 5 | Yes | Yes | Yes | No | | Every GPT model in the table | Yes | No | No | No | Every model in the table also has a global profile, available from all four regions. To use a model outside its geographies, deploy with `--allow-global-inference`, which can route inference outside the region's geography. Bedrock adds profiles over time, so the deploy checks that the model's profile exists in the region before it changes anything, and stops if it does not. #### 1. Authenticate to AWS Authenticate with your organisation's approved AWS CLI method. For an IAM Identity Center default configuration: ```bash aws sso login aws sts get-caller-identity ``` By default the scripts use the active AWS credential chain (`AWS_PROFILE`/`AWS_DEFAULT_PROFILE` when set). Pass `--profile NAME` to select a profile explicitly. Confirm the returned account and ARN independently. Deployment also performs a read-only `bedrock get-inference-profile` preflight for the selected regional or global profile before it mutates AWS resources. #### 2. Deploy From the repository root: ```bash python3 scripts/deploy.py dev mcp-agent us-east-1 --user-email owner@example.com ``` Other regions: replace `us-east-1` with `eu-west-1`, `ap-southeast-2` or `ap-northeast-1`. Cognito authentication is enabled by default. With `--user-email`, a missing user is created and Cognito sends the invitation; an existing `FORCE_CHANGE_PASSWORD` user gets a `RESEND`, and `CONFIRMED` and other statuses are left unchanged. This provisions a login only; `model-admins` membership is a separate administrator action (see [Access control](#access-control)). The script supports only `dev`, prints the credential source, account, ARN, region, inference geography/mode/profile, login email and authentication mode before it changes anything, and fails closed on unknown arguments. - **AI model:** add `--model ` to use another Claude Sonnet, Claude Opus or GPT model instead of the default (see [Models tested](#models-tested)). A deploy without `--model` uses the default, so pass it on every deploy of a stack that uses another model; see [Choose the AI model](docs/guides/deployment.md#choose-the-ai-model). - **Global inference:** add `--allow-global-inference` to deliberately use the model's global inference profile, which can route inference outside the region's geography. - **Debug logging of the AI's output:** `--log-raw-model-output` logs what the AI returned whenever its output fails a check. It is off by default and quotes the assessment answers, so use it only while debugging; see [Debug logging of the raw AI output](docs/guides/deployment.md#debug-logging-of-the-raw-ai-output). - **Public (unauthenticated) API:** `--allow-unauthenticated-public-access` requires the script's typed confirmation; automation must also pass `--ci-acknowledge-unauthenticated-public-access`. It cannot be combined with `--user-email`. Outside `us-east-1`, suffixes are limited to collision-sensitive, explicitly named resources (the four stack S3 buckets, the external deployment artifact bucket, IAM role, CloudFront OAC and response-headers policy, and Cognito Hosted UI domain); `us-east-1` names have no suffix. Moving regions is not an in-place update: deploy a new stack in the destination, request Cognito users there, copy approved model configuration, and verify before removing the old stack. Async analysis jobs are ephemeral and are not migrated. #### What Gets Created | Resource | Purpose | |----------|---------| | CloudFront + three versioned stack-managed S3 buckets | React SPA hosting with CDN and HTTPS, versioned model configuration, and versioned access logs | | Results S3 bucket | Each async analysis job's request and result (not versioned; objects expire after one day) | | Deployment artifact S3 bucket | Lambda packaging artifacts and the PDF renderer's layer zip; created/reused outside CloudFormation, tagged `mpa:stack=`, and kept between deployments | | CodeBuild project + IAM role | Build the PDF renderer's layer the first time, and again when its build spec changes; created outside CloudFormation | | API Gateway + Lambda | Regional Python API (FastAPI + scoring engine + Bedrock), with a layer of native libraries and fonts for the PDF renderer | | DynamoDB | Regional async analysis job status (submit + poll); requests and results are in the results bucket | | Bedrock Guardrail | Content safety + prompt injection protection | | KMS Key | Regional encryption for stack-managed S3 data, DynamoDB, and CloudWatch log groups | | CloudWatch Logs | KMS-encrypted Lambda and API Gateway log groups with 90-day event retention | | Cognito ESSENTIALS (default) | Invite-only User Pool, Hosted-UI client, API JWT authorizer, and `model-admins` group; Plus threat protection is not provisioned | The stack does **not** provision AWS WAF, CloudWatch alarms, custom CloudWatch metrics, or SNS topics/subscriptions. Integrate organisation-managed edge protection, monitoring, and notification controls when required. The LogsBucket lifecycle expires current objects after 90 days, but it has no `NoncurrentVersionExpiration`; noncurrent log versions can persist until explicitly removed or cleanup runs. The versioned frontend and configuration buckets have no lifecycle expiration. The results bucket expires every object after one day, and the API deletes a job's request once it is read and stops serving its result one hour after the job completes (a poll after that deletes the result). The external artifact bucket is kept between deployments; cleanup deletes it. ### Run locally From the repository root, in a virtual environment: ```bash python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate python scripts/run_local.py --install --profile ``` This starts the API on `http://127.0.0.1:8000` and the web interface on **`http://127.0.0.1:5173`** (both on this machine only), and stops both on Ctrl+C. Missing Python and npm dependencies install automatically (Python ones only inside a virtual environment); `--install` refreshes them. Use `--region` to choose the Bedrock region (default `us-east-1`) and `--model` to choose another Claude Sonnet, Claude Opus or GPT model (see [Models tested](#models-tested)). Locally there is no login, analysis runs inside the API process, the model configuration is read from `data/` and cannot be saved from the Configure Model page, and nothing is created in AWS. Analysis still calls Amazon Bedrock with your credentials. The script also needs Pango, the system library the audit PDF renderer uses: on macOS it installs it with Homebrew; on Linux and Windows it tells you the command to run (see [Run locally](./docs/guides/deployment.md#run-locally)). ### Remove a deployment Cleanup is destructive and takes the exact region, which it includes in a typed confirmation: ```bash python3 scripts/cleanup.py dev mcp-agent eu-west-1 # Confirm: DELETE mcp-agent-dev IN eu-west-1 FROM 123456789012 ``` Cleanup deletes everything the deployment created. It empties every current object, version and delete marker from the four stack-managed buckets, then deletes the stack, including the Cognito pool and users, DynamoDB jobs table, log groups, frontend/API/CloudFront/Lambda resources, Bedrock guardrail and IAM role; AWS schedules deletion of the KMS key. It then deletes what the deploy script created outside the stack: the PDF renderer's layer build (CodeBuild project, its IAM role and log group) and the deployment artifact bucket, which it identifies by the tag `mpa:stack=` the deploy script puts on it. Back up anything you need first. See the [Deployment Guide](./docs/guides/deployment.md) for failure behaviour and migration steps. ### Inputs and outputs **Inputs** - **Interactive UI:** an AI-guided, structured assessment in the browser. - **Scenario upload:** a saved scenario file. Carry on with an assessment you stopped, or run the analysis again against the current configuration. - **API:** a program completes an assessment with the same calls the app makes. See [Using the API](./docs/guides/using-the-api.md). **Outputs** - **Interactive UI:** explore the results, open any score to see how it is calculated, and ask the chat about them. - **Full report:** a JSON snapshot of the inputs, the results and the configuration that produced them. Upload it to review the results read-only; it is never recalculated. - **PDF report:** an audit record of the findings, every answer and the scoring configuration, with the full report attached inside. Every stage is described step by step in the [User Guide](./docs/guides/user-guide.md). --- ## Security ### Access control Cognito JWT authentication is the secure default. Static SPA assets remain public, but the SPA redirects to Cognito and API Gateway rejects requests without a valid JWT. Authentication answers **who the caller is**; model administration additionally requires the backend-enforced `model-admins` group claim. Cognito uses the ESSENTIALS tier; Plus threat protection is not provisioned. ```bash REGION=eu-west-1 EMAIL=owner@example.com USER_POOL_ID=$(aws cloudformation describe-stacks \ --stack-name mcp-agent-dev --region "$REGION" \ --query 'Stacks[0].Outputs[?OutputKey==`CognitoUserPoolId`].OutputValue' \ --output text) aws cognito-idp admin-add-user-to-group --region "$REGION" \ --user-pool-id "$USER_POOL_ID" --username "$EMAIL" --group-name model-admins # Revoke administrator membership without deleting the login user. aws cognito-idp admin-remove-user-from-group --region "$REGION" \ --user-pool-id "$USER_POOL_ID" --username "$EMAIL" --group-name model-admins ``` Review caller identity and account first. Configure federation, MFA, identity lifecycle, edge protection, monitoring, and notifications according to organisational policy; this template does not claim to provide those controls. ### Unauthenticated mode `--allow-unauthenticated-public-access` sets `EnableAuth=false`, removes the API JWT authorizer, and builds the SPA without its login gate. Any internet caller can then consume API, Lambda, DynamoDB, and Bedrock capacity. Throttling and reserved concurrency reduce but do not eliminate that exposure. ### Stack controls - **TLS** — CloudFront serves HTTPS on its default certificate, which accepts TLS 1.0 and later (enforcing TLS 1.2 needs a custom domain and ACM certificate); only the four stack-managed S3 bucket policies deny insecure transport - **Deployment artifacts** — A newly created external artifact bucket gets an S3 public-access block and SSE-S3 (`AES256`) default encryption, but no TLS-only bucket policy; every deployment versions it and expires old versions after 30 days; it is kept between deployments and deleted by cleanup - **Encryption** — KMS encryption for application S3 data and CloudWatch Logs; review service-specific access-log encryption behaviour - **Bedrock Guardrail** — Blocks prompt injection, misconduct, and harmful content - **Inference geography** — Regional profiles are the default; the global profile is selected only by `--allow-global-inference` and may route outside the geography - **IAM** — Lambda role is limited to mapped regional/global Bedrock inference resources, the config-bucket keys it reads and writes, the `requests/` and `results/` prefixes of the results bucket, the stack KMS key only via S3 or DynamoDB, the jobs table, self-invocation, and logs; review wildcard-shaped ARNs before production - **Rate limiting / cost bounds** — API Gateway rate limited (50/s, 100 burst) and Lambda reserved concurrency set to 10 - **Security headers** — HSTS, dynamic regional CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy - **Operator-supplied controls** — The stack does not provision AWS WAF, CloudWatch alarms, custom CloudWatch metrics, or SNS notifications ### Self-deployed threat model This repository is software you operate in your own AWS account, not a managed service. The deployer owns account security, least-privilege credentials, Bedrock access and geography decisions, identity lifecycle, budgets, external alerting, data classification, and dependency updates. Workload text is sent to Bedrock using the selected inference profile; global inference can route outside the regional profile geography. See the [Deployment guide](./docs/guides/deployment.md) for the self-deployed threat model, operator responsibilities, and accepted-risk guidance, and the Security Architecture section of [docs/reference/architecture.md](./docs/reference/architecture.md) for control-by-control detail. --- ## Understanding the Results Results comprise an overall readiness score (0–100) with driver and factor detail, per-provider gravity with a traceable formula per contribution, and a Findings Summary: the highest gravity provider (or the providers tied on top), how firm its lead is (rank acceptability against a firm-lead threshold, and the answers it depends on), how gravity is spread, where readiness points are lost, and migration complexity. Full interpretation is in the **[User Guide](./docs/guides/user-guide.md#understanding-your-results)** and **[Findings Summary](./docs/explanation/findings-summary.md)**. --- ## Scoring Model For the methods behind every number — each with its published source where it has one — see **[Calculation Methods](./docs/reference/calculation-methods.md)**. The at-a-glance summary follows. ### Workload Assessment (Driver Scores) ``` 1. Question answers → factor scores: each answer moves its factors up or down (direction from questions.json); the size is your Review & Adjust value, else the AI's factor tier and value, else the factor's tier maximum for a No, else ROC for a Yes that was not validated 2. Per driver: Σ(factor_score × weight) + synergy_bonus = factor_adjustment 3. Linear value function maps factor_adjustment to 0–100 using theoretical bounds 4. Driver difficulty = hardest requirement plus a shrinking share of each further one (Compounding Difficulty); difficulty penalty: score × (1 / (1 + difficulty/divisor)) 5. Overall = weighted average of driver scores using priority exponent ``` Priority only affects the weighted average (step 5), not individual driver scores. Driver scores are objective workload readiness. ### Provider Gravity ``` 1. Question answer names providers (provider_answers) → one link per (question, provider) 2. Score 1-10 per link, inside the band of the tier answer validation gave it 3. Normalised weight = driver_priority / sum(all_priorities) 4. Link points = score × normalised_weight × gravity.scale (a constant in model_config.json that sets the size of the totals), for each affected driver 5. Sum per provider → highest gravity provider → rank acceptability and leave-one-out (how firm the lead is) → gravity spread ``` Every question answer that names a provider creates gravity. High-priority drivers create stronger gravity, and a stronger tie gives a higher score. The score comes from the user's Review & Adjust override, else the analysis AI's per-provider score within the tier answer validation gave it, else, for an answer that was not validated, a Rank-Order Centroid score from how many findings the question's knowledge file lists in each tier. On the concentration-risk question, the named provider's score goes to every other candidate provider. ### Configuration The scoring model is configurable via the **Configure Model** page (cog icon in nav bar): - **Scoring Parameters** — Difficulty Influence, Priority Influence, Compounding Difficulty, Migration Complexity weights, the Firm Lead Threshold, and the migration complexity and readiness bands - **Drivers** — each driver's factor weights - **Synergies** — bonus rules for pairs of strong factors - **Factors** — each factor's tier bands - **Requirements** — each requirement's drivers and tier bands - **Questions** — which factors each question moves and in which direction (the size comes from the analysis), and its gravity drivers A save stores only the values you changed, in the deployment's config bucket, and takes effect on the next analysis. A redeploy keeps the saved changes, and every value no one has changed follows the deployed `data/` files. When running locally there is no config bucket, and in unauthenticated mode remote saves are refused, so in both cases you change `data/` in your repository instead. See [Configuring the Scoring Model](./docs/guides/model-configuration.md). --- ## Project Structure ``` MultiCloud-Placement-Agent/ ├── app/ │ ├── frontend/ # React + Vite + Cloudscape SPA │ ├── backend/ │ │ ├── app/ │ │ │ ├── main.py # App factory, CORS, exception handling, Lambda handler │ │ │ ├── settings.py # Pydantic BaseSettings (typed env var schema) │ │ │ ├── config_loader.py # Deployed config files (S3 base/, or data/ locally) + saved changes, cached │ │ │ ├── config_overrides.py # Saved configuration changes: diff and apply on the deployed files │ │ │ ├── config_validation.py # Config document validation │ │ │ ├── knowledge_loader.py # Loads question and factor knowledge files │ │ │ ├── security.py # Cognito JWT + model-admins group enforcement │ │ │ ├── routes/ # FastAPI routers │ │ │ │ ├── analysis.py # POST/GET /api/v1/analyses │ │ │ │ ├── recompute.py # POST /api/v1/recompute │ │ │ │ ├── reports.py # POST /api/v1/reports/audit-pdf │ │ │ │ ├── chat.py # POST /api/v1/chat-messages │ │ │ │ ├── config.py # GET/PUT /api/v1/config/*, POST overrides/prune, DELETE overrides │ │ │ │ └── validation.py# POST /api/v1/answer-validations │ │ │ ├── services/ # Business logic │ │ │ │ ├── analysis_service.py # Pass 1: the AI stages and the review-stage result │ │ │ │ ├── analysis_stages.py # The three AI stages, run in parallel │ │ │ │ ├── recompute_service.py # Pass 2: the AI-free calculation │ │ │ │ ├── accept_service.py # Accept a review result unchanged │ │ │ │ ├── run_record.py # When the analysis ran, model id, app version │ │ │ │ ├── audit_report.py # The audit PDF's values │ │ │ │ ├── audit_pdf.py # The audit PDF renderer (WeasyPrint, PDF/A-3b) │ │ │ │ ├── chat_service.py # Post-analysis AI chat │ │ │ │ ├── job_payload_store.py # S3 job request/result objects │ │ │ │ ├── job_service.py # DynamoDB job status, dispatch + worker │ │ │ │ ├── provider_gate.py # Per-provider answer quality gate │ │ │ │ └── validation_service.py# Answer validation + follow-ups │ │ │ ├── templates/ # The audit PDF's HTML template and print stylesheet │ │ │ ├── models/ # Pydantic request/response schemas │ │ │ │ ├── requests.py │ │ │ │ └── responses.py │ │ │ └── middleware/ │ │ │ └── envelope.py # {data, meta} / {error, meta} response wrapper │ │ └── prompts/ │ │ └── chat_system.txt # Externalised chat agent system prompt │ ├── layers/weasyprint/ # Build spec for the PDF renderer's Lambda layer (scripts/build_layer.py) │ └── infrastructure/ # CloudFormation template ├── src/ # Python engine (used by the API and the tests) │ ├── engine/ │ │ ├── calculator.py # Factor scores, driver assessments, value function │ │ ├── provider_analyzer.py # Runs gravity extraction, ranking and the provider gravity summary │ │ ├── gravity_extractor.py # Extracts raw gravity points from DPQ answers │ │ ├── provider_scorer.py # Ranks providers by gravity; benefits and driver risks │ │ ├── provider_gravity_summary.py # Findings Summary: highest gravity provider, ties, migration complexity │ │ ├── lead_robustness.py # Rank acceptability (SMAA), leave-one-out, tie readings, gravity spread │ │ ├── readiness.py # Readiness bands from model_config.json │ │ ├── provider_models.py # Gravity, fit score and gravity summary dataclasses │ │ ├── ai_requirement_analyzer.py # Bedrock requirement analysis │ │ └── constants.py # Shared constants │ ├── models/ │ │ └── schema.py # Engine dataclasses (QuestionResponse, FactorAssessment, DriverAssessment, etc.) │ └── utils/ │ ├── analysis_budget.py # Analysis time budget, finish reserve, job deadline │ └── aws_runtime_config.py# Region + Bedrock profile resolution ├── data/ # Configuration files (JSON), uploaded to the config bucket on deploy │ ├── questions.json # assessment questions │ ├── drivers.json # strategic drivers + factor weights │ ├── factors.json # workload factors │ ├── requirements.json # requirement types │ ├── model_config.json # Scoring parameters (bounds, divisors, exponents) │ ├── synergies.json # Factor synergy bonuses │ ├── explanations.json # UI explanation texts │ ├── providers.json # Providers offered as current (isCurrent) and target (isTarget) │ └── knowledge/ # AI follow-up knowledge │ ├── questions/ # per-question markdown + SCHEMA.md │ └── factors/ # per-factor markdown ├── tests/ │ ├── backend/ # API + service layer tests │ ├── engine/ # Calculator + provider analyzer tests │ ├── data/ # Config + knowledge file validation │ ├── e2e/ # End-to-end scenario tests │ ├── property/ # Property-based invariant tests │ ├── lifecycle/ # deploy / cleanup / run_local scripts (fake command runner) │ ├── infrastructure/ # CloudFormation template security and region checks │ ├── scenarios/ # Reference scenarios: complete// (scenario.json + oracle.md), incomplete/ │ └── ai/ # AI eval harness: offline tests + live_eval Bedrock evals (excluded by default) ├── docs/ # Documentation: guides/, explanation/, reference/, testing/ └── scripts/ # Every script you run (Python ones on any OS) ├── deploy.py # Deploy a stack ├── cleanup.py # Remove a stack and everything it created ├── run_local.py # Run the app on your machine ├── build_layer.py # Build the PDF renderer's Lambda layer in CodeBuild ├── check_config.py # Check data/ with the rules the app applies when it loads it └── mpa_lifecycle.py # Shared code for the scripts above ``` --- ## Cost This repository does not provide a total-cost estimate. Review these current cost drivers for the target account, region, traffic, retention, and inference mode: | Resource | Cost drivers to evaluate | |----------|--------------------------| | Four stack S3 buckets + artifact bucket | Stored frontend/config/log/artifact data and short-lived job requests/results, requests, transfer, retained noncurrent versions, and the artifact bucket until cleanup | | CloudFront | Requests and data transfer under `PriceClass_100` | | Lambda | Invocations, duration, and memory; reserved concurrency limits simultaneous executions, not total spend | | CodeBuild | The PDF renderer's layer build (a few minutes on the first deployment, and on a rebuild) | | API Gateway HTTP API | API requests and data transfer | | DynamoDB | On-demand reads/writes, storage, and point-in-time recovery | | KMS | Key and cryptographic-operation charges | | CloudWatch Logs | Ingestion, storage, and retrieval for Lambda/API log groups; the stack creates no alarms or custom metrics | | Cognito ESSENTIALS | Monthly active users and applicable authentication features | | Bedrock (the AI model) | Input/output tokens and selected regional or global inference profile | Pricing, free tiers, and service availability vary by account, region, usage, and time. Use current AWS pricing pages and AWS calculators for the intended deployment. API throttling (50 requests/second, 100 burst), Lambda reserved concurrency (10), DynamoDB on-demand billing, CloudFront `PriceClass_100`, and 90-day CloudWatch log-group event retention reduce—not eliminate—cost exposure. The LogsBucket expires current objects after 90 days, but noncurrent log versions may persist because no `NoncurrentVersionExpiration` is configured; frontend/config versions and the artifact bucket also persist until cleanup removes them. The stack does not create budgets, CloudWatch alarms, custom metrics, or SNS notifications, so configure organization-managed budgets, anomaly detection, monitoring, and alert routing separately. --- ## API Reference All endpoints are served under the `/dev` stage prefix when deployed via API Gateway. | Method | Path | Description | Request Body | Response | |--------|------|-------------|--------------|----------| | `GET` | `/` | Root / status check | — | `HealthResponse` | | `GET` | `/api/v1/health` | Health check with timestamp | — | `HealthResponse` | | `POST` | `/api/v1/analyses` | Submit an analysis (202 with a job id; 200 with the review-stage result when run locally) | `AnalysisRequest` | `AnalysisSubmitResponse` / `AnalysisResponse` | | `GET` | `/api/v1/analyses/{job_id}` | Poll analysis job status and result | — | `AnalysisPollResponse` | | `POST` | `/api/v1/recompute` | Calculate the accepted result from the reviewed numbers (no AI) | `RecomputeRequest` | `AnalysisResponse` | | `POST` | `/api/v1/reports/audit-pdf` | The audit PDF of a saved, accepted report | `AuditReportRequest` | `application/pdf` (attachment) | | `POST` | `/api/v1/answer-validations` | AI-validate an answer for completeness | `AIFollowUpRequest` | `AIFollowUpResponse` | | `POST` | `/api/v1/answer-validations/follow-ups` | Generate knowledge-driven follow-ups | `FollowUpRequest` | `AIFollowUpResponse` | | `POST` | `/api/v1/chat-messages` | Chat with AI about analysis results | `ChatRequest` | `ChatResponse` | | `GET` | `/api/v1/config/{questions,drivers,factors,requirements,model,synergies,providers}` | Get a configuration document | — | JSON object | | `GET` | `/api/v1/config/explanations` | Get UI explanation texts | — | JSON object | | `GET` | `/api/v1/config/questions/{question_id}/severity-tiers` | A question's severity-tier grid, from its knowledge file | — | JSON object | | `GET` | `/api/v1/config/provenance` | The live configuration's fingerprint (`hash`, `generation`) | — | JSON object | | `PUT` | `/api/v1/config/{questions,drivers,factors,requirements,model,synergies}` | Save a configuration document (`model-admins` group when auth is on) | The document | `ConfigWriteResponse` | | `DELETE` | `/api/v1/config/overrides` | Remove every saved configuration change, so the configuration is the deployed files again (`model-admins` group when auth is on) | — | `{removed: }` | | `POST` | `/api/v1/config/overrides/prune` | Delete the saved configuration changes that no longer apply to the deployed files, and list them (`model-admins` group when auth is on) | — | `{removed: [...]}` | All successful JSON responses are wrapped in `{data, meta: {requestId, timestamp}}`; the audit PDF is returned as the file itself. Error responses use `{error: {code, message}, meta}`; request-validation errors (400) add `details`, and an AI failure (503, `AI_FAILED`) adds `failure`. Config GET endpoints return raw JSON documents (not Pydantic-modelled). Config saves are last-write-wins. See the auto-generated OpenAPI documentation at `/docs` (`/dev/docs` through API Gateway, which needs a sign-in token when sign-in is on; locally at http://127.0.0.1:8000/docs) for full request/response schemas. --- ## Documentation - [Documentation index](./docs/README.md) — every user doc, by what you want to do - [User Guide](./docs/guides/user-guide.md) — End-user walkthrough: the assessment journey, reading results, saving scenarios and reports - [The PDF Audit Report](./docs/reference/audit-report.md) — What the PDF audit report holds, and how to verify it against its embedded data - [The Report File](./docs/reference/report-file.md) — Every field of the JSON file Download Full Report saves, for reading reports as a data source - [Calculation Methods](./docs/reference/calculation-methods.md) — Every method the tool uses to produce a number, with its published source - [Deployment Guide](./docs/guides/deployment.md) — Full deployment walkthrough with prerequisites, customisation, cleanup - [Customising Knowledge Files](./docs/guides/customising-knowledge-files.md) — Adding your own lessons learnt and changing tier criteria - [Managing Users and Roles](./docs/guides/managing-users.md) — Adding users, making them model administrators, and removing access - [Completing an Assessment Through the API](./docs/guides/using-the-api.md) — Every step of an assessment as API calls, with the requests, the responses and what your client owns - [Architecture](./docs/reference/architecture.md) — What you deploy, how an analysis runs, security controls, local vs deployed - [Gravity Model](./docs/explanation/gravity.md) — How provider gravity scoring works - [Findings Summary](./docs/explanation/findings-summary.md) — The Findings Summary tiles and how each is calculated - [Multicloud Readiness](./docs/explanation/readiness.md) — How answers move factors, factors feed drivers, and difficulty and priorities produce the readiness score - [Finding Requirements](./docs/explanation/ai/finding-requirements.md) — How Bedrock derives requirements - [Configuring the Scoring Model](./docs/guides/model-configuration.md) — Using the Config UI to tune drivers, factors, requirements, tier bands, and scoring parameters - [Code Reference](./docs/reference/code-reference.md) — Every application code file, its language, what it does and what to know before changing it - [Configuration Files](./docs/reference/configuration-files.md) — Every configuration file, its rules, and how to set your own defaults before deploying - [Contributing](./CONTRIBUTING.md) — How to contribute: issues, the tests each kind of change needs, pull requests, the Code of Conduct and security reporting - [Testing Guide](./docs/testing/how-the-tool-is-tested.md) — How the tool is tested, how to run the tests, reading the output - Security posture — see the [Security Architecture](./docs/reference/architecture.md) section and the self-deployed threat model in the [Deployment Guide](./docs/guides/deployment.md) --- ## Built With - **Frontend**: React, TypeScript, Vite, Cloudscape Design System - **Backend**: Python 3.13, FastAPI, Mangum (Lambda adapter) - **AI**: Amazon Bedrock - **Infrastructure**: AWS CloudFormation, CloudFront, Lambda, API Gateway, S3, KMS - **Analysis**: Multi-Attribute Utility Theory (MAUT), Stochastic Multicriteria Acceptability Analysis (SMAA), one-at-a-time sensitivity analysis, normalised priority weighting, hyperbolic difficulty penalty --- ## Contributing Contributions are welcome. **[CONTRIBUTING.md](./CONTRIBUTING.md)** sets out the flow: when to open an issue, the tests each kind of change needs, and how to open a pull request. This project follows the [Amazon Open Source Code of Conduct](./CODE_OF_CONDUCT.md); to report a security issue, see [SECURITY.md](./SECURITY.md). --- ## License [Apache License 2.0](./LICENSE). The open-source components the product uses, and their licences, are listed in [licences.md](./licences.md).