{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudworldmodel-ai/json-schema/cloudworldmodel-ai-strategy-schema.json",
  "title": "Strategy",
  "description": "A flight-simulator-style planning estimate for a specific multi-cloud deployment configuration. Cost and latency figures reflect baseline on-demand rates under typical load and are **not actual billing data**. Internet egress is estimated and included in `totalCostPerHour` via the `egressCostPerHour` field in each `costBreakdown` entry, after deducting each provider's free monthly egress allowance (OCI 10,000 GB/month, DigitalOcean 1,000 GB/instance/month, AWS 100 GB/month, GCP 200 GB/month, Azure 5 GB/month). Still excluded: monitoring/support surcharges, non-egress free-tier credits, reserved-instance discounts, and spot/preemptible pricing. Allocations with different `skuClass` values are not directly cost-comparable; the `crossClassNote` field explains any such mix. Validate top candidates by materialising them as owned simulations before making infrastructure commitments.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudworldmodel-ai-multi-cloud-strategy-api-openapi.yml#/components/schemas/Strategy",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique strategy identifier"
    },
    "name": {
      "type": "string",
      "description": "Strategy name"
    },
    "description": {
      "type": "string",
      "description": "Strategy description"
    },
    "allocations": {
      "type": "array",
      "description": "Provider allocations in this strategy",
      "items": {
        "$ref": "#/$defs/ProviderAllocation"
      }
    },
    "metrics": {
      "$ref": "#/$defs/StrategyMetrics"
    },
    "tradeoffs": {
      "type": "array",
      "description": "Key tradeoffs of this strategy",
      "items": {
        "type": "string"
      }
    },
    "recommendations": {
      "type": "array",
      "description": "Recommendations for this strategy",
      "items": {
        "type": "string"
      }
    },
    "suggestedResources": {
      "type": "array",
      "description": "Materializable SKU objects for each resource type in this strategy. Each entry identifies the canonical instance size, unit count, and per-unit hourly rate so consumers can pre-populate infrastructure manifests or compare costs directly.\n",
      "items": {
        "type": "object",
        "required": [
          "provider",
          "resourceType",
          "size",
          "count",
          "hourlyRate"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "aws",
              "gcp",
              "azure",
              "oci",
              "digitalocean"
            ]
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "compute",
              "database",
              "storage"
            ]
          },
          "size": {
            "type": "string",
            "description": "Canonical instance/SKU identifier (e.g. \"t3.medium\", \"db.t3.medium\", \"s3-standard\")"
          },
          "count": {
            "type": "number",
            "description": "Number of instances (or GB for storage)"
          },
          "hourlyRate": {
            "type": "number",
            "description": "Per-unit hourly cost in USD"
          }
        }
      }
    },
    "securityRecommendations": {
      "type": "array",
      "description": "Security product identifiers recommended for this strategy (e.g. `aws-waf`, `gcp-cloud-armor`, `azure-waf`, `oci-waf`).  These are WAF/firewall palette IDs that operators can add to protect each provider footprint.\n",
      "items": {
        "type": "string"
      }
    },
    "crossClassNote": {
      "type": "string",
      "description": "Present only when this strategy's allocations span more than one class in either the compute dimension (comparing `computeSkuClass` values) or the database dimension (comparing `databaseSkuClass` values). Each dimension is evaluated independently so a compute-tier mismatch is never masked by a shared database tier, and vice-versa. The note names the mismatched dimension(s) and warns that cost and latency figures across those allocations may not be directly comparable because they model different product tiers. Absent when all allocations share the same class in both dimensions.\n"
    },
    "costBreakdown": {
      "type": "array",
      "description": "Per-provider cost breakdown for this strategy. One entry per provider allocation, each showing compute, database, storage, and egress costs attributed to that provider's slice of the workload. `egressCostPerHour` in each entry reflects the overage cost after deducting the provider's free monthly egress allowance (see `ProviderCostBreakdown`). `totalCostPerHour` in each entry is the sum of all four line items for that slice.\n",
      "items": {
        "$ref": "#/$defs/ProviderCostBreakdown"
      }
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "allocations",
    "metrics",
    "tradeoffs",
    "recommendations",
    "costBreakdown"
  ],
  "$defs": {
    "ProviderAllocation": {
      "type": "object",
      "required": [
        "skuClass"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "aws",
            "gcp",
            "azure",
            "oci",
            "digitalocean"
          ],
          "description": "Cloud provider name"
        },
        "computeInstances": {
          "type": "integer",
          "description": "Number of compute instances on this provider"
        },
        "databaseInstances": {
          "type": "integer",
          "description": "Number of database instances on this provider"
        },
        "storageGB": {
          "type": "integer",
          "description": "Storage allocated to this provider (GB)"
        },
        "trafficPercentage": {
          "type": "number",
          "description": "Percentage of traffic routed to this provider"
        },
        "regions": {
          "type": "array",
          "description": "Regions used on this provider",
          "items": {
            "type": "string"
          }
        },
        "skuClass": {
          "type": "string",
          "description": "Primary product-class label for this allocation. Derived from the two per-dimension fields below (`computeSkuClass`, `databaseSkuClass`) using the following precedence: if `computeSkuClass` is non-default (i.e. `do-droplet`, `bare-metal-compute`, or `free-tier-compute`), that compute class is used even when a `databaseSkuClass` is also present. Otherwise the `databaseSkuClass` is used when present; the final fallback is `general-compute`.\nAllocations that share the same `skuClass` are cost-comparable at the class level; allocations with different values are not directly comparable — see the parent Strategy's `crossClassNote` when present.\n"
        },
        "computeSkuClass": {
          "type": "string",
          "description": "Compute-dimension SKU class for this allocation.\n`general-compute` — standard dedicated-vCPU VMs (EC2, Compute Engine, Azure VMs, OCI VM.Standard/Flex; the default when no specific compute family is set), `do-droplet` — DigitalOcean Droplets (shared-vCPU cloud VMs; different resource model and performance guarantees from dedicated-vCPU instances), `free-tier-compute` — always-free / zero-cost compute (OCI Always Free AMD micro VMs; costs excluded from estimate totals), `bare-metal-compute` — dedicated bare-metal servers (OCI BM.Standard3.64, BM.Optimized3.36; no hypervisor overhead, full core isolation).\nAlways present after annotation; defaults to `general-compute`.\n"
        },
        "databaseSkuClass": {
          "type": "string",
          "description": "Database-dimension SKU class for this allocation. Absent when no database service family is set (allocation carries no bespoke database tier).\n`managed-rdbms` — provisioned relational databases (RDS, Cloud SQL, Azure SQL, …), `oci-heatwave` — OCI MySQL HeatWave DB System and HeatWave Analytics Cluster (in-memory analytics accelerator; distinct billing model and capability profile from standard managed-rdbms — not directly cost-comparable), `serverless-db` — pay-per-use / auto-scaling databases (Aurora Serverless, Cloud Spanner, Autonomous DB, …), `managed-nosql` — wide-column or key-value NoSQL (Bigtable SSD/HDD, …).\n"
        }
      }
    },
    "ProviderCostBreakdown": {
      "type": "object",
      "required": [
        "provider",
        "computeCostPerHour",
        "databaseCostPerHour",
        "storageCostPerHour",
        "egressCostPerHour",
        "totalCostPerHour",
        "computeInstances",
        "databaseInstances",
        "storageGB"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "aws",
            "gcp",
            "azure",
            "oci",
            "digitalocean"
          ],
          "description": "Cloud provider for this allocation slice"
        },
        "computeCostPerHour": {
          "type": "number",
          "description": "Hourly compute cost for this provider slice (USD)"
        },
        "databaseCostPerHour": {
          "type": "number",
          "description": "Hourly database cost for this provider slice (USD)"
        },
        "storageCostPerHour": {
          "type": "number",
          "description": "Hourly storage cost for this provider slice (USD)"
        },
        "egressCostPerHour": {
          "type": "number",
          "description": "Hourly internet egress cost attributed to this provider slice (USD), after deducting the provider's free monthly egress allowance (converted to an hourly GB budget — ÷ 730). Free allowances: OCI 10,000 GB/month (Always Free, flat), DigitalOcean 1,000 GB/instance/month (scales with computeInstances), AWS 100 GB/month, GCP 200 GB/month (Americas), Azure 5 GB/month. Volume within the free tier produces zero. Zero also when trafficRPS is 0.\n"
        },
        "totalCostPerHour": {
          "type": "number",
          "description": "Sum of compute + database + storage + egress costs for this slice (USD)"
        },
        "computeInstances": {
          "type": "number",
          "description": "Number of compute instances in this provider slice"
        },
        "databaseInstances": {
          "type": "number",
          "description": "Number of database instances in this provider slice"
        },
        "storageGB": {
          "type": "number",
          "description": "Total storage provisioned in this provider slice (GB)"
        },
        "computeUnitRate": {
          "type": "number",
          "description": "Per-instance hourly compute rate used for this slice (USD/hr)"
        },
        "databaseUnitRate": {
          "type": "number",
          "description": "Per-instance hourly database rate used for this slice (USD/hr)"
        },
        "storageUnitRate": {
          "type": "number",
          "description": "Per-GB storage rate used (USD/GB/hr, on a per-1000-GB basis)"
        },
        "egressFreeTierExhaustedAtRPS": {
          "type": "number",
          "description": "The requests-per-second (RPS) threshold at which this provider's hourly egress free-tier allowance is fully consumed, given the current traffic share and instance count. Below this value egressCostPerHour is $0; above it the overage rate applies. Computed as Math.round(freeHourlyGB / (RPS_TO_GB_PER_HOUR × share)), where RPS_TO_GB_PER_HOUR = 0.0072 and freeHourlyGB = monthlyFreeGB / 730 (DigitalOcean scales by computeInstances). Omitted when trafficPercentage is 0 or when the provider has no free egress allowance.\n"
        },
        "databaseServiceFamily": {
          "type": "string",
          "description": "Database product sub-family override applied to this slice (e.g. \"cloud-sql\", \"aurora-serverless\", \"autonomous-db\"). Absent when the provider's default managed database rate is used.\n"
        }
      }
    },
    "StrategyMetrics": {
      "type": "object",
      "properties": {
        "totalCostPerHour": {
          "type": "number",
          "description": "Total hourly cost across all providers"
        },
        "avgLatencyMs": {
          "type": "number",
          "description": "Average latency (P50 estimate) in milliseconds"
        },
        "p95LatencyMs": {
          "type": "number",
          "description": "Estimated P95 latency in milliseconds (avgLatencyMs × 1.5)"
        },
        "vendorLockInScore": {
          "type": "number",
          "description": "Vendor lock-in score (0-100, higher = more locked in / harder to migrate away). Single-provider strategies score 55-84 depending on service proprietary-ness (Aurora Serverless scores higher than standard RDS); multi-provider strategies score 20-50 depending on traffic distribution and provider count."
        },
        "dataPortabilityScore": {
          "type": "number",
          "description": "Data portability score (0-100, higher = more portable)"
        },
        "geographicCoverage": {
          "type": "number",
          "description": "Geographic coverage score (0-100)"
        },
        "compositeScore": {
          "type": "number",
          "description": "Overall weighted composite score (0-10)"
        },
        "migrationEgressCost": {
          "type": "number",
          "description": "One-time data-migration egress cost estimate (USD) — the cost of moving the workload's stored data out of the source provider. Computed as `EGRESS_PER_GB_RATES[sourceProvider] × storageGB`. Always present; zero-valued strategies have zero storage in the workload profile.\n"
        },
        "egressCostPerHour": {
          "type": "number",
          "description": "Estimated ongoing internet egress cost per hour (USD) — the recurring cost of serving outbound responses to external users. Derived from `trafficRPS` using a 2 KB average response payload (RPS × 3600 s/hr × 0.000002 GB/request) and each provider's `INTERNET_EGRESS_RATES` overage rate (USD/GB), after deducting each provider's free monthly egress allowance (converted to an hourly GB budget): OCI 10,000 GB/month (Always Free, flat), DigitalOcean 1,000 GB/instance/month (scales with computeInstances), AWS 100 GB/month, GCP 200 GB/month (Americas), Azure 5 GB/month. For multi-provider strategies the cost is traffic-share-weighted across all allocations. This estimate is added into `totalCostPerHour` so rankings reflect the full ongoing cost including egress. Absent only on strategies with zero traffic. Volume within a provider's free tier produces `egressCostPerHour: 0`.\n"
        },
        "latencyHeadroomPct": {
          "type": "number",
          "description": "How far below the user's latency SLO this strategy sits, expressed as a percentage of the SLO limit. Computed as max(0, (SLO − p95LatencyMs) / SLO × 100). A value of 13.75 means p95 latency is 13.75% below the SLO limit — the strategy has that much buffer before it would breach the target. 0 means the strategy is at or above the SLO limit. Absent for strategies that exceed the SLO.\n"
        }
      }
    }
  }
}