{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://route.agiscorecard.com/input.schema.json",
  "title": "Route Lab input structure",
  "description": "Structural contract. The engine additionally validates ranges, dates, amounts, uniqueness and cross-field constraints; passing this schema is not a complete validation.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "currency",
    "budget",
    "maxLatencyMs",
    "minSuccess",
    "maxAttempts",
    "candidates"
  ],
  "properties": {
    "currency": {
      "type": "string"
    },
    "budget": {
      "type": "string"
    },
    "maxLatencyMs": {
      "type": "number"
    },
    "minSuccess": {
      "type": "number"
    },
    "maxAttempts": {
      "type": "number"
    },
    "candidates": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "cost",
          "success",
          "latencyMs",
          "allowed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "cost": {
            "type": "string"
          },
          "success": {
            "type": "number"
          },
          "latencyMs": {
            "type": "number"
          },
          "allowed": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
