{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roark/json-schema/roark-create-autoimprove-job-input-schema.json",
  "title": "CreateAutoimproveJobInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/roark-autoimprove-api-openapi.yml#/components/schemas/CreateAutoimproveJobInput",
  "type": "object",
  "properties": {
    "agentId": {
      "type": "string",
      "format": "uuid",
      "description": "The production agent to improve. It is never modified until you promote."
    },
    "objectiveMetricDefinitionId": {
      "type": "string",
      "format": "uuid",
      "description": "The metric that defines success: a pass/fail metric, or a threshold variant of a scale metric (for example \"PII Handling >= 4\"). Roark measures the pass rate of this metric across simulated calls."
    },
    "objectiveLabel": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Human-readable label for the objective, shown everywhere the job appears."
    },
    "targetValue": {
      "type": "number",
      "minimum": 1,
      "maximum": 100,
      "default": 90,
      "description": "The pass-rate percentage that counts as fixed. Defaults to 90."
    },
    "stagingAgentId": {
      "type": "string",
      "format": "uuid",
      "description": "An existing agent to stage changes on instead of the default shadow clone. Must be a different agent from agentId, on the same provider."
    },
    "customerIntegrationId": {
      "type": "string",
      "format": "uuid",
      "description": "The provider integration whose credentials Roark uses. Omit to use the project's active integration for the agent's provider. The integration must have agent config writes enabled."
    },
    "validationRunPlanId": {
      "type": "string",
      "format": "uuid",
      "description": "An existing simulation run plan to validate with. Omit to let Roark author its own suite."
    },
    "maxIterations": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "Cap on decision turns. Defaults to 50."
    },
    "maxSimCalls": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2000,
      "description": "Cap on simulated calls dialed. Defaults to 200."
    }
  },
  "required": [
    "agentId",
    "objectiveMetricDefinitionId",
    "objectiveLabel"
  ]
}