{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/revyl/main/json-schema/revyl-start-device-info-schema.json",
  "title": "StartDeviceInfo",
  "x-generated": "2026-10-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revyl-openapi.json#/components/schemas/StartDeviceInfo",
  "properties": {
    "app_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "CogniSim `apps` table row UUID. The backend resolves the latest build (presigned `app_link` / `app_url`) and native `package_name` from this id. Do not use for Android package name or iOS bundle id — use `app_package`.",
      "title": "App Id"
    },
    "app_link": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "App Link"
    },
    "app_package": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "App Package"
    },
    "app_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "App Url"
    },
    "backend_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Backend Url"
    },
    "branch_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Branch Id"
    },
    "branch_name": {
      "anyOf": [
        {
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Branch Name"
    },
    "build_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Specific `builds` table row UUID. When provided, the backend uses this exact build instead of resolving the latest build for the given `app_id`.",
      "title": "Build Id"
    },
    "build_selection": {
      "$ref": "#/$defs/BuildSelectionMode",
      "default": "inherit"
    },
    "context_branch_name": {
      "anyOf": [
        {
          "maxLength": 4096,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Context Branch Name"
    },
    "device_local": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "title": "Device Local"
    },
    "device_model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Device Model"
    },
    "device_runner_id": {
      "anyOf": [
        {
          "pattern": "^[a-zA-Z0-9._\\-]{1,128}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional worker DEVICE_ID label to require for direct device sessions.",
      "title": "Device Runner Id"
    },
    "env_vars": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Env Vars"
    },
    "exploration_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExplorationSessionConfig"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional reusable exploration-run context. When present, the worker can run an exploratory session instead of a static test."
    },
    "idle_timeout_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Idle Timeout Seconds"
    },
    "is_simulation": {
      "default": false,
      "title": "Is Simulation",
      "type": "boolean"
    },
    "launch_arguments": {
      "anyOf": [
        {
          "items": {
            "minLength": 1,
            "pattern": "^[^\\x00]+$",
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "description": "Explicit iOS app arguments in exact token order",
      "title": "Launch Arguments"
    },
    "launch_env_var_ids": {
      "anyOf": [
        {
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "description": "Org launch variable IDs selected for a raw device session. Only valid when `test_id` is absent.",
      "title": "Launch Env Var Ids"
    },
    "org_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Org Id"
    },
    "os_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Os Version"
    },
    "pinned_build_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pinned Build Id"
    },
    "platform": {
      "default": "android",
      "title": "Platform",
      "type": "string"
    },
    "run_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/TestRunConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "scm_preview_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional SCM preview context for an exact build launch. The backend validates the frozen review/build association and applies its session authentication, timeout, and attribution settings.",
      "title": "Scm Preview Id"
    },
    "session_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id"
    },
    "startup_session_start_monotonic": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Startup Session Start Monotonic"
    },
    "storekit_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/IosStoreKitConfigSnapshot"
        },
        {
          "type": "null"
        }
      ],
      "description": "Resolved iOS StoreKit Testing config for this launch."
    },
    "test_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Test Id"
    },
    "test_info": {
      "anyOf": [
        {
          "$ref": "#/$defs/Test"
        },
        {
          "type": "null"
        }
      ]
    },
    "user_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id"
    },
    "viewport": {
      "anyOf": [
        {
          "$ref": "#/$defs/Viewport"
        },
        {
          "type": "null"
        }
      ]
    },
    "web": {
      "anyOf": [
        {
          "$ref": "#/$defs/WebSessionOptions"
        },
        {
          "type": "null"
        }
      ]
    },
    "worker_ws_server": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Worker Ws Server"
    },
    "workflow_run_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workflow Run Id"
    }
  },
  "type": "object",
  "$defs": {
    "ActionBlock": {
      "description": "Block for actions (instructions, extraction, manual, validation, code_execution, module_import).",
      "properties": {
        "file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Canonical org file name for download_file / play_audio blocks in authored YAML/product payloads",
          "title": "File"
        },
        "file_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Resolved revyl-file:// URI for download_file / play_audio blocks",
          "title": "File Uri"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Unique identifier for the block (auto-generated if not provided)",
          "title": "Id"
        },
        "module": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Canonical module name for module_import blocks in authored YAML/product payloads",
          "title": "Module"
        },
        "module_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the module to import (for module_import blocks)",
          "title": "Module Id"
        },
        "script": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Canonical script name for code_execution blocks in authored YAML/product payloads",
          "title": "Script"
        },
        "script_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Resolved script UUID for code_execution blocks",
          "title": "Script Id"
        },
        "step_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Authored step text or legacy payload. Optional for canonical reference blocks such as code_execution.script, module_import.module, download_file.file, and no-parameter manual steps.",
          "title": "Step Description"
        },
        "step_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/StepType"
            },
            {
              "type": "null"
            }
          ],
          "description": "Type of step action (inferred when omitted)",
          "title": "Step Type"
        },
        "type": {
          "description": "Must be one of: instructions, extraction, manual, validation, code_execution, module_import",
          "enum": [
            "instructions",
            "extraction",
            "manual",
            "validation",
            "code_execution",
            "module_import"
          ],
          "title": "Type",
          "type": "string"
        },
        "variable_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Name of the variable captured by extraction blocks",
          "title": "Variable Name"
        },
        "variable_scope": {
          "anyOf": [
            {
              "enum": [
                "test",
                "global"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Scope of the variable assigned by extraction or code-execution blocks. 'test' (or omitted) writes to the test-scoped variables table; 'global' writes to a pre-existing, non-secret org-level global variable.",
          "title": "Variable Scope"
        }
      },
      "required": [
        "type"
      ],
      "title": "ActionBlock",
      "type": "object"
    },
    "BuildSelectionMode": {
      "enum": [
        "inherit",
        "latest",
        "pinned",
        "latest_all_branches"
      ],
      "title": "BuildSelectionMode",
      "type": "string"
    },
    "CacheRetryMode": {
      "description": "Cache retry policy for test execution.\n\n- NONE: No cache fallback, fail if cached steps fail\n- FULL_RERUN: If cached run fails, rerun entire test without cache",
      "enum": [
        "none",
        "full_rerun"
      ],
      "title": "CacheRetryMode",
      "type": "string"
    },
    "CleanupLevel": {
      "description": "Cleanup intensity level for AVD state reset between test runs.",
      "enum": [
        "none",
        "thorough",
        "deep_clean"
      ],
      "title": "CleanupLevel",
      "type": "string"
    },
    "DOMMetadata": {
      "additionalProperties": true,
      "properties": {
        "a11y_data": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "A11Y Data"
        },
        "code_input": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Code Input"
        },
        "file_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Url"
        },
        "input_selector": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Input Selector"
        },
        "selector": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Selector"
        },
        "validation_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Validation Text"
        },
        "validation_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Validation Type"
        },
        "variable_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Variable Name"
        },
        "wait_time": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Wait Time"
        }
      },
      "title": "DOMMetadata",
      "type": "object"
    },
    "DeviceCleanupConfig": {
      "description": "Configuration for AVD cleanup between test runs.\n\nControls what gets reset when resetting device state between tests\nwhile keeping the emulator running.",
      "properties": {
        "cleanup_level": {
          "$ref": "#/$defs/CleanupLevel",
          "default": "thorough",
          "description": "Level of cleanup to perform (default: THOROUGH for maximum cleanup)"
        },
        "clear_app_data": {
          "default": true,
          "description": "Clear app data and cache via pm clear",
          "title": "Clear App Data",
          "type": "boolean"
        },
        "clear_browser_data": {
          "default": true,
          "description": "Clear browsing data (history, cookies, cache) from all browsers",
          "title": "Clear Browser Data",
          "type": "boolean"
        },
        "clear_clipboard": {
          "default": true,
          "description": "Clear clipboard contents",
          "title": "Clear Clipboard",
          "type": "boolean"
        },
        "clear_downloads": {
          "default": true,
          "description": "Clear /sdcard/Download folder",
          "title": "Clear Downloads",
          "type": "boolean"
        },
        "clear_notifications": {
          "default": true,
          "description": "Clear all pending notifications from previous test sessions",
          "title": "Clear Notifications",
          "type": "boolean"
        },
        "clear_recent_apps": {
          "default": false,
          "description": "Clear recent apps list (requires root access, restarts framework). Expensive (~15-30s), broken on Play Store images. Auto-enabled for DEEP_CLEAN.",
          "title": "Clear Recent Apps",
          "type": "boolean"
        },
        "clear_shared_storage": {
          "default": true,
          "description": "Clear Pictures, DCIM, Movies, Music, Documents folders",
          "title": "Clear Shared Storage",
          "type": "boolean"
        },
        "custom_paths_to_clear": {
          "description": "Additional paths to clear on device",
          "items": {
            "type": "string"
          },
          "title": "Custom Paths To Clear",
          "type": "array"
        },
        "kill_background_apps": {
          "default": true,
          "description": "Kill all background applications",
          "title": "Kill Background Apps",
          "type": "boolean"
        },
        "reset_system_ui": {
          "default": false,
          "description": "Reset SystemUI state including wallpaper to defaults. Expensive (~2-3s). Auto-enabled for DEEP_CLEAN.",
          "title": "Reset System Ui",
          "type": "boolean"
        },
        "revoke_permissions": {
          "default": true,
          "description": "Revoke runtime permissions granted during test",
          "title": "Revoke Permissions",
          "type": "boolean"
        },
        "uninstall_new_apps": {
          "default": true,
          "description": "Uninstall apps that were installed during the test session",
          "title": "Uninstall New Apps",
          "type": "boolean"
        }
      },
      "title": "DeviceCleanupConfig",
      "type": "object"
    },
    "ExecutionModeConfig": {
      "description": "Configuration for execution modes and features.",
      "properties": {
        "cleanup_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/DeviceCleanupConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Configuration for AVD cleanup between test runs"
        },
        "enable_planning": {
          "default": false,
          "description": "Enable planning for complex steps",
          "title": "Enable Planning",
          "type": "boolean"
        },
        "enable_reflection": {
          "default": true,
          "description": "Enable reflection on failed steps",
          "title": "Enable Reflection",
          "type": "boolean"
        },
        "grounder_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/GrounderType"
            },
            {
              "type": "null"
            }
          ],
          "default": "moondream3"
        },
        "initial_locale": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Initial device locale identifier, for example 'en_US' or 'fr_FR'",
          "title": "Initial Locale"
        },
        "initial_location": {
          "anyOf": [
            {
              "$ref": "#/$defs/LocationConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Initial GPS location to set when simulator boots"
        },
        "initial_orientation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Initial device orientation: 'portrait' or 'landscape'",
          "title": "Initial Orientation"
        },
        "network_capture": {
          "default": true,
          "description": "Attach an in-process TLS-capture agent to the (debuggable) app under test to record decrypted HTTP traffic. On by default (no-op/graceful on non-debuggable apps or attach failure); set False to disable as a per-run kill switch.",
          "title": "Network Capture",
          "type": "boolean"
        },
        "reflection_retries": {
          "default": 1,
          "description": "Number of reflection retry attempts",
          "title": "Reflection Retries",
          "type": "integer"
        },
        "retries": {
          "default": 1,
          "description": "Number of retry attempts",
          "title": "Retries",
          "type": "integer"
        },
        "skip_app_install": {
          "default": false,
          "description": "Skip app installation during test execution",
          "title": "Skip App Install",
          "type": "boolean"
        }
      },
      "title": "ExecutionModeConfig",
      "type": "object"
    },
    "ExplorationSessionConfig": {
      "description": "Per-device-session exploration contract passed from API to worker.",
      "properties": {
        "atlas_context": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Atlas Context"
        },
        "auth_instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Auth Instructions"
        },
        "initial_instruction": {
          "title": "Initial Instruction",
          "type": "string"
        },
        "lane_index": {
          "maximum": 99.0,
          "minimum": 0.0,
          "title": "Lane Index",
          "type": "integer"
        },
        "lane_role": {
          "title": "Lane Role",
          "type": "string"
        },
        "max_duration_seconds": {
          "default": 1800,
          "maximum": 7200.0,
          "minimum": 60.0,
          "title": "Max Duration Seconds",
          "type": "integer"
        },
        "max_turns": {
          "anyOf": [
            {
              "maximum": 50.0,
              "minimum": 1.0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Turns"
        },
        "mode": {
          "const": "atlas_coverage",
          "default": "atlas_coverage",
          "title": "Mode",
          "type": "string"
        },
        "run_id": {
          "format": "uuid",
          "title": "Run Id",
          "type": "string"
        },
        "run_session_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Run Session Id"
        },
        "seed_instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Seed Instructions"
        }
      },
      "required": [
        "run_id",
        "lane_index",
        "lane_role",
        "initial_instruction"
      ],
      "title": "ExplorationSessionConfig",
      "type": "object"
    },
    "FallbackTrigger": {
      "description": "When to trigger cache fallback.\n\n- FINAL_FAIL: Only trigger fallback if overall test fails",
      "enum": [
        "final_fail"
      ],
      "title": "FallbackTrigger",
      "type": "string"
    },
    "GrounderType": {
      "description": "Grounder configuration that determines the grounding model.\n\n- MOONDREAM/MOONDREAM3/MOONDREAM_CUSTOM/MODAL_CUSTOM: Two-step grounding\n- AUTO: Use GROUNDER_TYPE env var to determine grounder\n- NULL: Skip grounding (for testing/debugging)",
      "enum": [
        "moondream",
        "moondream3",
        "moondream_custom",
        "modal-custom",
        "auto",
        "null"
      ],
      "title": "GrounderType",
      "type": "string"
    },
    "IfBlock": {
      "description": "Block for conditional logic.",
      "properties": {
        "condition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Condition to evaluate (alternative to 'step_description')",
          "title": "Condition"
        },
        "elseChildren": {
          "description": "Blocks to execute if condition is false",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/ActionBlock"
              },
              {
                "$ref": "#/$defs/IfBlock"
              },
              {
                "$ref": "#/$defs/WhileBlock"
              }
            ]
          },
          "title": "Elsechildren",
          "type": "array"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Unique identifier for the block (auto-generated if not provided)",
          "title": "Id"
        },
        "step_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Condition to evaluate (alternative to 'condition')",
          "title": "Step Description"
        },
        "thenChildren": {
          "description": "Blocks to execute if condition is true",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/ActionBlock"
              },
              {
                "$ref": "#/$defs/IfBlock"
              },
              {
                "$ref": "#/$defs/WhileBlock"
              }
            ]
          },
          "title": "Thenchildren",
          "type": "array"
        },
        "type": {
          "const": "if",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "IfBlock",
      "type": "object"
    },
    "IosStoreKitConfigSnapshot": {
      "description": "Resolved iOS StoreKit config snapshot carried to worker launch.",
      "properties": {
        "available": {
          "default": true,
          "title": "Available",
          "type": "boolean"
        },
        "content_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Type"
        },
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "file_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Id"
        },
        "file_size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Size"
        },
        "filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filename"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mode"
        },
        "scope_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scope Id"
        },
        "scope_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scope Type"
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source"
        }
      },
      "title": "IosStoreKitConfigSnapshot",
      "type": "object"
    },
    "LLMConfig": {
      "description": "Configuration for LLM models used in different stages.",
      "properties": {
        "planning_model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "LLM model for planning, defaults to primary_model if not set",
          "title": "Planning Model"
        },
        "primary_model": {
          "default": "gemini/gemini-3.8-flash",
          "description": "Primary LLM model for step execution",
          "title": "Primary Model",
          "type": "string"
        },
        "reflection_model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "LLM model for reflection, defaults to primary_model if not set",
          "title": "Reflection Model"
        }
      },
      "title": "LLMConfig",
      "type": "object"
    },
    "LocationConfig": {
      "description": "GPS location configuration for simulator/emulator.",
      "properties": {
        "latitude": {
          "description": "GPS latitude coordinate (-90 to 90)",
          "maximum": 90.0,
          "minimum": -90.0,
          "title": "Latitude",
          "type": "number"
        },
        "longitude": {
          "description": "GPS longitude coordinate (-180 to 180)",
          "maximum": 180.0,
          "minimum": -180.0,
          "title": "Longitude",
          "type": "number"
        }
      },
      "required": [
        "latitude",
        "longitude"
      ],
      "title": "LocationConfig",
      "type": "object"
    },
    "MobileTarget": {
      "description": "Persisted device target for a test (from ``test_mobile_targets``).\n\n``AUTO/AUTO`` represents \"follow the platform default at runtime\".",
      "properties": {
        "device_model": {
          "title": "Device Model",
          "type": "string"
        },
        "os_version": {
          "title": "Os Version",
          "type": "string"
        }
      },
      "required": [
        "device_model",
        "os_version"
      ],
      "title": "MobileTarget",
      "type": "object"
    },
    "ResolvedBuild": {
      "description": "Normalized representation of a resolved build artifact.",
      "properties": {
        "artifact_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Artifact Kind"
        },
        "artifact_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Artifact Url"
        },
        "branch_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Branch Id"
        },
        "branch_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Branch Name"
        },
        "build_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Build Name"
        },
        "build_var_id": {
          "format": "uuid",
          "title": "Build Var Id",
          "type": "string"
        },
        "deploy_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deploy Url"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "download_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Download Url"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        },
        "package_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Package Name"
        },
        "platform": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Platform"
        },
        "static_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Static Url"
        },
        "system_prompt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "System Prompt"
        },
        "uploaded_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uploaded At"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version"
        },
        "version_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version Id"
        }
      },
      "required": [
        "build_var_id"
      ],
      "title": "ResolvedBuild",
      "type": "object"
    },
    "StepType": {
      "description": "User-facing step types for YAML test definitions.\n\nThese are the high-level step types that users write in their tests.\nThey map to TASK_TYPES for routing and ActionType for execution.",
      "enum": [
        "instruction",
        "validation",
        "extract",
        "scrape",
        "decision",
        "loop",
        "explore_continue",
        "end",
        "wait",
        "navigate",
        "back",
        "open_app",
        "kill_app",
        "go_home",
        "code_execution",
        "download_file",
        "set_location",
        "set_orientation",
        "set_appearance",
        "play_audio",
        "set_font_size",
        "module_import",
        "tap",
        "click",
        "double_tap",
        "input",
        "swipe",
        "drag",
        "pinch",
        "clear_text",
        "long_press",
        "select"
      ],
      "title": "StepType",
      "type": "string"
    },
    "Tag": {
      "description": "Tag model for API responses - used for test categorization.",
      "properties": {
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "#6B7280",
          "title": "Color"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "title": "Tag",
      "type": "object"
    },
    "TaskMetadata": {
      "properties": {
        "agent_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Human-readable instruction describing what the agent did, e.g. 'Click the Sign In button'",
          "title": "Agent Description"
        },
        "download": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "title": "Download"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "metadata": {
          "anyOf": [
            {
              "$ref": "#/$defs/DOMMetadata"
            },
            {
              "type": "null"
            }
          ]
        },
        "step": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Deprecated: Use step_description instead",
          "title": "Step"
        },
        "step_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/TestRunConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Step-level configuration that overrides test-level config"
        },
        "step_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Human-readable description of the step",
          "title": "Step Description"
        },
        "step_type": {
          "title": "Step Type",
          "type": "string"
        }
      },
      "required": [
        "step_type"
      ],
      "title": "TaskMetadata",
      "type": "object"
    },
    "Test": {
      "additionalProperties": true,
      "properties": {
        "app_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "App Id"
        },
        "app_link": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "App Link"
        },
        "app_package": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "App Package"
        },
        "backend_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Backend Url"
        },
        "branch_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Branch Id"
        },
        "build_selection": {
          "$ref": "#/$defs/BuildSelectionMode",
          "default": "inherit"
        },
        "device_local": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "title": "Device Local"
        },
        "expected_version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Expected version for optimistic locking. If provided and doesn't match current version, update will fail with 409 Conflict.",
          "title": "Expected Version"
        },
        "flowdescription": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "",
          "title": "Flowdescription"
        },
        "get_downloads": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "title": "Get Downloads"
        },
        "id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "last_duration": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Duration of the most recent execution in seconds",
          "title": "Last Duration"
        },
        "last_execution_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Execution ID of the most recent execution for deep-linking to report (was last_task_id)",
          "title": "Last Execution Id"
        },
        "last_execution_time": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO timestamp of the most recent execution completion",
          "title": "Last Execution Time"
        },
        "last_modified_by": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "UUID of the user who last modified this test.",
          "title": "Last Modified By"
        },
        "last_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Status of the most recent execution (success, failure, timeout, cancelled, running, queued, setup, verifying, or None)",
          "title": "Last Status"
        },
        "link": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "",
          "title": "Link"
        },
        "llm_model_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Llm Model Name"
        },
        "mobile_targets": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/MobileTarget"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Saved device model + runtime targets for this test",
          "title": "Mobile Targets"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "orientation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Device orientation from test_mobile_details ('portrait' or 'landscape')",
          "title": "Orientation"
        },
        "owner": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Owner"
        },
        "package_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Package Name"
        },
        "pinned_build_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pinned Build Id"
        },
        "pinned_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pinned Version"
        },
        "platform": {
          "default": "Android",
          "title": "Platform",
          "type": "string"
        },
        "resolved_build": {
          "anyOf": [
            {
              "$ref": "#/$defs/ResolvedBuild"
            },
            {
              "type": "null"
            }
          ]
        },
        "retries": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": 1,
          "title": "Retries"
        },
        "run_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/TestRunConfig"
            },
            {
              "type": "null"
            }
          ]
        },
        "run_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Run Id"
        },
        "tags": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Tag"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Tags associated with this test for categorization and filtering",
          "title": "Tags"
        },
        "tasks": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ActionBlock"
                  },
                  {
                    "$ref": "#/$defs/IfBlock"
                  },
                  {
                    "$ref": "#/$defs/WhileBlock"
                  }
                ]
              },
              "type": "array"
            },
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "items": {
                "$ref": "#/$defs/TaskMetadata"
              },
              "type": "array"
            }
          ],
          "default": [],
          "title": "Tasks"
        },
        "test_timeout_seconds": {
          "anyOf": [
            {
              "minimum": 0.0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Per-test execution timeout in seconds. Null disables the override.",
          "title": "Test Timeout Seconds"
        },
        "test_version_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Revision record matching the loaded version and tasks, if one exists.",
          "title": "Test Version Id"
        },
        "user_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Id"
        },
        "version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Current version number for optimistic locking. Increments on each save.",
          "title": "Version"
        },
        "viewport": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Viewport"
        }
      },
      "title": "Test",
      "type": "object"
    },
    "TestRunConfig": {
      "description": "Complete configuration for a test run.",
      "properties": {
        "cache_retry_mode": {
          "$ref": "#/$defs/CacheRetryMode",
          "default": "full_rerun",
          "description": "Cache retry policy"
        },
        "disable_grid": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "Admin-only: Disable grid preprocessing for grounding",
          "title": "Disable Grid"
        },
        "disable_video_validation": {
          "default": false,
          "description": "When true, skip the background video validation check on VALIDATION steps; the screenshot verdict alone decides validation outcomes.",
          "title": "Disable Video Validation",
          "type": "boolean"
        },
        "execution_mode": {
          "$ref": "#/$defs/ExecutionModeConfig",
          "default": {
            "enable_planning": false,
            "enable_reflection": true,
            "grounder_type": "moondream3",
            "network_capture": true,
            "reflection_retries": 1,
            "retries": 1,
            "skip_app_install": false
          },
          "description": "Execution mode configuration"
        },
        "fail_fast": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "When true, the test halts immediately on the first failed validation or non-zero script exit code instead of continuing through remaining steps. Unset inherits the test-level value under a workflow override and otherwise behaves as false.",
          "title": "Fail Fast"
        },
        "fallback_trigger": {
          "$ref": "#/$defs/FallbackTrigger",
          "default": "final_fail",
          "description": "When to trigger cache fallback"
        },
        "llm_config": {
          "$ref": "#/$defs/LLMConfig",
          "default": {
            "planning_model": "gemini/gemini-3.8-flash",
            "primary_model": "gemini/gemini-3.8-flash",
            "reflection_model": "gemini/gemini-3.8-flash"
          },
          "description": "LLM model configuration"
        },
        "run_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Run Id"
        }
      },
      "title": "TestRunConfig",
      "type": "object"
    },
    "Viewport": {
      "description": "Model for viewport dimensions used in browser sessions.",
      "properties": {
        "height": {
          "default": 768,
          "title": "Height",
          "type": "integer"
        },
        "width": {
          "default": 1024,
          "title": "Width",
          "type": "integer"
        }
      },
      "title": "Viewport",
      "type": "object"
    },
    "WebSessionOptions": {
      "additionalProperties": false,
      "properties": {
        "sign_in": {
          "anyOf": [
            {
              "$ref": "#/$defs/WebSignInRequest"
            },
            {
              "type": "null"
            }
          ]
        },
        "viewport": {
          "$ref": "#/$defs/WebViewport"
        }
      },
      "title": "WebSessionOptions",
      "type": "object"
    },
    "WebSignInRequest": {
      "additionalProperties": false,
      "description": "A caller's sign-in link naming, never carrying, its org secret.",
      "properties": {
        "path": {
          "title": "Path",
          "type": "string"
        },
        "persona": {
          "default": "default",
          "title": "Persona",
          "type": "string"
        },
        "secret_name": {
          "title": "Secret Name",
          "type": "string"
        }
      },
      "required": [
        "path",
        "secret_name"
      ],
      "title": "WebSignInRequest",
      "type": "object"
    },
    "WebViewport": {
      "additionalProperties": false,
      "description": "Portrait widths up to 600 CSS pixels use mobile layout and touch input.\n\nOther dimensions use desktop layout. The browser keeps its default user\nagent. Device scale defaults to 1 and accepts fractional values from 1 to 3;\nencoded capture dimensions follow the browser's rounded physical surface.",
      "properties": {
        "device_scale_factor": {
          "default": 1,
          "maximum": 3.0,
          "minimum": 1.0,
          "title": "Device Scale Factor",
          "type": "number"
        },
        "height": {
          "default": 800,
          "maximum": 2160.0,
          "minimum": 240.0,
          "title": "Height",
          "type": "integer"
        },
        "width": {
          "default": 1280,
          "maximum": 3840.0,
          "minimum": 320.0,
          "title": "Width",
          "type": "integer"
        }
      },
      "title": "WebViewport",
      "type": "object"
    },
    "WhileBlock": {
      "description": "Block for loop logic.",
      "properties": {
        "children": {
          "description": "Blocks to execute in the loop",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/ActionBlock"
              },
              {
                "$ref": "#/$defs/IfBlock"
              },
              {
                "$ref": "#/$defs/WhileBlock"
              }
            ]
          },
          "title": "Children",
          "type": "array"
        },
        "condition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Condition to evaluate for loop continuation (alternative to 'step_description')",
          "title": "Condition"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Unique identifier for the block (auto-generated if not provided)",
          "title": "Id"
        },
        "step_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Condition to evaluate for loop continuation (alternative to 'condition')",
          "title": "Step Description"
        },
        "type": {
          "const": "while",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "WhileBlock",
      "type": "object"
    }
  }
}