{
  "openapi": "3.0.4",
  "x-heroscript-command-payloads": {"EQUIP_SUPPORT":"#/components/schemas/EquipSupportCommand","PLAY_CARD":"#/components/schemas/CombatGameplayCommand","EDIT_DECK_LOADOUT":"#/components/schemas/DeckLoadoutEdit","APPLY_LOADOUT":"#/components/schemas/ApplyLoadoutCommand","OPEN_INSCRIPTION_OFFER":"#/components/schemas/OpenInscriptionOfferCommand","CHOOSE_INSCRIPTION_OFFER":"#/components/schemas/ChooseInscriptionOfferCommand","TRANSFER_INSCRIPTION":"#/components/schemas/TransferInscriptionCommand"},
  "info": {
    "title": "HeroScript API",
    "version": "v1",
    "description": "Contrato público para runs determinísticas, conteúdo imutável e replay verificável. Toda resposta não bem-sucedida usa RFC 9457 Problem Details."
  },
  "servers": [
    { "url": "http://localhost:5260", "description": "Desenvolvimento local" }
  ],
  "tags": [
    { "name": "System" },
    { "name": "Runs" },
    { "name": "Combats" },
    { "name": "Content" },
    { "name": "Sandbox" }
  ],
  "paths": {
    "/api/v1/runs/{runId}/support-loadout": {
      "get": {
        "tags": [
          "SupportLoadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutSnapshot"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutSnapshot"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutSnapshot"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/runs/{runId}/support-loadout/preview": {
      "post": {
        "tags": [
          "SupportLoadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportLoadoutPreviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportLoadoutPreviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SupportLoadoutPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutPreview"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutPreview"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportLoadoutPreview"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/combats/{combatId}/cards/payment-preview": {
      "post": {
        "tags": [
          "CardPayment"
        ],
        "parameters": [
          {
            "name": "combatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPaymentPreviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPaymentPreviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CardPaymentPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CardPaymentPreview"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardPaymentPreview"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardPaymentPreview"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/runs/{runId}/deck-loadout": {
      "get": {
        "tags": [
          "DeckLoadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutSnapshot"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutSnapshot"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutSnapshot"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/runs/{runId}/deck-loadout/preview": {
      "post": {
        "tags": [
          "DeckLoadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeckLoadoutPreviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeckLoadoutPreviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeckLoadoutPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutPreview"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutPreview"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckLoadoutPreview"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/content/{settingId}/revisions/{revision}/gameplay-events/catalog": {
        "get": {
          "tags": [
            "GameplayEvent"
          ],
          "parameters": [
            {
              "name": "settingId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "revision",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/v1/content/{settingId}/revisions/{revision}/gameplay-responses/schema": {
        "get": {
          "tags": [
            "GameplayEvent"
          ],
          "parameters": [
            {
              "name": "settingId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "revision",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/v1/runs/{runId}/commits/{sequence}/gameplay-events": {
        "get": {
          "tags": [
            "GameplayEvent"
          ],
          "parameters": [
            {
              "name": "runId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "sequence",
              "in": "path",
              "required": true,
              "schema": {
                "type": "integer",
                "format": "int32"
              }
            },
            {
              "name": "contentRevision",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
    "/api/v1/runs/{runId}/loadout": {
      "get": {
        "tags": [
          "Loadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "actorId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutSnapshot"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutSnapshot"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutSnapshot"
                }
              }
            }
          }
        }
      },
      "x-heroscript-stability": "experimental"
    },
    "/api/v1/runs/{runId}/loadout/preview": {
      "post": {
        "tags": [
          "Loadout"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadoutPreviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadoutPreviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoadoutPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutPreview"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutPreview"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadoutPreview"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "x-heroscript-stability": "experimental"
    },
    "/api/v1/runs/{runId}/session": {
      "get": {
        "tags": [
          "InteractionSession"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expectedSequence",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InteractionSession"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InteractionSession"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InteractionSession"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified"
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-heroscript-stability": "stable",
        "summary": "Read one atomic compact interactive session",
        "description": "Captures one immutable run revision. expectedSequence mismatch returns 409. ETag and If-None-Match support 304. See docs/api/interactive-session.md."
      }
    },
    "/api/v1/runs/{runId}/cards/presentations": {
      "get": {
        "tags": ["Runs"], "operationId": "getRunCardPresentations", "x-heroscript-stability": "experimental",
        "parameters": [{"$ref": "#/components/parameters/RunId"}],
        "responses": {"200": {"description": "Revision-pinned composed bases for visible instances and current concrete offers. No RNG or gameplay mutation.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CardPresentationBatch"}}}}, "400": {"$ref": "#/components/responses/Problem"}}
      }
    },
    "/api/v1/runs/{runId}/card-modifier-items": {
      "get": {
        "tags": ["Runs"], "operationId": "getCardModifierItems", "x-heroscript-stability": "experimental",
        "parameters": [{"$ref": "#/components/parameters/RunId"}],
        "responses": {"200": {"description": "Catalog, immutable ownership and compatibility facts for visible cards.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CardModifierItemSnapshot"}}}}, "400": {"$ref": "#/components/responses/Problem"}}
      }
    },
    "/api/v1/runs/{runId}/card-modifier-items/{itemInstanceId}/preview/{cardInstanceId}": {
      "get": {
        "tags": ["Runs"], "operationId": "previewCardModifierItem", "x-heroscript-stability": "experimental",
        "parameters": [{"$ref": "#/components/parameters/RunId"}, {"name": "itemInstanceId", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "cardInstanceId", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}],
        "responses": {"200": {"description": "Before/after base facts and expected version. No candidate aggregate or mutation.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CardModifierItemPreview"}}}}, "400": {"$ref": "#/components/responses/Problem"}}
      }
    },
    "/api/v1/runs/{runId}/character-attributes": {
      "get": {
        "tags": ["Runs"], "operationId": "getCharacterAttributes", "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": {
          "200": { "description": "Read-only persistent player or active-encounter attribute projection. Does not consume RNG.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActorAttributesProjection" } } } },
          "400": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/actors/{actorId}/attributes": {
      "get": {
        "tags": ["Combats"], "operationId": "getActorAttributes", "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }, { "name": "actorId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "Versioned actor attributes calculated from the same providers as gameplay.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActorAttributesProjection" } } } },
          "400": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/runs/{runId}/cards/{cardInstanceId}/transformation-preview": {
      "get": {
        "tags": ["Runs"],
        "operationId": "previewCardTransformation",
        "x-heroscript-stability": "stable",
        "parameters": [
          { "$ref": "#/components/parameters/RunId" },
          { "name": "cardInstanceId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "operation", "in": "query", "schema": { "type": "string", "enum": ["Apply", "Remove", "Replace"], "default": "Apply" } },
          { "name": "transformationId", "in": "query", "schema": { "type": "integer", "format": "uint64" } },
          { "name": "upgradeId", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Read-only assessment including compatibility, before/after, costs and captured version. Incompatibility is an assessment, not a mutation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardTransformationAssessment" } } } },
          "400": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/health/live": {
      "get": {
        "tags": ["System"],
        "operationId": "getLiveness",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "Process is alive" } }
      }
    },
    "/api/v1/health/ready": {
      "get": {
        "tags": ["System"],
        "operationId": "getReadiness",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "Content and durable run store are ready" } }
      }
    },
    "/api/v1/version": {
      "get": {
        "tags": ["System"],
        "operationId": "getVersion",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "API and deterministic engine version" } }
      }
    },
    "/api/v1/capabilities": {
      "get": {
        "tags": ["System"],
        "operationId": "getCapabilities",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "Published capability list" } }
      }
    },
    "/api/v1/runs": {
      "get": {
        "tags": ["Runs"],
        "operationId": "listRuns",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "Persisted run summaries" } }
      },
      "post": {
        "tags": ["Runs"],
        "operationId": "startRun",
        "x-heroscript-stability": "stable",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunStartRequest" } } }
        },
        "responses": {
          "200": { "description": "Run created, or original creation state returned on retry", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunReadModel" } } } },
          "400": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/runs/{runId}": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRun",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": {
          "200": { "description": "Immutable run read model", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunReadModel" } } } },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/runs/{runId}/card-zones": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunCardZones",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": {
          "200": { "description": "Purpose-independent card-zone projection with visibility already applied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardZoneSnapshot" } } } },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/runs/{runId}/commands": {
      "post": {
        "tags": ["Runs"],
        "operationId": "executeRunCommand",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommandEnvelope" } } }
        },
        "responses": {
          "200": { "description": "Idempotent command result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommandResult" } } } },
          "409": { "$ref": "#/components/responses/Problem" },
          "422": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getCombat",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }],
        "responses": {
          "200": { "description": "Canonical actor/side combat snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatStateSnapshot" } } } },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/commands": {
      "post": {
        "tags": ["Combats"],
        "operationId": "executeCombatCommand",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommandEnvelope" } } }
        },
        "responses": {
          "200": { "description": "Idempotent command result with durable animation resolution", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatCommandResult" } } } },
          "409": { "$ref": "#/components/responses/Problem" },
          "422": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/legal-actions": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getLegalCombatActions",
        "x-heroscript-stability": "experimental",
        "parameters": [
          { "$ref": "#/components/parameters/CombatId" },
          { "name": "actorId", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Deterministically ordered legal commands with canonical resolution previews",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LegalActionSet" } } }
          },
          "400": { "$ref": "#/components/responses/Problem" },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/resolutions/{commandId}": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getCombatResolution",
        "x-heroscript-stability": "stable",
        "parameters": [
          { "$ref": "#/components/parameters/CombatId" },
          { "name": "commandId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": {
          "200": { "description": "Durable ordered animation frames produced by one accepted combat command", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatResolutionRecord" } } } },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/content/settings": {
      "get": {
        "tags": ["Content"],
        "operationId": "listPlayableSettings",
        "x-heroscript-stability": "stable",
        "responses": {
          "200": { "description": "Playable settings with display metadata, immutable current revision and canonical launch entry point" },
          "503": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/content/revisions": {
      "get": {
        "tags": ["Content"],
        "operationId": "listContentRevisions",
        "x-heroscript-stability": "stable",
        "responses": { "200": { "description": "Immutable content revision catalog" } }
      }
    },
    "/api/v1/content/revisions/{revision}": {
      "get": {
        "tags": ["Content"],
        "operationId": "getContentRevision",
        "x-heroscript-stability": "stable",
        "parameters": [{ "name": "revision", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Immutable content manifest" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/content/{kind}": {
      "get": {
        "tags": ["Content"],
        "operationId": "listContentDefinitions",
        "x-heroscript-stability": "stable",
        "parameters": [{ "name": "kind", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "revision", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Immutable revision returned by /content/revisions." }],
        "responses": { "200": { "description": "Definitions from one immutable revision" } }
      }
    },
    "/api/v1/content/{kind}/{definitionId}": {
      "get": {
        "tags": ["Content"],
        "operationId": "getContentDefinition",
        "x-heroscript-stability": "stable",
        "parameters": [{ "name": "kind", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "definitionId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "revision", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Immutable revision returned by /content/revisions." }],
        "responses": { "200": { "description": "One definition from an immutable revision" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/profiles/{playerId}": {
      "get": {
        "tags": ["System"],
        "operationId": "getProfileProjection",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "playerId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProfileSetting" }],
        "responses": { "200": { "description": "Setting-scoped history, progress proofs and read-only current catalog availability", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlayerProfileProjection" } } } }, "400": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/profiles/{playerId}/stats": {
      "get": {
        "tags": ["System"], "operationId": "getSettingProfileStats", "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "playerId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProfileSetting" }],
        "responses": { "200": { "description": "Statistics and revision scoped by playerId and settingId" }, "400": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/profiles/{playerId}/unlocks": {
      "get": {
        "tags": ["System"], "operationId": "getSettingProfileUnlocks", "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "playerId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProfileSetting" }],
        "responses": { "200": { "description": "Unlock IDs, progress sequence/revision, unlockProofs and availability for this player/setting; reads do not grant options" }, "400": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/profiles/{playerId}/achievements": {
      "get": {
        "tags": ["System"], "operationId": "getSettingProfileAchievements", "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "playerId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProfileSetting" }],
        "responses": { "200": { "description": "Achievements derived only from this setting's immutable runs" }, "400": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/profiles/{playerId}/runs": {
      "get": {
        "tags": ["System"], "operationId": "getSettingProfileRuns", "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "playerId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProfileSetting" }, { "name": "after", "in": "query", "schema": { "type": "string", "format": "uuid" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }],
        "responses": { "200": { "description": "Setting-filtered run page; cursor is applied after setting/player isolation" }, "400": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/challenges/daily/current": {
      "get": {
        "tags": ["System"],
        "operationId": "getCurrentDailyChallenge",
        "x-heroscript-stability": "experimental",
        "responses": { "200": { "description": "Daily seed, content revision and proof hash" } }
      }
    },
    "/api/v1/simulations": {
      "post": {
        "tags": ["Runs"],
        "operationId": "createSimulation",
        "x-heroscript-stability": "experimental",
        "responses": { "200": { "description": "Isolated deterministic simulation" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/simulations/{simulationId}": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getSimulation",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "simulationId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Simulation status, deterministic result hash and compact command timeline" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/simulations/{simulationId}/result": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getSimulationResult",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "name": "simulationId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Complete immutable simulation result" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/admin/content/drafts": {
      "post": {
        "tags": ["Content"],
        "operationId": "createContentDraft",
        "x-heroscript-stability": "admin",
        "security": [{ "AdminApiKey": [] }],
        "responses": { "201": { "description": "Mutable publication draft created" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/runs/{runId}/available-commands": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getAvailableRunCommands",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Commands allowed by the pinned immutable state" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/runs/{runId}/map": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunMap",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Pinned map and progression read model" } }
      }
    },
    "/api/v1/runs/{runId}/journal": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunJournal",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Durable, ordered command journal" } }
      }
    },
    "/api/v1/runs/{runId}/commits": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunCommits",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Authoritative commits with ordered frames, durable facts and revision provenance" } }
      }
    },
    "/api/v1/runs/{runId}/commits/{sequence}": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunCommit",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }, { "name": "sequence", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 } }],
        "responses": { "200": { "description": "One immutable authoritative commit including frames and facts" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/runs/{runId}/commits/{sequence}/presentation": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getReplayCommandPresentation",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }, { "name": "sequence", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 } }],
        "responses": { "200": { "description": "Canonical historical state summary and recorded dialogue; no gameplay mutation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplayCommandPresentation" } } } }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/runs/{runId}/timeline": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunTimeline",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" },
          { "name": "afterSequence", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 1000, "default": 200 } },
          { "name": "throughSequence", "in": "query", "schema": { "type": "integer", "minimum": 1 }, "description": "Pinned head returned on first page; pass it on subsequent pages." }],
        "responses": { "200": { "description": "Compact structural timeline, not semantic replay verification", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplayTimelinePage" } } } } }
      }
    },
    "/api/v1/runs/{runId}/branches": {
      "get": {
        "tags": ["Runs"],
        "operationId": "listRunBranches",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Direct deterministic child branches" } }
      },
      "post": {
        "tags": ["Runs"],
        "operationId": "createRunBranch",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "A deterministic branch from one historical sequence" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/runs/{runId}/branch-tree": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunBranchTree",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": {
          "200": { "description": "Immutable root-to-descendant run branch tree", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunBranchTreeNode" } } } },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/runs/{runId}/verify": {
      "post": {
        "tags": ["Runs"],
        "operationId": "verifyRunReplay",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Semantic replay verification result" } }
      }
    },
    "/api/v1/combats/{combatId}/cards/{cardInstanceId}/evaluation": {
      "get": {
        "tags": ["Combats"],
        "operationId": "evaluateCombatCard",
        "x-heroscript-stability": "experimental",
        "parameters": [
          { "$ref": "#/components/parameters/CombatId" },
          { "name": "cardInstanceId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "actorId", "in": "query", "schema": { "type": "string" } },
          { "name": "targetIds", "in": "query", "schema": { "type": "array", "items": { "type": "string" } } },
          { "name": "costOptionId", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Pinned card container, legal-play evaluation and deterministic resolution preview", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardInspectionResult" } } } },
          "400": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/cards/evaluations": {
      "get": {
        "tags": ["Combats"],
        "operationId": "evaluateCombatHand",
        "x-heroscript-stability": "experimental",
        "parameters": [
          { "$ref": "#/components/parameters/CombatId" },
          { "name": "actorId", "in": "query", "schema": { "type": "string" } },
          { "name": "targetIds", "in": "query", "schema": { "type": "array", "items": { "type": "string" } } },
          { "name": "costOptionId", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "One card evaluation for every instance in an authored playable zone for the selected actor", "content": { "application/json": { "schema": { "type": "object", "properties": { "combatId": { "type": "string", "format": "uuid" }, "cards": { "type": "array", "items": { "$ref": "#/components/schemas/CardInspectionResult" } } } } } } },
          "400": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/history": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getCombatHistory",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }],
        "responses": { "200": { "description": "Resolved combat action history" } }
      }
    },
    "/api/v1/combats/{combatId}/journal": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getCombatJournal",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }],
        "responses": { "200": { "description": "Combat commands filtered from the durable run journal" } }
      }
    },
    "/api/v1/combats/{combatId}/timeline": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getCombatTimeline",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }, { "name": "afterSequence", "in": "query", "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1 } }],
        "responses": {
          "200": {
            "description": "Policy-governed combat command timeline and turn groups",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatTimelinePage" } } }
          },
          "422": { "$ref": "#/components/responses/Problem" }
        }
      }
    },
    "/api/v1/combats/{combatId}/timeline/{sequence}/state": {
      "get": {
        "tags": ["Combats"],
        "operationId": "getHistoricalCombatTimelineState",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }, { "name": "sequence", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 } }],
        "responses": { "200": { "description": "Immutable historical state selected by a combat timeline item" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/combats/{combatId}/timeline/{sequence}/branches": {
      "post": {
        "tags": ["Combats"],
        "operationId": "createCombatTimelineBranch",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }, { "name": "sequence", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 } }],
        "responses": { "200": { "description": "Independent child run and combat anchored at a historical combat state" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/combats/{combatId}/verify": {
      "post": {
        "tags": ["Combats"],
        "operationId": "verifyCombatReplay",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/CombatId" }],
        "responses": { "200": { "description": "Combat projection verified against run semantic replay" } }
      }
    },
    "/api/v1/runs/{runId}/events": {
      "get": {
        "tags": ["Runs"],
        "operationId": "getRunEvents",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }, { "name": "afterSequence", "in": "query", "schema": { "type": "integer", "minimum": 0 } }],
        "responses": { "200": { "description": "Durable event projection page" } }
      }
    },
    "/api/v1/runs/{runId}/events/stream": {
      "get": {
        "tags": ["Runs"],
        "operationId": "streamRunEvents",
        "x-heroscript-stability": "stable",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }, { "name": "afterSequence", "in": "query", "schema": { "type": "integer", "minimum": 0 } }],
        "responses": { "200": { "description": "SSE stream; see AsyncAPI contract", "content": { "text/event-stream": { "schema": { "type": "string" } } } } }
      }
    },
    "/api/v1/sandbox/scenarios/validate": {
      "post": {
        "tags": ["Sandbox"],
        "operationId": "validateCombatScenario",
        "x-heroscript-stability": "experimental",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatScenarioDefinition" } } } },
        "responses": { "200": { "description": "Normalized, validated scenario and deterministic scenario hash" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/sandbox/runs": {
      "post": {
        "tags": ["Sandbox"],
        "operationId": "launchCombatScenario",
        "x-heroscript-stability": "experimental",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CombatScenarioDefinition" } } } },
        "responses": { "200": { "description": "Idempotent scenario run and active combat launch" }, "422": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/sandbox/runs/{runId}/scenario": {
      "get": {
        "tags": ["Sandbox"],
        "operationId": "getCombatScenario",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": { "200": { "description": "Persisted normalized scenario input" }, "404": { "$ref": "#/components/responses/Problem" } }
      }
    },
    "/api/v1/sandbox/runs/{runId}/snapshot": {
      "get": {
        "tags": ["Sandbox"],
        "operationId": "getCombatSandboxSnapshot",
        "x-heroscript-stability": "experimental",
        "parameters": [{ "$ref": "#/components/parameters/RunId" }],
        "responses": {
          "200": {
            "description": "Consolidated read-only run, combat, actor and card-instance projection",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxCombatSnapshot" } } }
          },
          "404": { "$ref": "#/components/responses/Problem" }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "ProfileSetting": { "name": "settingId", "in": "query", "required": true, "description": "Permanent progress is isolated by playerId and settingId; no implicit global profile.", "schema": { "type": "string", "minLength": 1 } },
      "RunId": { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
      "CombatId": { "name": "combatId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }
    },
    "responses": {
      "Problem": {
        "description": "RFC 9457 problem response",
        "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } }
      }
    },
    "securitySchemes": {
      "AdminApiKey": { "type": "apiKey", "in": "header", "name": "X-Admin-Key" }
    },
    "schemas": {
      "ActorActivationCadence": {
        "type": "object",
        "properties": {
          "anchorActorId": {
            "type": "string",
            "nullable": true
          },
          "every": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ActorSupportLoadout": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "supportId": {
            "type": "string",
            "nullable": true
          },
          "routineId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ControllerKind": {
        "enum": [
          "Player",
          "AI",
          "None"
        ],
        "type": "string"
      },
      "EquipSupportCommand": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "supportId": {
            "type": "string",
            "nullable": true
          },
          "routineId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SupportCatalogEntry": {
        "type": "object",
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/SupportDefinition"
          },
          "routines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportRoutineDefinition"
            }
          }
        },
        "additionalProperties": false
      },
      "SupportCombatView": {
        "type": "object",
        "properties": {
          "participantId": {
            "type": "string",
            "nullable": true
          },
          "remainingOwnerActivations": {
            "type": "integer",
            "format": "int32"
          },
          "eligible": {
            "type": "boolean"
          },
          "ownerAvailable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "SupportDefinition": {
        "required": [
          "countsForOutcome"
        ],
        "type": "object",
        "properties": {
          "supportId": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "countsForOutcome": {
            "type": "boolean"
          },
          "ownerActivationInterval": {
            "type": "integer",
            "format": "int32"
          },
          "entityDefinitionId": {
            "type": "string",
            "nullable": true
          },
          "routineIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultRoutineId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SupportInventoryScope": {
        "enum": [
          "Actor",
          "Run"
        ],
        "type": "string"
      },
      "SupportLoadoutPolicyDefinition": {
        "type": "object",
        "properties": {
          "policyId": {
            "type": "string",
            "nullable": true
          },
          "editWindows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoadoutEquipmentWindow"
            }
          },
          "supportIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startingSupportId": {
            "type": "string",
            "nullable": true
          },
          "revisionMigration": {
            "$ref": "#/components/schemas/LoadoutRevisionMigration"
          },
          "inventoryScope": {
            "$ref": "#/components/schemas/SupportInventoryScope"
          },
          "startingOwnedSupportIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "SupportLoadoutPreview": {
        "type": "object",
        "properties": {
          "before": {
            "$ref": "#/components/schemas/SupportLoadoutSnapshot"
          },
          "after": {
            "$ref": "#/components/schemas/SupportLoadoutSnapshot"
          }
        },
        "additionalProperties": false
      },
      "SupportLoadoutPreviewRequest": {
        "type": "object",
        "properties": {
          "expectedSequence": {
            "type": "integer",
            "format": "int32"
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64"
          },
          "equipment": {
            "$ref": "#/components/schemas/EquipSupportCommand"
          }
        },
        "additionalProperties": false
      },
      "SupportLoadoutSnapshot": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "settingId": {
            "type": "string",
            "nullable": true
          },
          "runSequence": {
            "type": "integer",
            "format": "int32"
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64"
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean"
          },
          "canChange": {
            "type": "boolean"
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true
          },
          "policy": {
            "$ref": "#/components/schemas/SupportLoadoutPolicyDefinition"
          },
          "selection": {
            "$ref": "#/components/schemas/ActorSupportLoadout"
          },
          "owned": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportCatalogEntry"
            }
          },
          "combat": {
            "$ref": "#/components/schemas/SupportCombatView"
          }
        },
        "additionalProperties": false
      },
      "SupportRoutineDefinition": {
        "type": "object",
        "properties": {
          "routineId": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "gambitIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "AccumulatedStackReference": {
        "type": "object",
        "properties": {
          "store": {
            "$ref": "#/components/schemas/EffectStackStore"
          },
          "owner": {
            "$ref": "#/components/schemas/GameplayOwner"
          },
          "instanceId": {
            "type": "string",
            "format": "uuid"
          },
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "stacks": {
            "type": "integer",
            "format": "int32"
          },
          "duration": {
            "type": "integer",
            "format": "int32"
          },
          "sourceEntityId": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stateFingerprint": {
            "type": "string",
            "nullable": true
          },
          "payloadLots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StackPayloadLot"
            }
          }
        },
        "additionalProperties": false
      },
      "ActionType": {
        "enum": [
          "BASIC_ATTACK",
          "POWER",
          "PASS",
          "END_TURN",
          "TRANSITION_PHASE",
          "PASS_PRIORITY",
          "DECLARE_ATTACKER",
          "DECLARE_BLOCKER",
          "PLAY_INSTANT",
          "ACTIVATE_ABILITY",
          "PLAY_CARD"
        ],
        "type": "string"
      },
      "AttributeMutationOutcome": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "valueId": {
            "type": "string",
            "nullable": true
          },
          "operation": {
            "$ref": "#/components/schemas/AttributeOperation"
          },
          "lifetime": {
            "$ref": "#/components/schemas/AttributeLifetime"
          },
          "previousValue": {
            "type": "number",
            "format": "float"
          },
          "currentValue": {
            "type": "number",
            "format": "float"
          }
        },
        "additionalProperties": false
      },
      "CalculationQuantity": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "float"
          },
          "unitId": {
            "type": "string",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "calculationFingerprint": {
            "type": "string",
            "nullable": true
          },
          "incorporatedStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalculationStageReceipt"
            }
          }
        },
        "additionalProperties": false
      },
      "CalculationStageReceipt": {
        "type": "object",
        "properties": {
          "pipelineId": {
            "type": "string",
            "nullable": true
          },
          "pipelineFingerprint": {
            "type": "string",
            "nullable": true
          },
          "stageId": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "$ref": "#/components/schemas/CalculationStageScope"
          },
          "contextId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CalculationStageScope": {
        "enum": [
          "Shared",
          "Actor",
          "Target"
        ],
        "type": "string"
      },
      "CardConditionTrace": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "expression": {
            "type": "string",
            "nullable": true
          },
          "passed": {
            "type": "boolean"
          },
          "failureReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CardInspectionVersion": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "combatId": {
            "type": "string",
            "format": "uuid"
          },
          "runSequence": {
            "type": "integer",
            "format": "int32"
          },
          "runStep": {
            "type": "integer",
            "format": "int64"
          },
          "combatStep": {
            "type": "integer",
            "format": "int64"
          },
          "configName": {
            "type": "string",
            "nullable": true
          },
          "modeId": {
            "type": "string",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "engineVersion": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CardPaymentOrder": {
        "enum": [
          "SourceOrder",
          "ChosenOrder"
        ],
        "type": "string"
      },
      "CardPaymentPreview": {
        "type": "object",
        "properties": {
          "version": {
            "$ref": "#/components/schemas/CardInspectionVersion"
          },
          "command": {
            "$ref": "#/components/schemas/CombatGameplayCommand"
          },
          "isLegal": {
            "type": "boolean"
          },
          "evaluation": {
            "$ref": "#/components/schemas/CardPlayEvaluation"
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardPresentationFacts"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EffectApplicationRecord"
            }
          },
          "outcomeUncertain": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CardPaymentPreviewRequest": {
        "type": "object",
        "properties": {
          "expectedSequence": {
            "type": "integer",
            "format": "int32"
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64"
          },
          "command": {
            "$ref": "#/components/schemas/CombatGameplayCommand"
          }
        },
        "additionalProperties": false
      },
      "CardPaymentRequirement": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "paymentId": {
            "type": "string",
            "nullable": true
          },
          "costOptionId": {
            "type": "string",
            "nullable": true
          },
          "sourceZoneId": {
            "type": "string",
            "nullable": true
          },
          "targetZoneId": {
            "type": "string",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "allowResolvingCard": {
            "type": "boolean"
          },
          "order": {
            "$ref": "#/components/schemas/CardPaymentOrder"
          },
          "eligibleCardIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CardPaymentSelection": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "paymentId": {
            "type": "string",
            "nullable": true
          },
          "cardInstanceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "additionalProperties": false
      },
      "CardPlayEvaluation": {
        "type": "object",
        "properties": {
          "cardInstanceId": {
            "type": "string",
            "format": "uuid"
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "isLegal": {
            "type": "boolean"
          },
          "paymentRequirements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardPaymentRequirement"
            },
            "nullable": true
          },
          "zonePayments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedCardZonePayment"
            },
            "nullable": true
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardConditionTrace"
            },
            "nullable": true
          },
          "costs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedCardCost"
            },
            "nullable": true
          },
          "affordableCostOptionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "legalTargetIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "resolvedTargetIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "cardZoneResolutionFlowId": {
            "type": "string",
            "nullable": true
          },
          "failureReasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CardZoneOperation": {
        "enum": [
          "Unspecified",
          "Create",
          "Move",
          "Destroy",
          "Shuffle",
          "Reorder",
          "ExecuteFlow",
          "ForEachParticipant"
        ],
        "type": "string"
      },
      "CombatActionCommand": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "actionType": {
            "$ref": "#/components/schemas/ActionType"
          },
          "powerId": {
            "type": "string",
            "nullable": true
          },
          "targetId": {
            "type": "string",
            "nullable": true
          },
          "costOptionId": {
            "type": "string",
            "nullable": true
          },
          "paymentSelections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardPaymentSelection"
            },
            "nullable": true
          },
          "runId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "cardInstanceId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "targetIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "ignoreConfiguredCosts": {
            "type": "boolean"
          },
          "deferTurnLifecycle": {
            "type": "boolean"
          },
          "runModifiers": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "float"
            },
            "nullable": true
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CombatGameplayCommand": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "actionType": {
            "$ref": "#/components/schemas/ActionType"
          },
          "powerId": {
            "type": "string",
            "nullable": true
          },
          "targetId": {
            "type": "string",
            "nullable": true
          },
          "targetIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "costOptionId": {
            "type": "string",
            "nullable": true
          },
          "cardInstanceId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "paymentSelections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardPaymentSelection"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CondensationEvaluationTiming": {
        "enum": [
          "BeforeConsumption",
          "AfterConsumption"
        ],
        "type": "string"
      },
      "CondensationOutcome": {
        "type": "object",
        "properties": {
          "selection": {
            "$ref": "#/components/schemas/StackConsumptionPlan"
          },
          "evaluationTiming": {
            "$ref": "#/components/schemas/CondensationEvaluationTiming"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CalculationQuantity"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EffectExecutionIdentity": {
        "type": "object",
        "properties": {
          "executionId": {
            "type": "string",
            "nullable": true
          },
          "procId": {
            "type": "string",
            "nullable": true
          },
          "impactId": {
            "type": "string",
            "nullable": true
          },
          "parentProcId": {
            "type": "string",
            "nullable": true
          },
          "parentImpactId": {
            "type": "string",
            "nullable": true
          },
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "outputId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EffectProvenance": {
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/EffectProvenanceKind"
          },
          "sourceId": {
            "type": "string",
            "nullable": true
          },
          "componentId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EffectProvenanceKind": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "type": "integer",
        "format": "int32"
      },
      "EffectResourceOutcome": {
        "type": "object",
        "properties": {
          "requestedValue": {
            "type": "number",
            "format": "float"
          },
          "previousValue": {
            "type": "number",
            "format": "float"
          },
          "currentValue": {
            "type": "number",
            "format": "float"
          },
          "requestedChange": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "appliedChange": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "limitedChange": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "ownerDefeatedBefore": {
            "type": "boolean"
          },
          "ownerDefeatedAfter": {
            "type": "boolean"
          },
          "causedDefeat": {
            "type": "boolean",
            "readOnly": true
          },
          "thresholdFacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceThresholdFact"
            }
          }
        },
        "additionalProperties": false
      },
      "EffectStackChange": {
        "type": "object",
        "properties": {
          "store": {
            "$ref": "#/components/schemas/EffectStackStore"
          },
          "instanceId": {
            "type": "string",
            "format": "uuid"
          },
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "owner": {
            "$ref": "#/components/schemas/GameplayOwner"
          },
          "previousStacks": {
            "type": "integer",
            "format": "int32"
          },
          "currentStacks": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "$ref": "#/components/schemas/EffectStackChangeReason"
          },
          "removed": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "EffectStackChangeReason": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5
        ],
        "type": "integer",
        "format": "int32"
      },
      "EffectStackStore": {
        "enum": [
          0,
          1
        ],
        "type": "integer",
        "format": "int32"
      },
      "GameplayCausalAnchor": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "nullable": true
          },
          "rootEventId": {
            "type": "string",
            "nullable": true
          },
          "settingId": {
            "type": "string",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "runId": {
            "type": "string",
            "nullable": true
          },
          "branchId": {
            "type": "string",
            "nullable": true
          },
          "actionId": {
            "type": "string",
            "nullable": true
          },
          "sourceActorId": {
            "type": "string",
            "nullable": true
          },
          "attributedActorId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResolvedCardZonePayment": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "paymentId": {
            "type": "string",
            "nullable": true
          },
          "flowId": {
            "type": "string",
            "nullable": true
          },
          "cardInstanceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "includesResolvingCard": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ResourceMutationOperation": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      },
      "ResourceThresholdComparison": {
        "enum": [
          "Unspecified",
          "LessThan",
          "LessThanOrEqual",
          "Equal",
          "NotEqual",
          "GreaterThanOrEqual",
          "GreaterThan"
        ],
        "type": "string"
      },
      "ResourceThresholdConsequence": {
        "enum": [
          "Unspecified",
          "None",
          "DefeatOwner"
        ],
        "type": "string"
      },
      "ResourceThresholdFact": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "nullable": true
          },
          "policyId": {
            "type": "string",
            "nullable": true
          },
          "comparison": {
            "$ref": "#/components/schemas/ResourceThresholdComparison"
          },
          "thresholdSource": {
            "$ref": "#/components/schemas/ResourceThresholdSource"
          },
          "consequence": {
            "$ref": "#/components/schemas/ResourceThresholdConsequence"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "value": {
            "type": "number",
            "format": "float"
          },
          "threshold": {
            "type": "number",
            "format": "float"
          }
        },
        "additionalProperties": false
      },
      "ResourceThresholdSource": {
        "enum": [
          "Unspecified",
          "Minimum",
          "Maximum",
          "Constant"
        ],
        "type": "string"
      },
      "StackConsumptionPlan": {
        "type": "object",
        "properties": {
          "recipeId": {
            "type": "string",
            "nullable": true
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccumulatedStackReference"
            }
          }
        },
        "additionalProperties": false
      },
      "StackMissingSourcePolicy": {
        "enum": [
          "Fail",
          "SkipContribution",
          "UseOwner"
        ],
        "type": "string"
      },
      "StackParameterEvaluation": {
        "enum": [
          "Snapshot",
          "Dynamic"
        ],
        "type": "string"
      },
      "StackPayloadLot": {
        "type": "object",
        "properties": {
          "originCause": {
            "$ref": "#/components/schemas/GameplayCausalAnchor"
          },
          "lotId": {
            "type": "string",
            "nullable": true
          },
          "stacks": {
            "type": "integer",
            "format": "int32"
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "sourceEntityId": {
            "type": "string",
            "nullable": true
          },
          "ownerEntityId": {
            "type": "string",
            "nullable": true
          },
          "origin": {
            "$ref": "#/components/schemas/EffectProvenance"
          },
          "cardInstanceId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "cardDefinitionId": {
            "type": "string",
            "nullable": true
          },
          "cardFingerprint": {
            "type": "string",
            "nullable": true
          },
          "cardInfluences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardInfluenceComponentDefinition"
            }
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "float"
            },
            "nullable": true
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/StackPayloadParameterState"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StackPayloadParameterDefinition": {
        "type": "object",
        "properties": {
          "parameterId": {
            "type": "string",
            "nullable": true
          },
          "evaluation": {
            "$ref": "#/components/schemas/StackParameterEvaluation"
          },
          "missingSource": {
            "$ref": "#/components/schemas/StackMissingSourcePolicy"
          },
          "numeric": {
            "$ref": "#/components/schemas/EffectNumericParameterDefinition"
          }
        },
        "additionalProperties": false
      },
      "StackPayloadParameterState": {
        "type": "object",
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/StackPayloadParameterDefinition"
          },
          "snapshot": {
            "$ref": "#/components/schemas/CalculationQuantity"
          },
          "tags": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
    "ActionCosts": {
      "type": "object",
      "properties": {
        "costs": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ResourceCost"
          },
          "nullable": true
        },
        "alternativeCosts": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/AlternativeCostOption"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "ActorDeckLoadoutState": {
      "type": "object",
      "properties": {
        "actorId": {
          "type": "string",
          "nullable": true
        },
        "policyId": {
          "type": "string",
          "nullable": true
        },
        "groups": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "nullable": true
        },
        "modules": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "AlternativeCostOption": {
      "type": "object",
      "properties": {
        "optionId": {
          "type": "string",
          "nullable": true
        },
        "description": {
          "type": "string",
          "nullable": true
        },
        "costs": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ResourceCost"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "AttributeLifetime": {
      "enum": [
        "Encounter",
        "RunBase"
      ],
      "type": "string"
    },
    "AttributeMutationDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "valueId": {
          "type": "string",
          "nullable": true
        },
        "operation": {
          "$ref": "#/components/schemas/AttributeOperation"
        },
        "lifetime": {
          "$ref": "#/components/schemas/AttributeLifetime"
        }
      },
      "additionalProperties": false
    },
    "AttributeOperation": {
      "enum": [
        "Add",
        "Multiply",
        "Set"
      ],
      "type": "string"
    },
    "CalculationBucketOperation": {
      "enum": [
        "Add",
        "AddPercent",
        "Multiply",
        "Set",
        "Minimum",
        "Maximum",
        "ConsumeCapacity",
        "Formula"
      ],
      "type": "string"
    },
    "CalculationGroupTrace": {
      "type": "object",
      "required": ["key", "raw", "transformed", "weight", "effective"],
      "properties": {
        "key": { "type": "string" },
        "raw": { "type": "number" },
        "transformed": { "type": "number" },
        "weight": { "type": "number" },
        "effective": { "type": "number" },
        "parameters": { "type": "object", "additionalProperties": { "type": "number" } }
      },
      "additionalProperties": false
    },
    "CalculationBucketTrace": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "description": "Present when this bucket uses grouped evaluation.",
          "items": { "$ref": "#/components/schemas/CalculationGroupTrace" }
        },
        "bucketId": {
          "type": "string",
          "nullable": true
        },
        "stageId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "operation": {
          "$ref": "#/components/schemas/CalculationBucketOperation"
        },
        "formula": {
          "type": "string",
          "nullable": true
        },
        "input": {
          "type": "number",
          "format": "float"
        },
        "contributions": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CalculationContributionTrace"
          },
          "nullable": true
        },
        "outputBeforeBounds": {
          "type": "number",
          "format": "float"
        },
        "output": {
          "type": "number",
          "format": "float"
        }
      },
      "additionalProperties": false
    },
    "CalculationContributionTrace": {
      "type": "object",
      "properties": {
        "influenceId": {
          "type": "string",
          "nullable": true
        },
        "sourceKind": {
          "$ref": "#/components/schemas/CalculationSourceKind"
        },
        "sourceId": {
          "type": "string",
          "nullable": true
        },
        "value": {
          "type": "number",
          "format": "float"
        },
        "priority": {
          "type": "integer",
          "format": "int32"
        },
        "orderKey": {
          "type": "string",
          "nullable": true
        },
        "applied": {
          "type": "boolean"
        },
        "input": {
          "type": "number",
          "format": "float"
        },
        "effectiveValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "output": {
          "type": "number",
          "format": "float"
        }
      },
      "additionalProperties": false
    },
    "CalculationDistributionMode": {
      "enum": [
        "Continuous",
        "Quantized"
      ],
      "type": "string"
    },
    "CalculationDistributionPolicy": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/components/schemas/CalculationDistributionMode"
        },
        "quantum": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "remainderAllocation": {
          "$ref": "#/components/schemas/CalculationRemainderAllocation"
        },
        "allowTargetScopedInput": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "CalculationMidpointRounding": {
      "enum": [
        "ToEven",
        "AwayFromZero",
        "ToZero",
        "ToNegativeInfinity",
        "ToPositiveInfinity"
      ],
      "type": "string"
    },
    "CalculationRemainderAllocation": {
      "enum": [
        "Earliest",
        "Latest"
      ],
      "type": "string"
    },
    "CalculationRounding": {
      "enum": [
        "None",
        "Floor",
        "Ceiling",
        "Round"
      ],
      "type": "string"
    },
    "CalculationSignPolicy": {
      "enum": [
        "Any",
        "NonNegative",
        "Positive"
      ],
      "type": "string"
    },
    "CalculationSourceKind": {
      "enum": [
        "Effect",
        "Card",
        "Actor",
        "Target",
        "Status",
        "Relic",
        "Upgrade",
        "GameMode",
        "Encounter",
        "Modifier",
        "Inscription"
      ],
      "type": "string"
    },
    "CalculationValuePolicy": {
      "type": "object",
      "properties": {
        "rounding": {
          "$ref": "#/components/schemas/CalculationRounding"
        },
        "midpointRounding": {
          "$ref": "#/components/schemas/CalculationMidpointRounding"
        },
        "sign": {
          "$ref": "#/components/schemas/CalculationSignPolicy"
        },
        "requireInteger": {
          "type": "boolean"
        },
        "minimum": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "maximum": {
          "type": "number",
          "format": "float",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardCalculationSource": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/components/schemas/CalculationSourceKind"
        },
        "instanceId": {
          "type": "string",
          "nullable": true
        },
        "definitionId": {
          "type": "string",
          "nullable": true
        },
        "attributeId": {
          "type": "string",
          "nullable": true
        },
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "bucket": {
          "type": "string",
          "nullable": true
        },
        "value": {
          "type": "number",
          "format": "float"
        },
        "applied": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "CardComponentContributionTrace": {
      "type": "object",
      "properties": {
        "sourceId": {
          "type": "string",
          "nullable": true
        },
        "contentRevision": {
          "type": "string",
          "nullable": true
        },
        "componentIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "nameKey": {
          "type": "string",
          "nullable": true
        },
        "descriptionKey": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardConditionComponentDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "capabilityIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "expression": {
          "type": "string",
          "nullable": true
        },
        "failureReason": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardCostPresentation": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "costs": {
          "$ref": "#/components/schemas/ActionCosts"
        }
      },
      "additionalProperties": false
    },
    "CardDispositionComponentDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "capabilityIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "cardZoneResolutionFlowId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardEffectPresentation": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "effectPath": {
          "type": "string",
          "nullable": true
        },
        "parentEffectPath": {
          "type": "string",
          "nullable": true
        },
        "boundary": {
          "type": "string",
          "nullable": true
        },
        "definition": {
          "$ref": "#/components/schemas/EffectDefinition"
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardParameterPresentation"
          }
        }
      },
      "additionalProperties": false
    },
    "CardEffectRuleOverrideComponentDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "capabilityIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "rule": {
          "$ref": "#/components/schemas/EffectRuleOverrideDefinition"
        }
      },
      "additionalProperties": false
    },
    "CardFaceValueMode": {
      "enum": [
        "ComposedBase",
        "Source"
      ],
      "type": "string"
    },
    "CardImpactExplanation": {
      "type": "object",
      "properties": {
        "impactId": {
          "type": "string",
          "nullable": true
        },
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "targetEntityId": {
          "type": "string",
          "nullable": true
        },
        "validity": {
          "type": "string",
          "nullable": true
        },
        "applied": {
          "type": "boolean"
        },
        "skipReason": {
          "type": "string",
          "nullable": true
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardImpactParameterExplanation"
          }
        }
      },
      "additionalProperties": false
    },
    "CardImpactParameterExplanation": {
      "type": "object",
      "properties": {
        "parameter": {
          "$ref": "#/components/schemas/EffectNumericParameter"
        },
        "unitId": {
          "type": "string",
          "nullable": true
        },
        "value": {
          "type": "number",
          "format": "float"
        },
        "buckets": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CalculationBucketTrace"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardCalculationSource"
          }
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "CardInfluenceComponentDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "capabilityIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "channel": {
          "type": "string",
          "nullable": true
        },
        "bucket": {
          "type": "string",
          "nullable": true
        },
        "value": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "formula": {
          "type": "string",
          "nullable": true
        },
        "priority": {
          "type": "integer",
          "format": "int32"
        },
        "requiredTags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "excludedTags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardNumericPatchOperation": {
      "enum": [
        "Add",
        "Multiply",
        "Set"
      ],
      "type": "string"
    },
    "CardParameterPresentation": {
      "type": "object",
      "properties": {
        "parameter": {
          "$ref": "#/components/schemas/EffectNumericParameter"
        },
        "values": {
          "$ref": "#/components/schemas/CardNumericLayers"
        }
      },
      "additionalProperties": false
    },
    "CardPresentationIdentity": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/components/schemas/CardPresentationSubjectKind"
        },
        "definitionId": {
          "type": "string",
          "nullable": true
        },
        "cardInstanceId": {
          "type": "string",
          "format": "uuid",
          "nullable": true
        },
        "offerId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardPresentationSubjectKind": {
      "enum": [
        "Definition",
        "Offer",
        "Instance",
        "Transformation"
      ],
      "type": "string"
    },
    "CardPresentationVersion": {
      "type": "object",
      "properties": {
        "contentRevision": {
          "type": "string",
          "nullable": true
        },
        "definitionFingerprint": {
          "type": "string",
          "nullable": true
        },
        "compositionFingerprint": {
          "type": "string",
          "nullable": true
        },
        "runId": {
          "type": "string",
          "format": "uuid",
          "nullable": true
        },
        "runSequence": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "combatId": {
          "type": "string",
          "format": "uuid",
          "nullable": true
        },
        "combatStep": {
          "type": "integer",
          "format": "int64",
          "nullable": true
        },
        "actorId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardRarity": {
      "enum": [
        "Common",
        "Uncommon",
        "Rare",
        "Legendary"
      ],
      "type": "string"
    },
    "CardRuleInfluence": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "nullable": true
        },
        "value": {
          "type": "number",
          "format": "float",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardTargetingComponentDefinition": {
      "type": "object",
      "properties": {
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "capabilityIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "relativeOffset": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "target": {
          "$ref": "#/components/schemas/EffectTarget"
        },
        "minimumTargets": {
          "type": "integer",
          "format": "int32"
        },
        "maximumTargets": {
          "type": "integer",
          "format": "int32"
        },
        "allowSelf": {
          "type": "boolean"
        },
        "selectionResourceId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardTransformationCategory": {
      "enum": [
        "Base",
        "Affinity",
        "Behavior"
      ],
      "type": "string"
    },
    "CardUpgradeApplicationTrace": {
      "type": "object",
      "properties": {
        "transformationId": {
          "type": "integer",
          "format": "int64"
        },
        "category": {
          "$ref": "#/components/schemas/CardTransformationCategory"
        },
        "upgradeId": {
          "type": "string",
          "nullable": true
        },
        "componentId": {
          "type": "string",
          "nullable": true
        },
        "attribute": {
          "type": "string",
          "nullable": true
        },
        "operation": {
          "$ref": "#/components/schemas/CardNumericPatchOperation"
        },
        "previousValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "currentValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "previousChoice": {
          "type": "string",
          "nullable": true
        },
        "currentChoice": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "CardValueExplanation": {
      "type": "object",
      "properties": {
        "effectPath": {
          "type": "string",
          "nullable": true
        },
        "parameter": {
          "$ref": "#/components/schemas/EffectNumericParameter"
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardScalingAttribute"
          }
        },
        "buckets": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CalculationBucketTrace"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardCalculationSource"
          }
        },
        "contextTags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "conditionPassed": {
          "type": "boolean",
          "nullable": true
        },
        "conditionExpression": {
          "type": "string",
          "nullable": true
        },
        "validity": {
          "type": "string",
          "nullable": true
        },
        "truncated": {
          "type": "boolean"
        },
        "unresolvedReason": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "DeckCompositionGroupDefinition": {
      "required": [
        "allowDuplicateDefinitions",
        "maximum",
        "minimum"
      ],
      "type": "object",
      "properties": {
        "groupId": {
          "type": "string",
          "nullable": true
        },
        "minimum": {
          "type": "integer",
          "format": "int32"
        },
        "maximum": {
          "type": "integer",
          "format": "int32"
        },
        "allowDuplicateDefinitions": {
          "type": "boolean"
        },
        "cardIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startingCardIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "moduleIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startingModuleId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "DeckCompositionPolicyDefinition": {
      "type": "object",
      "properties": {
        "policyId": {
          "type": "string",
          "nullable": true
        },
        "revisionMigration": {
          "$ref": "#/components/schemas/LoadoutRevisionMigration"
        },
        "editWindows": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/LoadoutEquipmentWindow"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/DeckCompositionGroupDefinition"
          }
        }
      },
      "additionalProperties": false
    },
    "DeckLoadoutCardView": {
      "type": "object",
      "properties": {
        "cardInstanceId": {
          "type": "string",
          "format": "uuid"
        },
        "definitionId": {
          "type": "string",
          "nullable": true
        },
        "groupId": {
          "type": "string",
          "nullable": true
        },
        "presentation": {
          "$ref": "#/components/schemas/CardPresentationFacts"
        }
      },
      "additionalProperties": false
    },
    "DeckLoadoutEdit": {
      "type": "object",
      "properties": {
        "actorId": {
          "type": "string",
          "nullable": true
        },
        "groupId": {
          "type": "string",
          "nullable": true
        },
        "replacedCardId": {
          "type": "string",
          "format": "uuid",
          "nullable": true
        },
        "replacementCardId": {
          "type": "string",
          "format": "uuid",
          "nullable": true
        },
        "moduleId": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "DeckLoadoutPreview": {
      "type": "object",
      "properties": {
        "before": {
          "$ref": "#/components/schemas/DeckLoadoutSnapshot"
        },
        "after": {
          "$ref": "#/components/schemas/DeckLoadoutSnapshot"
        }
      },
      "additionalProperties": false
    },
    "DeckLoadoutPreviewRequest": {
      "type": "object",
      "properties": {
        "expectedSequence": {
          "type": "integer",
          "format": "int32"
        },
        "expectedStep": {
          "type": "integer",
          "format": "int64"
        },
        "edit": {
          "$ref": "#/components/schemas/DeckLoadoutEdit"
        }
      },
      "additionalProperties": false
    },
    "DeckLoadoutSnapshot": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "format": "uuid"
        },
        "settingId": {
          "type": "string",
          "nullable": true
        },
        "runSequence": {
          "type": "integer",
          "format": "int32"
        },
        "expectedStep": {
          "type": "integer",
          "format": "int64"
        },
        "contentRevision": {
          "type": "string",
          "nullable": true
        },
        "actorId": {
          "type": "string",
          "nullable": true
        },
        "enabled": {
          "type": "boolean"
        },
        "canChange": {
          "type": "boolean"
        },
        "unavailableReason": {
          "type": "string",
          "nullable": true
        },
        "policy": {
          "$ref": "#/components/schemas/DeckCompositionPolicyDefinition"
        },
        "selection": {
          "$ref": "#/components/schemas/ActorDeckLoadoutState"
        },
        "cards": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/DeckLoadoutCardView"
          }
        }
      },
      "additionalProperties": false
    },
    "DispelOrder": {
      "enum": [
        "InstanceId",
        "OldestFirst",
        "NewestFirst",
        "HighestPriorityFirst"
      ],
      "type": "string"
    },
    "EffectChanceScope": {
      "enum": [
        "PerEffect",
        "PerTarget",
        "PerSequence",
        "PerAction",
        "PerProc"
      ],
      "type": "string"
    },
    "EffectChildTiming": {
      "enum": [
        "AfterParentImpact",
        "BeforeParentImpact"
      ],
      "type": "string"
    },
    "EffectContinuationDefinition": {
      "type": "object",
      "properties": {
        "maximumHops": {
          "type": "integer",
          "format": "int32"
        },
        "selector": {
          "$ref": "#/components/schemas/EffectTarget"
        },
        "selectionResourceId": {
          "type": "string",
          "nullable": true
        },
        "overflowPipelineId": {
          "type": "string",
          "nullable": true
        },
        "overflowChannel": {
          "type": "string",
          "nullable": true
        },
        "overflowStageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "impactStageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "carryChildren": {
          "type": "boolean"
        },
        "retestChance": {
          "type": "boolean"
        },
        "retestCondition": {
          "type": "boolean"
        },
        "rollImpactInputs": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "EffectDefinition": {
      "type": "object",
      "properties": {
        "effectId": {
          "type": "string",
          "nullable": true
        },
        "outputId": {
          "type": "string",
          "nullable": true
        },
        "executionScope": {
          "$ref": "#/components/schemas/EffectExecutionScope"
        },
        "executionGroupId": {
          "type": "string",
          "nullable": true
        },
        "chanceGroupId": {
          "type": "string",
          "nullable": true
        },
        "childTiming": {
          "$ref": "#/components/schemas/EffectChildTiming"
        },
        "randomInputs": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EffectRandomInputDefinition"
          }
        },
        "ruleOverrides": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EffectRuleOverrideDefinition"
          }
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EffectNumericParameterDefinition"
          }
        },
        "payloadBindings": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/StackPayloadBinding"
          }
        },
        "condensationRecipeId": {
          "type": "string",
          "nullable": true
        },
        "continuation": {
          "$ref": "#/components/schemas/EffectContinuationDefinition"
        },
        "attributeMutation": {
          "$ref": "#/components/schemas/AttributeMutationDefinition"
        },
        "type": {
          "$ref": "#/components/schemas/EffectType"
        },
        "sequenceMutation": {
          "$ref": "#/components/schemas/SequenceMutation"
        },
        "relativeOffset": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "target": {
          "$ref": "#/components/schemas/EffectTarget"
        },
        "targetLoss": {
          "$ref": "#/components/schemas/EffectTargetLossDefinition"
        },
        "selectionResourceId": {
          "type": "string",
          "nullable": true
        },
        "flatValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "formulaValue": {
          "type": "string",
          "nullable": true
        },
        "targetResource": {
          "type": "string",
          "nullable": true
        },
        "operation": {
          "$ref": "#/components/schemas/ResourceEffectOperation"
        },
        "resourceField": {
          "$ref": "#/components/schemas/ResourceValueField"
        },
        "calculationChannel": {
          "type": "string",
          "nullable": true
        },
        "calculationPipelineId": {
          "type": "string",
          "nullable": true
        },
        "statusId": {
          "type": "string",
          "nullable": true
        },
        "statusStacks": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "statusDuration": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "dispel": {
          "$ref": "#/components/schemas/StatusDispelDefinition"
        },
        "modifierId": {
          "type": "string",
          "nullable": true
        },
        "modifierStacks": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "modifierDuration": {
          "type": "integer",
          "format": "int32",
          "nullable": true
        },
        "modifierOwner": {
          "$ref": "#/components/schemas/GameplayOwner"
        },
        "cardDefinitionId": {
          "type": "string",
          "nullable": true
        },
        "cardZoneFlowId": {
          "type": "string",
          "nullable": true
        },
        "cardCount": {
          "type": "integer",
          "format": "int32"
        },
        "cardInstanceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "condition": {
          "type": "string",
          "nullable": true
        },
        "requiredTags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "excludedTags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "chance": {
          "type": "number",
          "format": "float"
        },
        "chanceScope": {
          "$ref": "#/components/schemas/EffectChanceScope"
        },
        "repeat": {
          "type": "integer",
          "format": "int32"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "nullable": true
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "nullable": true
        },
        "chainedEffects": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EffectDefinition"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "EffectDistributionScope": {
      "enum": [
        "Sequence",
        "ParentSequence"
      ],
      "type": "string"
    },
    "EffectExecutionScope": {
      "enum": [
        "EveryInvocation",
        "OncePerAction",
        "OncePerParentProc"
      ],
      "type": "string"
    },
    "EffectNumericParameter": {
      "enum": [
        "Amount",
        "StatusStacks",
        "StatusDuration",
        "ModifierStacks",
        "ModifierDuration",
        "CardCount"
      ],
      "type": "string"
    },
    "EffectNumericParameterDefinition": {
      "type": "object",
      "properties": {
        "parameter": {
          "$ref": "#/components/schemas/EffectNumericParameter"
        },
        "flatValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "formulaValue": {
          "type": "string",
          "nullable": true
        },
        "inputQuantityId": {
          "type": "string",
          "nullable": true
        },
        "channel": {
          "type": "string",
          "nullable": true
        },
        "pipelineId": {
          "type": "string",
          "nullable": true
        },
        "unitId": {
          "type": "string",
          "nullable": true
        },
        "stageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "conversion": {
          "$ref": "#/components/schemas/CalculationValuePolicy"
        },
        "distribution": {
          "$ref": "#/components/schemas/EffectSequenceDistribution"
        }
      },
      "additionalProperties": false
    },
    "EffectRandomInputDefinition": {
      "type": "object",
      "properties": {
        "inputId": {
          "type": "string",
          "nullable": true
        },
        "groupId": {
          "type": "string",
          "nullable": true
        },
        "chance": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "probability": {
          "$ref": "#/components/schemas/EffectRandomProbabilityDefinition"
        },
        "scope": {
          "$ref": "#/components/schemas/EffectRandomScope"
        }
      },
      "additionalProperties": false
    },
    "EffectRandomProbabilityDefinition": {
      "type": "object",
      "properties": {
        "flatValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "formulaValue": {
          "type": "string",
          "nullable": true
        },
        "channel": {
          "type": "string",
          "nullable": true
        },
        "pipelineId": {
          "type": "string",
          "nullable": true
        },
        "unitId": {
          "type": "string",
          "nullable": true
        },
        "stageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "conversion": {
          "$ref": "#/components/schemas/CalculationValuePolicy"
        },
        "sharedContextCapture": {
          "$ref": "#/components/schemas/EffectRandomSharedContextCapture"
        },
        "captures": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/components/schemas/EffectNumericParameterDefinition"
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "EffectRandomScope": {
      "enum": [
        "Action",
        "ParentProc",
        "Impact"
      ],
      "type": "string"
    },
    "EffectRandomSharedContextCapture": {
      "enum": [
        "SourceOnly",
        "FirstEligibleImpact"
      ],
      "type": "string"
    },
    "EffectRuleOverrideDefinition": {
      "type": "object",
      "properties": {
        "effectId": {
          "type": "string",
          "nullable": true
        },
        "requiredTags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "critical": {
          "type": "boolean",
          "nullable": true
        },
        "armor": {
          "type": "boolean",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "EffectSequenceDistribution": {
      "type": "object",
      "properties": {
        "scope": {
          "$ref": "#/components/schemas/EffectDistributionScope"
        },
        "sourceStageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allocation": {
          "$ref": "#/components/schemas/CalculationDistributionPolicy"
        }
      },
      "additionalProperties": false
    },
    "EffectTarget": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9
      ],
      "type": "integer",
      "format": "int32"
    },
    "EffectTargetLossDefinition": {
      "type": "object",
      "properties": {
        "policy": {
          "$ref": "#/components/schemas/EffectTargetLossPolicy"
        },
        "retarget": {
          "$ref": "#/components/schemas/EffectTarget"
        }
      },
      "additionalProperties": false
    },
    "EffectTargetLossPolicy": {
      "enum": [
        "Fail",
        "Skip",
        "StopRepeat",
        "Retarget"
      ],
      "type": "string"
    },
    "EffectType": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11
      ],
      "type": "integer",
      "format": "int32"
    },
    "GameplayOwner": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/components/schemas/GameplayOwnerKind"
        },
        "id": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "GameplayOwnerKind": {
      "enum": [
        "Entity",
        "Side",
        "Run",
        "Global"
      ],
      "type": "string"
    },
    "ResourceCost": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "nullable": true
        },
        "amount": {
          "type": "number",
          "format": "float"
        },
        "formula": {
          "type": "string",
          "nullable": true
        },
        "allowOverdraft": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ResourceEffectOperation": {
      "enum": [
        "ADD",
        "SUBTRACT",
        "SET"
      ],
      "type": "string"
    },
    "ResourceValueField": {
      "enum": [
        0,
        1,
        2
      ],
      "type": "integer",
      "format": "int32"
    },
    "SequenceDirection": {
      "enum": [
        "Unspecified",
        "Forward",
        "Reverse"
      ],
      "type": "string"
    },
    "SequenceMutation": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/components/schemas/SequenceOperation"
        },
        "direction": {
          "$ref": "#/components/schemas/SequenceDirection"
        },
        "amount": {
          "type": "integer",
          "format": "int32"
        }
      },
      "additionalProperties": false
    },
    "SequenceOperation": {
      "enum": [
        "Unspecified",
        "ReverseDirection",
        "SetDirection",
        "AddAdvance"
      ],
      "type": "string"
    },
    "StackPayloadBinding": {
      "type": "object",
      "properties": {
        "parameterId": {
          "type": "string",
          "nullable": true
        },
        "cardEffectComponentId": {
          "type": "string",
          "nullable": true
        },
        "flatValue": {
          "type": "number",
          "format": "float",
          "nullable": true
        },
        "formulaValue": {
          "type": "string",
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "StatusDispelDefinition": {
      "type": "object",
      "properties": {
        "statusIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "requiredTags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sourceEntityId": {
          "type": "string",
          "nullable": true
        },
        "maximumInstances": {
          "type": "integer",
          "format": "int32"
        },
        "order": {
          "$ref": "#/components/schemas/DispelOrder"
        }
      },
      "additionalProperties": false
    },
      "OpenInscriptionOfferCommand": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "stationId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChooseInscriptionOfferCommand": {
        "type": "object",
        "properties": {
          "offerId": {
            "type": "string",
            "format": "uuid"
          },
          "inscriptionId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransferInscriptionCommand": {
        "type": "object",
        "properties": {
          "fromActorId": {
            "type": "string",
            "nullable": true
          },
          "toActorId": {
            "type": "string",
            "nullable": true
          },
          "instanceId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "InscriptionOfferState": {
        "type": "object",
        "properties": {
          "offerId": {
            "type": "string",
            "format": "uuid"
          },
          "stationId": {
            "type": "string",
            "nullable": true
          },
          "nodeId": {
            "type": "string",
            "nullable": true
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "fingerprint": {
            "type": "string",
            "nullable": true
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "purchasedIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "costs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceAmount"
            }
          },
          "maximumPurchases": {
            "type": "integer",
            "format": "int32"
          },
          "closed": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "InscriptionStationDefinition": {
        "type": "object",
        "properties": {
          "stationId": {
            "type": "string",
            "nullable": true
          },
          "nodeIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pool": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "selection": {
            "$ref": "#/components/schemas/InscriptionOfferSelection"
          },
          "offerCount": {
            "type": "integer",
            "format": "int32"
          },
          "maximumPurchases": {
            "type": "integer",
            "format": "int32"
          },
          "costs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceAmount"
            }
          }
        },
        "additionalProperties": false
      },
      "LoadoutRevisionMigration": {
        "enum": [
          "RejectRevisionChange",
          "RebindCompatible"
        ],
        "type": "string"
      },
      "ResourceAmount": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "float"
          }
        },
        "additionalProperties": false
      },
      "InscriptionOfferSelection": {
        "enum": [
          "Random",
          "Directed"
        ],
        "type": "string"
      },
      "ApplyLoadoutCommand": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "assignments": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LoadoutSnapshot": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "runSequence": {
            "type": "integer",
            "format": "int32"
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64"
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "inventoryId": {
            "type": "string",
            "nullable": true
          },
          "policy": {
            "$ref": "#/components/schemas/LoadoutPolicyDefinition"
          },
          "canEquip": {
            "type": "boolean"
          },
          "usedCapacity": {
            "type": "number",
            "format": "float"
          },
          "actorIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoadoutItemView"
            }
          },
          "assignments": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "attributes": {
            "$ref": "#/components/schemas/ActorAttributesProjection"
          },
          "attributesUnavailableReason": {
            "type": "string",
            "nullable": true
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InscriptionOfferState"
            }
          },
          "availableStations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InscriptionStationDefinition"
            }
          }
        },
        "additionalProperties": false
      },
      "LoadoutPreviewRequest": {
        "type": "object",
        "properties": {
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "assignments": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "expectedSequence": {
            "type": "integer",
            "format": "int32"
          },
          "expectedStep": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "LoadoutPreview": {
        "type": "object",
        "properties": {
          "before": {
            "$ref": "#/components/schemas/LoadoutSnapshot"
          },
          "after": {
            "$ref": "#/components/schemas/LoadoutSnapshot"
          }
        },
        "additionalProperties": false
      },
      "LoadoutPolicyDefinition": {
        "type": "object",
        "properties": {
          "capacityOnly": {
            "type": "boolean",
            "default": false,
            "description": "When true, assignments use client-selected positions and capacity replaces the fixed slot list."
          },
          "loadoutPolicyId": {
            "type": "string",
            "nullable": true
          },
          "inventoryScope": {
            "$ref": "#/components/schemas/InscriptionInventoryScope"
          },
          "capacity": {
            "type": "number",
            "format": "float"
          },
          "allowDuplicateDefinitions": {
            "type": "boolean",
            "nullable": true
          },
          "maximumInventoryEntries": {
            "type": "integer",
            "format": "int32"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoadoutSlotDefinition"
            }
          },
          "inscriptionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "equipmentWindows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoadoutEquipmentWindow"
            }
          },
          "startingInscriptionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "stations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InscriptionStationDefinition"
            },
            "nullable": true
          },
          "revisionMigration": {
            "$ref": "#/components/schemas/LoadoutRevisionMigration"
          },
          "allowTransfers": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "LoadoutItemView": {
        "type": "object",
        "properties": {
          "effectiveEquipmentCost": { "type": "number", "minimum": 0 },
          "instance": {
            "$ref": "#/components/schemas/InscriptionInstance"
          },
          "definition": {
            "$ref": "#/components/schemas/InscriptionDefinition"
          },
          "equippedActorId": {
            "type": "string",
            "nullable": true
          },
          "slotId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InscriptionInventoryScope": {
        "enum": [
          "Actor",
          "Run"
        ],
        "type": "string"
      },
      "LoadoutSlotDefinition": {
        "type": "object",
        "properties": {
          "polarity": { "type": "string" },
          "matchingMultiplier": { "type": "number", "minimum": 0, "maximum": 1 },
          "slotId": {
            "type": "string",
            "nullable": true
          },
          "requiredTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "LoadoutEquipmentWindow": {
        "enum": [
          "OutsideCombat",
          "Preparation",
          "Combat"
        ],
        "type": "string"
      },
      "InscriptionInstance": {
        "type": "object",
        "properties": {
          "instanceId": {
            "type": "string",
            "format": "uuid"
          },
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "acquisitionRevision": {
            "type": "string",
            "nullable": true
          },
          "definitionRevision": {
            "type": "string",
            "nullable": true
          },
          "acquisitionSource": {
            "type": "string",
            "nullable": true
          },
          "acquisitionSequence": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "InscriptionDefinition": {
        "type": "object",
        "properties": {
          "rank": { "type": "integer", "minimum": 0, "default": 0 },
          "polarity": { "type": "string" },
          "ranks": { "type": "array", "items": {
            "type": "object", "properties": {
              "rank": { "type": "integer", "minimum": 1 },
              "equipmentCost": { "type": "number", "minimum": 0 },
              "influenceValues": { "type": "object", "additionalProperties": { "type": "number" } }
            }
          } },
          "inscriptionId": {
            "type": "string",
            "nullable": true
          },
          "equipmentCost": {
            "type": "number",
            "format": "float"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "attributeBonuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InscriptionAttributeBonusDefinition"
            }
          },
          "presentation": {
            "type": "object",
            "additionalProperties": {},
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InscriptionAttributeBonusDefinition": {
        "type": "object",
        "properties": {
          "attributeId": {
            "type": "string",
            "nullable": true
          },
          "influence": {
            "$ref": "#/components/schemas/ContextualInfluenceDefinition"
          }
        },
        "additionalProperties": false
      },
      "ContextualInfluenceDefinition": {
        "type": "object",
        "properties": {
          "influenceId": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "$ref": "#/components/schemas/CalculationEntityScope"
          },
          "channel": {
            "type": "string",
            "nullable": true
          },
          "bucket": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "formula": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "requiredTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "excludedTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CalculationEntityScope": {
        "enum": [
          "Actor",
          "Target"
        ],
        "type": "string"
      },
      "InteractionSession": {
        "type": "object",
        "properties": {
          "version": {
            "$ref": "#/components/schemas/InteractionVersion"
          },
          "run": {},
          "combat": {},
          "commands": {},
          "capabilities": {},
          "cardZones": {},
          "attributes": {},
          "cardPresentations": {},
          "modifierItems": {},
          "actions": {},
          "evaluations": {}
        },
        "additionalProperties": false
      },
      "InteractionVersion": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "settingId": {
            "type": "string",
            "nullable": true
          },
          "runSequence": {
            "type": "integer",
            "format": "int32"
          },
          "runStep": {
            "type": "integer",
            "format": "int64"
          },
          "combatId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "combatStep": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "contentRevision": {
            "type": "string",
            "nullable": true
          },
          "engineVersion": {
            "type": "string",
            "nullable": true
          },
          "stateFingerprint": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CardNumericLayers": {
        "type": "object", "properties": {
          "original": {"type": "number", "nullable": true}, "composedBase": {"type": "number", "nullable": true}, "source": {"type": "number", "nullable": true},
          "unitId": {"type": "string"}, "expression": {"type": "string", "nullable": true}, "unresolvedReason": {"type": "string", "nullable": true}
        }
      },
      "CardPresentationFacts": {
        "type": "object", "required": ["identity", "version", "faceValueMode", "costs", "effects", "explanations", "impacts", "fingerprint"],
        "properties": {
          "hasCardPayments": {
            "type": "boolean",
            "nullable": true
          },
          "referencedRules": {"type": "array", "description": "Descriptive status, modifier and condensation-recipe references from the pinned revision. Does not execute effects.", "items": {"$ref": "#/components/schemas/CardRuleReference"}},
          "identity": {"type": "object", "properties": {"kind": {"type": "string", "enum": ["Definition", "Offer", "Instance", "Transformation"]}, "definitionId": {"type": "string"}, "cardInstanceId": {"type": "string", "format": "uuid", "nullable": true}, "offerId": {"type": "string", "nullable": true}}},
          "version": {"type": "object", "description": "Pinned content, composition and run/combat coordinates.", "additionalProperties": true},
          "faceValueMode": {"type": "string", "enum": ["ComposedBase", "Source"]}, "rarity": {"type": "string"}, "tags": {"type": "array", "items": {"type": "string"}},
          "costs": {"type": "array", "items": {"type": "object", "properties": {"componentId": {"type": "string"}, "costs": {"type": "object", "additionalProperties": true}}}},
          "effects": {"type": "array", "items": {"type": "object", "properties": {"componentId": {"type": "string"}, "effectPath": {"type": "string"}, "parentEffectPath": {"type": "string", "nullable": true}, "boundary": {"type": "string", "nullable": true}, "definition": {"type": "object", "additionalProperties": true}, "parameters": {"type": "array", "items": {"type": "object", "properties": {"parameter": {"type": "string"}, "values": {"$ref": "#/components/schemas/CardNumericLayers"}}}}}}},
          "conditions": {"type": "array", "items": {"type": "object"}}, "targeting": {"type": "array", "items": {"type": "object"}}, "dispositions": {"type": "array", "items": {"type": "object"}}, "ruleOverrides": {"type": "array", "items": {"type": "object"}}, "permanentChanges": {"type": "array", "items": {"type": "object"}},
          "influences": {"type": "array", "description": "Intrinsic card contribution components, including critical chance or multiplier changes that do not change composed-base numbers.", "items": {"type": "object", "additionalProperties": true}},
          "explanations": {"type": "array", "description": "Per-parameter source attributes, eligible zero values, pertinent contributors, conditions and bounded bucket outputs. Full detail may include technical traces.", "items": {"type": "object", "additionalProperties": true}},
          "impacts": {"type": "array", "description": "Separate target outcomes with captured-preview validity; never the face value.", "items": {"type": "object", "additionalProperties": true}}, "impactsTruncated": {"type": "boolean"}, "fingerprint": {"type": "string"}
        }
      },
      "CardPresentationBatch": {"type": "object", "required": ["runId", "runSequence", "contentRevision", "cards"], "properties": {"runId": {"type": "string", "format": "uuid"}, "runSequence": {"type": "integer"}, "contentRevision": {"type": "string"}, "cards": {"type": "array", "maxItems": 512, "items": {"$ref": "#/components/schemas/CardPresentationFacts"}}}},
      "CardRuleReference": {"type": "object", "properties": {"kind": {"type": "string"}, "definitionId": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"}, "influences": {"type": "array", "items": {"type": "object", "properties": {"channel": {"type": "string"}, "value": {"type": "number", "nullable": true}}}}}},
      "CardScalingAttribute": {"type": "object", "description": "Binding metadata, not an instruction to calculate gameplay on the client. Contribution is the value actually consumed by the canonical calculation.", "properties": {"bindingId": {"type": "string"}, "componentId": {"type": "string"}, "attributeId": {"type": "string"}, "scope": {"type": "string"}, "bucket": {"type": "string"}, "eligible": {"type": "boolean"}, "reason": {"type": "string", "nullable": true}, "currentValue": {"type": "number", "nullable": true}, "scale": {"type": "number"}, "offset": {"type": "number"}, "operation": {"type": "string"}, "resourceField": {"type": "string", "nullable": true}, "contributionValue": {"type": "number", "nullable": true}, "applied": {"type": "boolean"}}},
      "CardModifierItemDefinition": {"type": "object", "required": ["itemDefinitionId", "upgradeId", "use"], "properties": {"itemDefinitionId": {"type": "string"}, "upgradeId": {"type": "string"}, "use": {"type": "string", "enum": ["Consume", "Bind"]}, "presentation": {"type": "object", "additionalProperties": {"type": "string"}}}},
      "CardModifierItemSnapshot": {"type": "object", "required": ["runId", "runSequence", "contentRevision", "catalog", "items"], "properties": {
        "runId": {"type": "string", "format": "uuid"}, "runSequence": {"type": "integer"}, "contentRevision": {"type": "string"}, "catalog": {"type": "array", "items": {"$ref": "#/components/schemas/CardModifierItemDefinition"}},
        "items": {"type": "array", "maxItems": 512, "items": {"type": "object", "properties": {"instance": {"type": "object", "description": "Owned unit identity, acquisition revision/source/sequence and Available/Consumed/Bound state, including card/transformation binding when used.", "additionalProperties": true}, "definition": {"$ref": "#/components/schemas/CardModifierItemDefinition"}, "cards": {"type": "array", "items": {"type": "object", "properties": {"cardInstanceId": {"type": "string", "format": "uuid"}, "compatible": {"type": "boolean"}, "reason": {"type": "string", "nullable": true}}}}}}}
      }},
      "CardModifierItemPreview": {"type": "object", "required": ["runId", "runSequence", "expectedStep", "contentRevision", "itemInstanceId", "cardInstanceId", "before", "after"], "properties": {"runId": {"type": "string", "format": "uuid"}, "runSequence": {"type": "integer"}, "expectedStep": {"type": "integer", "format": "uint64"}, "contentRevision": {"type": "string"}, "itemInstanceId": {"type": "string", "format": "uuid"}, "cardInstanceId": {"type": "string", "format": "uuid"}, "before": {"$ref": "#/components/schemas/CardPresentationFacts"}, "after": {"$ref": "#/components/schemas/CardPresentationFacts"}}},
      "ActorAttributesProjection": {
        "type": "object", "required": ["runId", "runSequence", "contentRevision", "actorId", "authority", "attributes", "criticalRules"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "combatId": { "type": "string", "format": "uuid", "nullable": true },
          "runSequence": { "type": "integer" },
          "combatStep": { "type": "integer", "format": "uint64", "nullable": true },
          "contentRevision": { "type": "string" }, "actorId": { "type": "string" },
          "authority": { "type": "string", "enum": ["PersistentPlayer", "ActiveEncounter"] },
          "attributes": { "type": "array", "maxItems": 64, "items": {
            "type": "object", "required": ["attributeId", "displayName", "unit", "baseValue", "effectiveValue"],
            "properties": {
              "attributeId": { "type": "string" }, "displayName": { "type": "string" }, "unit": { "type": "string" },
              "baseValue": { "type": "number", "format": "float" }, "effectiveValue": { "type": "number", "format": "float" },
              "pipelineId": { "type": "string" }, "pipelineFingerprint": { "type": "string" },
              "contextTags": { "type": "array", "items": { "type": "string" } },
              "contributionsTruncated": { "type": "boolean" },
              "contributions": { "type": "array", "maxItems": 64, "description": "Bounded contribution facts in pipeline units, not full formulas, variables or historical state.", "items": { "type": "object", "additionalProperties": true } }
            }
          } },
          "criticalRules": { "type": "array", "maxItems": 32, "items": { "type": "object", "properties": {
            "ruleId": { "type": "string" }, "guaranteedTiers": { "type": "number" },
            "nextTierChancePercent": { "type": "number", "minimum": 0, "maximum": 100 },
            "bonusPerTierPercent": { "type": "number" }, "contextTags": { "type": "array", "items": { "type": "string" } }
          } } }
        }
      },
      "RunStartRequest": {
        "type": "object",
        "required": ["settingId", "contentRevision", "modeId"],
        "additionalProperties": false,
        "properties": {
          "settingId": { "type": "string", "minLength": 1 },
          "runDefinitionId": { "type": "string", "nullable": true, "description": "Published run definition; omitted selects default_run." },
          "playerEntityId": { "type": "string", "nullable": true, "description": "Player scope; omitted selects player." },
          "seed": { "type": "integer", "nullable": true, "format": "uint64", "minimum": 0 },
          "contentRevision": { "type": "string", "minLength": 1 },
          "modeId": { "type": "string", "minLength": 1, "description": "Explicit published game mode." },
          "commandId": { "type": "string", "nullable": true, "format": "uuid", "description": "Creation retry key, scoped by player and setting. Same key requires identical inputs and returns original sequence-1 state; use a new key for a new attempt. Without a key, seeded requests retry by inputs; unseeded requests create new attempts." }
        }
      },
      "CombatScenarioDefinition": {
        "type": "object",
        "required": ["schemaVersion", "modeId", "seed", "attemptKey", "participants", "startingCards"],
        "properties": {
          "schemaVersion": { "type": "integer", "const": 2 },
          "modeId": { "type": "string" },
          "contentRevision": { "type": "string", "description": "Published content revision; omitted means the current revision." },
          "seed": { "type": "integer", "format": "uint64" },
          "attemptKey": { "type": "string", "description": "Changes the deterministic identity of a new attempt." },
          "participants": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": ["instanceId", "entityDefinitionId", "sideId", "controllerBinding"],
              "properties": {
                "instanceId": { "type": "string" },
                "entityDefinitionId": { "type": "string" },
                "sideId": { "type": "string" },
                "controllerBinding": {
                  "type": "object",
                  "required": ["kind"],
                  "properties": {
                    "kind": { "type": "string", "enum": ["Player", "AI", "None"] },
                    "policyId": { "type": ["string", "null"] }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "startingCards": { "type": "array", "items": { "type": "object" } },
          "initialState": { "type": "object" }
        }
      },
      "CommandEnvelope": {
        "type": "object",
        "required": ["commandId", "type", "payload"],
        "properties": {
          "commandId": { "type": "string", "format": "uuid", "description": "Idempotency key" },
          "expectedSequence": { "type": "integer", "minimum": 0 },
          "expectedStep": { "type": "integer", "format": "uint64" },
          "type": {
            "type": "string",
            "description": "Canonical command type. INVOKE_CARD_ZONE_GAMEPLAY_FLOW accepts a configured GameplayCommand flow with { flowId, cardInstanceIds?, requestedCount? }; it cannot create arbitrary card definitions or invoke Tool flows. ACTIVATE_CONTENT_REVISION accepts { revision } and is allowed only when the run's resolved GameMode enables versioned activation. START_DIALOGUE accepts { dialogueId }. CHOOSE_DIALOGUE_OPTION accepts { dialogueInstanceId, nodeId, choiceId }; choices are validated and committed atomically with costs, effects and narrative flags."
          },
          "payload": { "type": "object", "additionalProperties": true }
        }
      },
      "RunReadModel": {
        "type": "object",
        "required": ["runId", "sequence", "step", "stateHash", "cardZones"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "sequence": { "type": "integer", "minimum": 0 },
          "step": { "type": "integer", "minimum": 0 },
          "stateHash": { "type": "string" },
          "cardZones": { "$ref": "#/components/schemas/CardZoneSnapshot" },
          "runResourceOwnerId": { "type": "string", "description": "Owner of the resources wallet; not the character resource reserve." },
          "characterResources": { "$ref": "#/components/schemas/CharacterResourceView" },
          "eligibility": { "type": "object", "nullable": true, "allOf": [{ "$ref": "#/components/schemas/RunEligibilitySnapshot" }] },
          "creationReceipt": { "type": "object", "nullable": true, "allOf": [{ "$ref": "#/components/schemas/RunCreationReceiptIdentity" }] },
          "progressProvenance": { "type": "string", "nullable": true, "enum": ["Published", "Experimental", "Sandbox", "DevModder", "Branch"], "description": "Monotonic recorded origin; disabling cheats never restores Published provenance." }
        },
        "additionalProperties": true
      },
      "CharacterResourceView": {
        "type": "object",
        "required": ["ownerId", "authority", "resources"],
        "properties": {
          "ownerId": { "type": "string" },
          "authority": { "type": "string", "enum": ["Unavailable", "PersistentPlayer", "ActiveEncounter"] },
          "combatId": { "type": "string", "format": "uuid", "nullable": true },
          "resources": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ResourcePoolView" } }
        }
      },
      "ResourcePoolView": {
        "type": "object",
        "required": ["current", "minimum", "maximum"],
        "properties": { "current": { "type": "number" }, "minimum": { "type": "number" }, "maximum": { "type": "number" } }
      },
      "PlayerProfileProjection": {
        "type": "object",
        "properties": {
          "playerId": { "type": "string" }, "settingId": { "type": "string" }, "revision": { "type": "string" },
          "totalRuns": { "type": "integer" }, "completedRuns": { "type": "integer" }, "activeRuns": { "type": "integer" },
          "progressSequence": { "type": "integer" }, "progressRevision": { "type": "string" },
          "unlocks": { "type": "array", "items": { "type": "string" } },
          "unlockProofs": { "type": "array", "items": { "type": "object", "description": "Canonical grant with policy/content revision, command, evidence counts, contribution keys and targets", "additionalProperties": true } },
          "availability": { "type": "object", "nullable": true, "allOf": [{ "$ref": "#/components/schemas/ProfileUnlockAvailability" }] },
          "achievements": { "type": "array", "items": { "type": "string" } },
          "runs": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "ProfileUnlockAvailability": {
        "type": "object",
        "required": ["contentRevision", "progressRevision", "options"],
        "properties": {
          "contentRevision": { "type": "string" }, "progressRevision": { "type": "string" },
          "options": { "type": "array", "items": { "$ref": "#/components/schemas/ProfileUnlockOption" } }
        }
      },
      "ProfileUnlockOption": {
        "type": "object",
        "properties": {
          "policyId": { "type": "string" }, "unlockId": { "type": "string" }, "displayName": { "type": "string" },
          "condition": { "type": "object", "description": "Typed declarative condition tree", "additionalProperties": true },
          "conditionSatisfied": { "type": "boolean", "description": "Read-only explanation; never an implicit grant" },
          "evidenceCounts": { "type": "object", "additionalProperties": { "type": "integer" } },
          "targets": { "type": "array", "items": { "$ref": "#/components/schemas/RunEligibilityTarget" } },
          "availableTargets": { "type": "array", "items": { "$ref": "#/components/schemas/RunEligibilityTarget" } },
          "proof": { "type": "object", "nullable": true, "additionalProperties": true }
        }
      },
      "RandomOutcomePreview": {
        "type": "object",
        "properties": {
          "truncated": { "type": "boolean" }, "isGlobalOutcomeRange": { "type": "boolean", "enum": [false] },
          "impacts": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/RandomImpactPreview" } }
        }
      },
      "RandomImpactPreview": {
        "type": "object",
        "properties": {
          "impactId": { "type": "string" }, "targetEntityId": { "type": "string" }, "inputId": { "type": "string" },
          "scope": { "type": "string", "enum": ["Action", "ParentProc", "Impact"] },
          "probability": { "type": "number", "minimum": 0, "maximum": 1 },
          "probabilityUnit": { "type": "string", "enum": ["probability"] },
          "probabilitySource": { "type": "string", "enum": ["Literal", "Calculated"] },
          "probabilityCalculation": { "type": "object", "nullable": true, "additionalProperties": true },
          "contentRevision": { "type": "string" }, "snapshotHash": { "type": "string" },
          "conditionalOnReachingImpact": { "type": "boolean" }, "validity": { "type": "string" },
          "captures": { "type": "object", "additionalProperties": true }, "checkpoints": { "type": "object", "additionalProperties": { "type": "number" } },
          "alternatives": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "RunCreationReceiptIdentity": {
        "type": "object",
        "required": ["key", "requestFingerprint"],
        "properties": {
          "key": { "type": "string" },
          "requestFingerprint": { "type": "string" }
        },
        "additionalProperties": false
      },
      "RunEligibilitySnapshot": {
        "type": "object",
        "required": ["playerId", "settingId", "contentRevision", "policyId", "policyFingerprint", "source", "emptyPools", "profileSequence", "profileRevision", "unlockIds", "gatedTargets", "availableTargets", "effectiveFingerprint"],
        "properties": {
          "playerId": { "type": "string" },
          "settingId": { "type": "string" },
          "contentRevision": { "type": "string" },
          "policyId": { "type": "string" },
          "policyFingerprint": { "type": "string" },
          "source": { "type": "string", "enum": ["Profile", "Fixed", "Unrestricted"] },
          "emptyPools": { "type": "string", "enum": ["Reject", "AllowEmpty"] },
          "profileSequence": { "type": "integer", "minimum": 0 },
          "profileRevision": { "type": "string", "description": "Historical provenance, excluded from effective eligibility identity." },
          "unlockIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
          "gatedTargets": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/components/schemas/RunEligibilityTarget" } },
          "availableTargets": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/components/schemas/RunEligibilityTarget" } },
          "effectiveFingerprint": { "type": "string" }
        },
        "additionalProperties": false
      },
      "RunEligibilityTarget": {
        "type": "object",
        "required": ["kind", "definitionId"],
        "properties": {
          "kind": { "type": "string", "enum": ["Card", "CardUpgrade", "Relic", "Inscription"] },
          "definitionId": { "type": "string" }
        },
        "additionalProperties": false
      },
      "CardZoneSnapshot": {
        "type": "object",
        "required": ["runId", "sequence", "step", "topologyHash", "zones"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "sequence": { "type": "integer", "minimum": 0 },
          "step": { "type": "integer", "minimum": 0 },
          "topologyHash": { "type": "string" },
          "zones": { "type": "array", "items": { "$ref": "#/components/schemas/CardZoneView" } }
        }
      },
      "CardZoneView": {
        "type": "object",
        "required": ["zoneId", "ownerId", "ownerScope", "ordering", "allowsCardPlay", "visibility", "presentation", "count", "contentsVisible", "orderVisible", "cards"],
        "properties": {
          "playerCanPlayFrom": { "type": "boolean" },
          "zoneId": { "type": "string" },
          "ownerId": { "type": "string" },
          "scopeId": { "type": "string", "nullable": true },
          "ownerScope": { "type": "string" },
          "ordering": { "type": "string" },
          "allowsCardPlay": { "type": "boolean" },
          "visibility": { "type": "object", "additionalProperties": true },
          "presentation": { "type": "object", "additionalProperties": true },
          "count": { "type": "integer", "minimum": 0 },
          "contentsVisible": { "type": "boolean" },
          "orderVisible": { "type": "boolean" },
          "cards": { "type": "array", "items": { "$ref": "#/components/schemas/CardZoneCardView" } }
        }
      },
      "CardZoneCardView": {
        "type": "object",
        "required": ["cardInstanceId", "definitionId", "upgrades", "lifetime"],
        "properties": {
          "cardInstanceId": { "type": "string", "format": "uuid" },
          "definitionId": { "type": "string" },
          "upgrades": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "lifetime": { "type": "object", "additionalProperties": true }
        }
      },
      "GameplayCardZoneFlowPayload": {
        "type": "object", "required": ["flowId"], "additionalProperties": false,
        "description": "Only authored GameplayCommand flows can be invoked; selected instances must be visible to the player.",
        "properties": {
          "flowId": { "type": "string" },
          "cardInstanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "requestedCount": { "type": "integer", "minimum": 0 }
        }
      },
      "DialogueText": {
        "type": "object", "required": ["text"],
        "properties": { "text": { "type": "string", "description": "English fallback" }, "translations": { "type": "object", "additionalProperties": { "type": "string" } } }
      },
      "StartDialoguePayload": {
        "type": "object", "required": ["dialogueId"], "additionalProperties": false,
        "properties": { "dialogueId": { "type": "string" } }
      },
      "ChooseDialogueOptionPayload": {
        "type": "object", "required": ["dialogueInstanceId", "nodeId", "choiceId"], "additionalProperties": false,
        "properties": { "dialogueInstanceId": { "type": "string", "format": "uuid" }, "nodeId": { "type": "string" }, "choiceId": { "type": "string" } }
      },
      "CommandResult": {
        "type": "object",
        "required": ["commandId", "type", "sequence", "step", "previousStateHash", "stateHash", "duplicate", "state", "events"],
        "properties": {
          "commandId": { "type": "string", "format": "uuid" },
          "type": { "type": "string" },
          "sequence": { "type": "integer", "minimum": 1, "description": "Root commit sequence for this receipt." },
          "step": { "type": "integer", "format": "uint64" },
          "previousStateHash": { "type": "string" },
          "stateHash": { "type": "string" },
          "duplicate": { "type": "boolean", "description": "True when the idempotency key returned a previously committed receipt." },
          "state": { "type": "object", "additionalProperties": true },
          "events": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "CombatCommandResult": {
        "allOf": [
          { "$ref": "#/components/schemas/CommandResult" },
          {
            "type": "object",
            "properties": {
              "state": { "$ref": "#/components/schemas/CombatCommandState" }
            }
          }
        ]
      },
      "CombatCommandState": {
        "type": "object",
        "required": ["run", "combat", "resolution"],
        "properties": {
          "run": { "type": "object", "additionalProperties": true },
          "combat": { "$ref": "#/components/schemas/CombatStateSnapshot" },
          "resolution": { "$ref": "#/components/schemas/CombatResolutionRecord" }
        }
      },
      "LegalActionSet": {
        "type": "object",
        "required": ["actorId", "candidates", "determinism", "stateFingerprint"],
        "properties": {
          "blockedCommands": { "type": "array", "items": { "type": "object", "properties": { "actionType": { "type": "string" }, "actionId": { "type": "string", "nullable": true }, "code": { "type": "string" }, "messageKey": { "type": "string" }, "reason": { "type": "string", "nullable": true } } } },
          "actorId": { "type": "string" },
          "stateFingerprint": { "type": "string" },
          "determinism": { "type": "object", "additionalProperties": true },
          "candidates": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/LegalActionCandidate" }
          }
        }
      },
      "LegalActionCandidate": {
        "type": "object",
        "required": ["candidateId", "source", "command", "applications", "calculations", "costs", "steps", "resolutionFingerprint", "outcomeUncertain", "reactionTransition"],
        "properties": {
          "candidateId": { "type": "string" },
          "source": { "type": "string", "enum": ["System", "Ability", "Card"] },
          "command": { "type": "object", "additionalProperties": true },
          "actionId": { "type": "string", "nullable": true },
          "cardDefinitionId": { "type": "string", "nullable": true },
          "costs": { "type": "array", "items": { "$ref": "#/components/schemas/ResolvedCardCost" }, "description": "Canonical resolved costs for this candidate and cost option; do not recalculate in clients." },
          "applications": { "type": "array", "items": { "$ref": "#/components/schemas/EffectApplicationRecord" } },
          "calculations": { "type": "array", "items": { "$ref": "#/components/schemas/CalculationTrace" } },
          "steps": { "type": "array", "items": { "$ref": "#/components/schemas/EffectExecutionStep" } },
          "resolutionFingerprint": { "type": "string" },
          "outcomeUncertain": { "type": "boolean" },
          "reactionTransition": {
            "type": "string",
            "enum": ["ResolvedImmediately", "Proposed", "PriorityPassed", "StackActionResolved", "StackActionFizzled"]
          },
          "resolvedCommand": { "type": "object", "nullable": true, "additionalProperties": true },
          "pendingAction": { "oneOf": [{ "$ref": "#/components/schemas/PendingActionState" }, { "type": "null" }] }
        }
      },
      "ResolvedCardCost": {
        "type": "object",
        "required": ["componentId", "resourceId", "amount", "allowOverdraft", "affordable"],
        "properties": {
          "componentId": { "type": "string" },
          "optionId": { "type": "string", "nullable": true },
          "resourceId": { "type": "string" },
          "amount": { "type": "number", "format": "float" },
          "allowOverdraft": { "type": "boolean" },
          "affordable": { "type": "boolean" }
        }
      },
      "CombatStateSnapshot": {
        "type": "object",
        "nullable": true,
        "additionalProperties": true,
        "required": ["combatId", "seed", "step", "contentRevision", "engineVersion", "stateHash", "status", "currentTurn", "actors", "sides", "relationships", "totalActions", "board", "phase", "activation", "priorityWindow", "pendingActions"],
        "properties": {
          "activationSequenceStrategy": { "type": "string", "enum": ["PerRound", "Circular"], "nullable": true },
          "nextScheduledActorId": { "type": "string", "nullable": true },
          "participantVictory": { "type": "object", "nullable": true, "properties": { "ruleId": { "type": "string" }, "actorIds": { "type": "array", "items": { "type": "string" } }, "sideIds": { "type": "array", "items": { "type": "string" } }, "draw": { "type": "boolean" } } },
          "combatId": { "type": "string", "format": "uuid" },
          "runId": { "type": "string", "format": "uuid", "nullable": true },
          "runNodeId": { "type": "string", "nullable": true },
          "seed": { "type": "integer", "format": "uint64" },
          "step": { "type": "integer", "format": "uint64" },
          "contentRevision": { "type": "string", "description": "Immutable content revision pinned for this state." },
          "engineVersion": { "type": "string", "description": "Deterministic runtime version that interprets the revision." },
          "stateHash": { "type": "string", "minLength": 64, "maxLength": 64 },
          "status": { "type": "string" },
          "currentTurn": { "type": "integer", "minimum": 0 },
          "actors": { "type": "array", "items": { "$ref": "#/components/schemas/CombatActorSnapshot" } },
          "sides": { "type": "array", "items": { "$ref": "#/components/schemas/CombatSide" } },
          "relationships": { "$ref": "#/components/schemas/CombatRelationshipPolicy" },
          "totalActions": { "type": "integer", "minimum": 0 },
          "board": { "type": "object", "additionalProperties": true },
          "phase": { "oneOf": [{ "$ref": "#/components/schemas/PhaseCursor" }, { "type": "null" }] },
          "activation": { "oneOf": [{ "$ref": "#/components/schemas/ActivationCursor" }, { "type": "null" }] },
          "priorityWindow": {
            "oneOf": [{ "$ref": "#/components/schemas/PriorityWindowState" }, { "type": "null" }]
          },
          "pendingActions": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/PendingActionState" }
          }
        }
      },
      "CombatActorSnapshot": {
        "type": "object",
        "required": ["instanceId", "definitionId", "name", "sideId", "controllerBinding", "isAlive", "resources"],
        "properties": {
          "instanceId": { "type": "string" },
          "definitionId": { "type": "string" },
          "name": { "type": "string" },
          "sideId": { "type": "string" },
          "controllerBinding": { "$ref": "#/components/schemas/ControllerBinding" },
          "isAlive": { "type": "boolean" },
          "resources": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ResourcePool" } }
        }
      },
      "ControllerBinding": {
        "type": "object",
        "required": ["kind"],
        "properties": {
          "decisionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "cadence": {
            "$ref": "#/components/schemas/ActorActivationCadence"
          },
          "kind": { "type": "string", "enum": ["Player", "AI", "None"] },
          "policyId": { "type": "string", "nullable": true }
        }
      },
      "ResourcePool": {
        "type": "object",
        "required": ["current", "maximum", "minimum"],
        "properties": {
          "current": { "type": "number", "format": "float" },
          "maximum": { "type": "number", "format": "float" },
          "minimum": { "type": "number", "format": "float" }
        }
      },
      "CombatSide": {
        "type": "object",
        "required": ["sideId"],
        "properties": { "sideId": { "type": "string" } }
      },
      "CombatRelationshipPolicy": {
        "type": "object",
        "required": ["sameSide", "differentSides", "rules"],
        "properties": {
          "sameSide": { "type": "string", "enum": ["Ally", "Enemy", "Neutral"] },
          "differentSides": { "type": "string", "enum": ["Ally", "Enemy", "Neutral"] },
          "rules": { "type": "array", "items": { "$ref": "#/components/schemas/SideRelationshipRule" } }
        }
      },
      "SideRelationshipRule": {
        "type": "object",
        "required": ["fromSideId", "toSideId", "relationship"],
        "properties": {
          "fromSideId": { "type": "string" },
          "toSideId": { "type": "string" },
          "relationship": { "type": "string", "enum": ["Ally", "Enemy", "Neutral"] }
        }
      },
      "PhaseCursor": {
        "type": "object",
        "required": ["sequenceId", "contentRevision", "cursor"],
        "properties": {
          "sequenceId": { "type": "string" },
          "contentRevision": { "type": "string" },
          "cursor": { "type": "string" }
        }
      },
      "ActivationCursor": {
        "type": "object",
        "required": ["round", "activationIndex", "activationNumber", "actionsTaken", "activationOrder", "completedActorIds", "waitingForInput", "intents"],
        "properties": {
          "activeActorId": { "type": "string", "nullable": true },
          "round": { "type": "integer", "minimum": 1 },
          "activationIndex": { "type": "integer", "minimum": 0 },
          "activationNumber": { "type": "integer", "minimum": 0 },
          "actionsTaken": { "type": "integer", "minimum": 0 },
          "activationOrder": { "type": "array", "items": { "type": "string" } },
          "completedActorIds": { "type": "array", "items": { "type": "string" } },
          "waitingForInput": { "type": "boolean" },
          "intents": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "rulesId": { "type": "string", "nullable": true }
        }
      },
      "SandboxCombatSnapshot": {
        "type": "object",
        "required": ["run", "combat", "playableCards"],
        "properties": {
          "run": { "type": "object", "additionalProperties": true },
          "combat": { "$ref": "#/components/schemas/SandboxCombatStateSnapshot" },
          "playableCards": { "type": "array", "description": "Cards in every authored zone that allows play for the active actor.", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "SandboxCombatStateSnapshot": {
        "type": "object",
        "required": ["combatId", "step", "stateHash", "turn", "status", "phase", "activation", "priorityWindow", "pendingActions", "board", "actors"],
        "properties": {
          "combatId": { "type": "string", "format": "uuid" },
          "step": { "type": "integer", "format": "uint64" },
          "stateHash": { "type": "string", "minLength": 64, "maxLength": 64 },
          "turn": { "type": "integer", "minimum": 0 },
          "status": { "type": "string" },
          "activeActorId": { "type": "string", "nullable": true },
          "phase": { "oneOf": [{ "$ref": "#/components/schemas/PhaseCursor" }, { "type": "null" }] },
          "activation": { "oneOf": [{ "$ref": "#/components/schemas/ActivationCursor" }, { "type": "null" }] },
          "priorityWindow": { "oneOf": [{ "$ref": "#/components/schemas/PriorityWindowState" }, { "type": "null" }] },
          "pendingActions": { "type": "array", "items": { "$ref": "#/components/schemas/PendingActionState" } },
          "board": { "type": "object", "additionalProperties": true },
          "actors": { "type": "array", "items": { "$ref": "#/components/schemas/CombatActorSnapshot" } }
        }
      },
      "PriorityWindowState": {
        "type": "object",
        "required": ["windowId", "openedByActorId", "holderActorId", "holderIndex", "consecutivePasses", "resolutionCount", "eligibleActorIds"],
        "properties": {
          "windowId": { "type": "string", "minLength": 64, "maxLength": 64 },
          "openedByActorId": { "type": "string" },
          "holderActorId": { "type": "string" },
          "holderIndex": { "type": "integer", "minimum": 0 },
          "consecutivePasses": { "type": "integer", "minimum": 0 },
          "resolutionCount": { "type": "integer", "minimum": 0 },
          "eligibleActorIds": { "type": "array", "items": { "type": "string" } }
        }
      },
      "PendingActionState": {
        "type": "object",
        "required": ["pendingActionId", "depth", "command", "candidateFingerprint", "contentRevision", "lockedTargetIds", "paidCosts", "commandTags", "costsPaid"],
        "properties": {
          "pendingActionId": { "type": "string", "minLength": 64, "maxLength": 64 },
          "depth": { "type": "integer", "minimum": 1 },
          "command": { "type": "object", "additionalProperties": true },
          "candidateFingerprint": { "type": "string", "minLength": 64, "maxLength": 64 },
          "contentRevision": { "type": "string" },
          "actionId": { "type": "string", "nullable": true },
          "cardDefinitionId": { "type": "string", "nullable": true },
          "lockedTargetIds": { "type": "array", "items": { "type": "string" } },
          "paidCosts": { "type": "array", "items": { "$ref": "#/components/schemas/PendingResourceCost" } },
          "commandTags": { "type": "array", "items": { "type": "string" } },
          "costsPaid": { "type": "boolean" }
        }
      },
      "PendingResourceCost": {
        "type": "object",
        "required": ["componentId", "resourceId", "amount"],
        "properties": {
          "componentId": { "type": "string" },
          "optionId": { "type": "string", "nullable": true },
          "resourceId": { "type": "string" },
          "amount": { "type": "number", "format": "float" }
        }
      },
      "CombatResolutionRecord": {
        "type": "object",
        "required": ["commandId", "combatId", "commandType", "mode", "rootSequence", "initialCombatStateHash", "finalCombatStateHash", "resolutionFingerprint", "frames"],
        "properties": {
          "commandId": { "type": "string", "format": "uuid" },
          "combatId": { "type": "string", "format": "uuid" },
          "commandType": { "type": "string" },
          "mode": { "type": "string", "enum": ["FullSnapshots", "CompactWithSnapshotLookup"] },
          "rootSequence": { "type": "integer", "minimum": 1, "description": "Authoritative run commit containing every frame produced by the command." },
          "initialCombatStateHash": { "type": "string", "minLength": 64, "maxLength": 64 },
          "finalCombatStateHash": { "type": "string", "minLength": 64, "maxLength": 64 },
          "resolutionFingerprint": { "type": "string", "minLength": 64, "maxLength": 64 },
          "frames": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/CombatAnimationFrame" }
          }
        }
      },
      "CombatAnimationFrame": {
        "type": "object",
        "required": ["frameId", "index", "runSequence", "combatStep", "transitionType", "payload", "effectSteps", "calculations", "applications", "cardZoneSteps", "snapshotSequence"],
        "properties": {
          "frameId": { "type": "string", "format": "uuid" },
          "index": { "type": "integer", "minimum": 0 },
          "runSequence": { "type": "integer", "minimum": 1 },
          "combatStep": { "type": "integer", "format": "uint64" },
          "transitionType": { "type": "string" },
          "payload": { "type": "object", "additionalProperties": true },
          "effectSteps": {
            "type": "array",
            "description": "Ordered, source-independent effect execution trace.",
            "items": { "$ref": "#/components/schemas/EffectExecutionStep" }
          },
          "calculations": {
            "type": "array",
            "description": "Bucket calculations used by effects in this frame.",
            "items": { "$ref": "#/components/schemas/CalculationTrace" }
          },
          "applications": {
            "type": "array",
            "description": "Concrete immutable mutations produced by the frame.",
            "items": { "$ref": "#/components/schemas/EffectApplicationRecord" }
          },
          "cardZoneSteps": {
            "type": "array",
            "description": "Ordered, purpose-independent card-zone transitions produced by this command frame.",
            "items": { "$ref": "#/components/schemas/CardZoneFlowStepRecord" }
          },
          "stateAfter": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Present in FullSnapshots mode; null in compact mode."
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 1,
            "description": "Sequence accepted by GET /timeline/{sequence}/state for compact frame lookup."
          }
        }
      },
      "EffectExecutionStep": {
        "type": "object",
        "required": ["index", "effectInstanceId", "targetEntityId", "repeatIndex", "targetIndex", "applied", "contentRevision", "provenance", "applications", "stateBeforeHash", "stateAfterHash"],
        "properties": {
          "index": { "type": "integer", "minimum": 0 },
          "effectInstanceId": { "type": "string" },
          "identity": { "type": "object", "nullable": true, "description": "Stable execution/proc/impact IDs and parent coordinates", "additionalProperties": true },
          "randomInputs": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "parameters": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "payloadCalculations": { "type": "array", "items": { "$ref": "#/components/schemas/CalculationTrace" } },
          "condensation": { "type": "object", "nullable": true, "description": "Captured source stacks, evaluation timing and aggregated quantities", "additionalProperties": true },
          "continuation": { "type": "object", "nullable": true, "description": "Causal defeat, configured overflow calculation, visited targets and stop reason", "additionalProperties": true },
          "sequenceBudgets": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "impactShares": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "targetEntityId": { "type": "string" },
          "repeatIndex": { "type": "integer", "minimum": 0 },
          "targetIndex": { "type": "integer", "minimum": 0 },
          "applied": { "type": "boolean" },
          "skipReason": { "type": "string", "nullable": true },
          "chanceRoll": { "type": "number", "nullable": true },
          "contentRevision": { "type": "string" },
          "provenance": { "type": "object", "additionalProperties": true },
          "calculation": { "allOf": [{ "$ref": "#/components/schemas/CalculationTrace" }], "nullable": true },
          "applications": { "type": "array", "items": { "$ref": "#/components/schemas/EffectApplicationRecord" } },
          "stateBeforeHash": { "type": "string" },
          "stateAfterHash": { "type": "string" },
          "runBeforeHash": { "type": "string", "nullable": true },
          "runAfterHash": { "type": "string", "nullable": true }
        }
      },
      "CalculationTrace": {
        "type": "object",
        "description": "Resolved calculation including ordered buckets, contributions and provenance.",
        "additionalProperties": true
      },
      "EffectApplicationRecord": {
        "type": "object",
        "required": ["effectInstanceId", "effectType", "targetEntityId", "provenance"],
        "properties": {
          "effectInstanceId": { "type": "string" },
          "identity": { "type": "object", "nullable": true, "additionalProperties": true },
          "resourceOutcome": { "type": "object", "nullable": true, "description": "Observed requested/applied/limited changes and causal defeat facts, not another damage formula", "additionalProperties": true },
          "attributeOutcome": { "type": "object", "nullable": true, "additionalProperties": true },
          "stackChanges": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "effectType": { "type": "string" },
          "targetEntityId": { "type": "string" },
          "resourceId": { "type": "string", "nullable": true },
          "resourceField": { "type": "string", "nullable": true },
          "resourceOperation": { "type": "string", "nullable": true },
          "previousValue": { "type": "number", "nullable": true },
          "currentValue": { "type": "number", "nullable": true },
          "statusId": { "type": "string", "nullable": true },
          "statusInstanceId": { "type": "string", "format": "uuid", "nullable": true },
          "removedStatusInstanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "cardInstanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "cardZoneSteps": { "type": "array", "items": { "$ref": "#/components/schemas/CardZoneFlowStepRecord" } },
          "modifierInstanceId": { "type": "string", "format": "uuid", "nullable": true },
          "modifierId": { "type": "string", "nullable": true },
          "removedModifierInstanceIds": {
            "type": "array",
            "description": "All modifier instances removed by this application, in deterministic order.",
            "items": { "type": "string", "format": "uuid" }
          },
          "modifierStackChanges": {
            "type": "array",
            "description": "Complete before/after stack trace for every affected modifier instance.",
            "items": { "$ref": "#/components/schemas/ModifierStackApplicationRecord" }
          },
          "provenance": { "type": "object", "additionalProperties": true }
        }
      },
      "CardZoneFlowStepRecord": {
        "type": "object",
        "description": "A single revisioned card-zone flow step, including ordering and deterministic state hashes.",
        "required": ["flowId", "stepId", "operation", "instanceIds", "createdInstanceIds", "destroyedInstanceIds", "previousStateHash", "stateHash"],
        "properties": {
          "flowId": { "type": "string" },
          "stepId": { "type": "string" },
          "operation": { "type": "string" },
          "sourceAddress": { "type": "string", "nullable": true },
          "targetAddress": { "type": "string", "nullable": true },
          "instanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "createdInstanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "destroyedInstanceIds": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "sourceOrderBefore": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "sourceOrderAfter": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "targetOrderBefore": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "targetOrderAfter": { "type": "array", "items": { "type": "string", "format": "uuid" } },
          "randomDrawStart": { "type": "integer", "format": "uint64" },
          "randomDrawEnd": { "type": "integer", "format": "uint64" },
          "previousStateHash": { "type": "string" },
          "stateHash": { "type": "string" }
        }
      },
      "ModifierStackApplicationRecord": {
        "type": "object",
        "required": ["modifierInstanceId", "modifierId", "previousStacks", "currentStacks", "removed"],
        "properties": {
          "modifierInstanceId": { "type": "string", "format": "uuid" },
          "modifierId": { "type": "string" },
          "previousStacks": { "type": "integer", "minimum": 0 },
          "currentStacks": { "type": "integer", "minimum": 0 },
          "removed": { "type": "boolean" }
        }
      },
      "CombatTimelineItem": {
        "type": "object",
        "required": ["runSequence", "combatStep", "turn", "commandType", "previousStateHash", "stateHash", "stateAvailable", "frames", "facts", "summary"],
        "properties": {
          "runSequence": { "type": "integer", "minimum": 1 },
          "combatStep": { "type": "integer", "format": "uint64" },
          "turn": { "type": "integer", "minimum": 0 },
          "phase": { "type": "string", "nullable": true },
          "actorId": { "type": "string", "nullable": true },
          "commandType": { "type": "string" },
          "commandId": { "type": "string", "format": "uuid", "nullable": true },
          "rootCommandId": { "type": "string", "format": "uuid", "nullable": true },
          "resolutionCommandId": { "type": "string", "format": "uuid", "nullable": true, "description": "Use with GET /resolutions/{commandId}; null when the item has no visual resolution." },
          "resolutionFingerprint": { "type": "string", "nullable": true },
          "previousStateHash": { "type": "string" },
          "stateHash": { "type": "string" },
          "stateAvailable": { "type": "boolean" },
          "frames": { "type": "array", "items": { "$ref": "#/components/schemas/RunCommitFrame" } },
          "facts": { "type": "array", "items": { "$ref": "#/components/schemas/RunCommitFact" } },
          "summary": { "type": "object", "additionalProperties": true }
        }
      },
      "ReplayCommandPresentation": {
        "type": "object",
        "properties": {
          "runId": { "type": "string", "format": "uuid" }, "settingId": { "type": "string" },
          "lineage": { "type": "object", "nullable": true }, "contentRevision": { "type": "string" },
          "sequence": { "type": "integer" }, "commandType": { "type": "string" },
          "stateHash": { "type": "string" }, "previousStateHash": { "type": "string" },
          "stateSummary": {
            "type": "object",
            "properties": {
              "lifecycle": { "type": "string" }, "currentNodeId": { "type": "string", "nullable": true },
              "cardCount": { "type": "integer" }, "relicCount": { "type": "integer" },
              "resources": { "type": "array", "items": { "type": "object", "properties": {
                "resourceId": { "type": "string" }, "current": { "type": "number" }, "maximum": { "type": "number" } } } },
              "transcript": { "type": "array", "items": { "type": "object", "properties": {
                "nodeId": { "type": "string" }, "choiceId": { "type": "string", "nullable": true },
                "speaker": { "type": "object" }, "text": { "type": "object" } } } }
            }
          }
        }
      },
      "ReplayTimelinePage": {
        "type": "object",
        "required": ["runId", "settingId", "afterSequence", "throughSequence", "nextCursor", "hasMore", "items", "validationKind"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "settingId": { "type": "string" },
          "lineage": { "type": "object", "nullable": true },
          "contentRevision": { "type": "string" },
          "afterSequence": { "type": "integer" },
          "throughSequence": { "type": "integer" },
          "nextCursor": { "type": "integer" },
          "hasMore": { "type": "boolean" },
          "returned": { "type": "integer" },
          "validationKind": { "type": "string", "enum": ["StructuralChain"] },
          "historicalInspectionAllowed": { "type": "boolean", "description": "Effective mode/operator permission; false means only timeline headers are accessible." },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/ReplayTimelineItem" } }
        }
      },
      "ReplayTimelineItem": {
        "type": "object",
        "properties": {
          "sequence": { "type": "integer" },
          "step": { "type": "integer", "format": "uint64" },
          "commandId": { "type": "string", "format": "uuid" },
          "commandType": { "type": "string" },
          "logicalTimestamp": { "type": "string", "format": "date-time" },
          "previousStateHash": { "type": "string" },
          "stateHash": { "type": "string" },
          "frameCount": { "type": "integer" },
          "frames": { "type": "array", "items": { "$ref": "#/components/schemas/ReplayFrameHeader" } }
        }
      },
      "ReplayFrameHeader": {
        "type": "object",
        "properties": {
          "frameIndex": { "type": "integer" }, "step": { "type": "integer" },
          "scope": { "type": "string" }, "kind": { "type": "string" },
          "combatId": { "type": "string", "format": "uuid", "nullable": true },
          "actorId": { "type": "string", "nullable": true },
          "phaseId": { "type": "string", "nullable": true },
          "round": { "type": "integer", "nullable": true },
          "activation": { "type": "integer", "nullable": true }
        }
      },
      "RunCommitFrame": {
        "type": "object",
        "required": ["frameIndex", "step", "scope", "kind", "resultHash", "resolution"],
        "properties": {
          "frameIndex": { "type": "integer", "minimum": 0 },
          "step": { "type": "integer", "format": "uint64" },
          "scope": { "type": "string" },
          "kind": { "type": "string" },
          "combatId": { "type": "string", "format": "uuid", "nullable": true },
          "actorId": { "type": "string", "nullable": true },
          "phaseId": { "type": "string", "nullable": true },
          "round": { "type": "integer", "nullable": true },
          "activation": { "type": "integer", "nullable": true },
          "resultHash": { "type": "string" },
          "resolution": { "type": "object", "additionalProperties": true }
        }
      },
      "RunCommitFact": {
        "type": "object",
        "required": ["factIndex", "step", "scope", "type", "payload"],
        "properties": {
          "factIndex": { "type": "integer", "minimum": 0 },
          "step": { "type": "integer", "format": "uint64" },
          "scope": { "type": "string" },
          "type": { "type": "string" },
          "combatId": { "type": "string", "format": "uuid", "nullable": true },
          "actorId": { "type": "string", "nullable": true },
          "phaseId": { "type": "string", "nullable": true },
          "round": { "type": "integer", "nullable": true },
          "activation": { "type": "integer", "nullable": true },
          "payload": { "type": "object", "additionalProperties": true }
        }
      },
      "RunLineage": {
        "type": "object",
        "required": ["rootRunId", "internalSimulation"],
        "properties": {
          "rootRunId": { "type": "string", "format": "uuid" },
          "parentRunId": { "type": "string", "format": "uuid", "nullable": true },
          "sourceSequence": { "type": "integer", "minimum": 1, "nullable": true },
          "sourceStateHash": { "type": "string", "nullable": true },
          "sourceCombatId": { "type": "string", "format": "uuid", "nullable": true },
          "branchKey": { "type": "string", "nullable": true },
          "internalSimulation": { "type": "boolean" }
        }
      },
      "RunBranchTreeNode": {
        "type": "object",
        "required": ["runId", "rootRunId", "sequence", "step", "stateHash", "children"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "rootRunId": { "type": "string", "format": "uuid" },
          "parentRunId": { "type": "string", "format": "uuid", "nullable": true },
          "sourceCombatId": { "type": "string", "format": "uuid", "nullable": true },
          "sourceSequence": { "type": "integer", "minimum": 1, "nullable": true },
          "sourceStateHash": { "type": "string", "nullable": true },
          "branchKey": { "type": "string", "nullable": true },
          "sequence": { "type": "integer", "minimum": 1 },
          "step": { "type": "integer", "format": "uint64" },
          "stateHash": { "type": "string" },
          "children": { "type": "array", "items": { "$ref": "#/components/schemas/RunBranchTreeNode" } }
        }
      },
      "CombatTimelinePage": {
        "type": "object",
        "required": ["runId", "combatId", "afterSequence", "nextCursor", "items", "turnGroups"],
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "combatId": { "type": "string", "format": "uuid" },
          "afterSequence": { "type": "integer", "minimum": 0 },
          "nextCursor": { "type": "integer", "minimum": 0 },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/CombatTimelineItem" } },
          "turnGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["turn", "items"],
              "properties": {
                "turn": { "type": "integer", "minimum": 0 },
                "items": { "type": "array", "items": { "$ref": "#/components/schemas/CombatTimelineItem" } }
              }
            }
          }
        }
      },
      "CardTransformationAssessment": {
        "type": "object",
        "properties": {
          "runId": { "type": "string", "format": "uuid" },
          "cardInstanceId": { "type": "string", "format": "uuid" },
          "contentRevision": { "type": "string" },
          "expectedSequence": { "type": "integer" },
          "expectedStep": { "type": "integer", "format": "uint64" },
          "isCompatible": { "type": "boolean" },
          "diagnostics": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "before": { "type": "object", "nullable": true, "additionalProperties": true },
          "after": { "type": "object", "nullable": true, "additionalProperties": true },
          "costs": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "CardProcPreview": {
        "type": "object",
        "properties": {
          "procId": { "type": "string" },
          "parentProcId": { "type": "string", "nullable": true },
          "isCondensation": { "type": "boolean" },
          "impactIds": { "type": "array", "items": { "type": "string" } },
          "targetEntityIds": { "type": "array", "items": { "type": "string" } },
          "consumedStacks": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "continuations": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        }
      },
      "CardInspectionResult": {
        "type": "object",
        "required": ["version", "detail", "zone", "isInPlayableZone", "isPlayable", "baseContainer", "compiledContainer", "appliedUpgrades", "effectiveBase", "evaluation", "calculations", "previewSteps", "previewApplications", "resolutionFingerprint"],
        "properties": {
          "presentation": {"allOf": [{"$ref": "#/components/schemas/CardPresentationFacts"}], "nullable": true},
          "version": { "type": "object", "description": "Run, combat, engine and content-revision coordinates used by this projection", "additionalProperties": true },
          "previewScope": { "type": "object", "description": "Exact only for the captured snapshot, target IDs and cost option; dependsOnRandomInputs does not mean nondeterministic. GET never consumes RNG.", "additionalProperties": true },
          "randomOutcomes": { "$ref": "#/components/schemas/RandomOutcomePreview" },
          "procs": { "type": "array", "items": { "$ref": "#/components/schemas/CardProcPreview" } },
          "detail": { "type": "string", "enum": ["Resolved", "Full"] },
          "zone": { "type": "string", "description": "Authored card-zone identifier containing this instance." },
          "isInPlayableZone": { "type": "boolean" },
          "isPlayable": { "type": "boolean", "description": "Includes card conditions, costs, targeting, active actor, phase and action budget." },
          "baseContainer": { "type": "object", "additionalProperties": true },
          "compiledContainer": { "type": "object", "additionalProperties": true },
          "appliedUpgrades": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "effectiveBase": { "type": "object", "additionalProperties": true },
          "contextSources": { "type": "object", "nullable": true, "description": "Pinned actor, targets, statuses, relics, modifiers and mode policies; present only at Full detail.", "additionalProperties": true },
          "evaluation": { "type": "object", "additionalProperties": true },
          "calculations": { "type": "array", "description": "Configured bucket traces and influence provenance", "items": { "type": "object", "additionalProperties": true } },
          "previewSteps": { "type": "array", "description": "Ordered effect trace produced by the same pure transaction used by PLAY_CARD", "items": { "$ref": "#/components/schemas/EffectExecutionStep" } },
          "previewApplications": { "type": "array", "description": "Exact immutable effect preview from the current deterministic snapshot", "items": { "type": "object", "additionalProperties": true } },
          "resolutionFingerprint": { "type": "string" }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "required": ["type", "title", "status", "detail", "instance", "code", "correlationId"],
        "properties": {
          "type": { "type": "string", "format": "uri-reference" },
          "title": { "type": "string" },
          "status": { "type": "integer" },
          "detail": { "type": "string" },
          "instance": { "type": "string", "format": "uri-reference" },
          "code": { "type": "string", "description": "Stable machine-readable HeroScript error code" },
          "correlationId": { "type": "string", "description": "Request correlation identifier" },
          "currentSequence": { "type": "integer", "description": "Authoritative sequence when a command conflicts" },
          "currentStep": { "type": "integer", "format": "uint64", "description": "Authoritative deterministic step when a command conflicts" }
        }
      }
    }
  }
}
