{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "methodVersion": {
      "const": "1.0.0"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{2,79}$"
    },
    "objective": {
      "type": "string",
      "minLength": 1
    },
    "adapter": {
      "type": "string",
      "minLength": 1
    },
    "inputs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "locator": {
            "type": "string",
            "minLength": 1
          },
          "access": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "locator",
          "access"
        ]
      }
    },
    "constraints": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "acceptanceCriteria": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 1
    },
    "stages": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{1,49}$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "criteria": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1
          },
          "humanApproval": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "title",
          "criteria",
          "humanApproval"
        ]
      },
      "minItems": 1
    },
    "maxRetries": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10
    }
  },
  "required": [
    "methodVersion",
    "id",
    "objective",
    "adapter",
    "inputs",
    "constraints",
    "acceptanceCriteria",
    "stages",
    "maxRetries"
  ]
}
