{
  "slug": "docker-compose-sdk-scaleoptions-carries-replica-counts-ed4bf85d61b3",
  "title": "docker-compose SDK ScaleOptions carries replica counts",
  "tools": [
    "docker-compose"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-03T15:53:28.000Z",
  "announced_at": "2026-09-03T15:53:28.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When scaling services through the Compose SDK, set `ScaleOptions.Replicas` to the desired service counts and call `Scale(ctx, project, options)`; `Services` selects services for recreation-policy handling and defaults to the replica-map keys when empty.",
    "examples": [
      "options := api.ScaleOptions{Replicas: map[string]int{\"<service>\": <replica-count>}}\nerr := backend.Scale(ctx, project, options)"
    ],
    "gotchas": [
      "Version: v5.5.1",
      "ScaleOptions.Replicas: Map service names to desired replica counts; Scale applies these counts to the project model before convergence.",
      "ScaleOptions.Services: Services whose containers may be recreated on configuration divergence while converging; empty defaults to the keys of Replicas. No mutual exclusion with Replicas is documented.",
      "Scale(ctx, project, options) (required): Scale sets replica counts and converges the project, creating, removing, and starting containers as needed.",
      "A pre-mutated project with an empty `Replicas` map continues to work as before."
    ]
  },
  "why_it_matters": "Use the Compose SDK to scale services in a project.",
  "before": "The CLI mutated the project model with SetScale before calling the backend; SDK callers following the Scale interface documentation could get a no-op convergence because ScaleOptions had no replica count.",
  "sources": [
    "https://github.com/docker/compose/releases/tag/v5.5.1",
    "https://github.com/docker/compose/pull/14077",
    "https://github.com/docker/compose/blob/v5.5.1/pkg/api/api.go"
  ],
  "rank": 0.97033,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1-20261014",
    "verdict_id": "wave1-20261014:wave1-20261014-7239c2b3cee54d29-4:gate",
    "evidence_hash": "448c30be234873a88bed4149dae9e8474dcf0695ecba9948abe6513e2c9c947c"
  },
  "review": {
    "draft_hash": "4c7f97c9c296b7ae23fb51e2ae2fa953b030704e251f84dba30f90e56fe3c71c",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1-20261014:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.67 (>= 0.6 needed)."
  }
}
