{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getevercrew.com/roster.schema.json",
  "title": "Evercrew machine-readable roster",
  "type": "object",
  "required": [
    "$schema",
    "spec_version",
    "provider",
    "pricing",
    "workers",
    "supervision",
    "agent_procurement_path"
  ],
  "properties": {
    "$schema": {
      "const": "https://getevercrew.com/roster.schema.json"
    },
    "spec_version": {
      "type": "string"
    },
    "provider": {
      "type": "object"
    },
    "pricing": {
      "type": "object"
    },
    "workers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/worker"
      }
    },
    "supervision": {
      "type": "object"
    },
    "agent_procurement_path": {
      "type": "object"
    }
  },
  "$defs": {
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "prose"
      ],
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1
        },
        "prose": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "worker": {
      "type": "object",
      "required": [
        "id",
        "name",
        "role",
        "capabilities",
        "hard_limits",
        "human_approval_required_for",
        "service_url",
        "evidence"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "capabilities": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "hard_limits": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "human_approval_required_for": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "service_url": {
          "type": "string",
          "format": "uri"
        },
        "evidence": {
          "$ref": "#/$defs/evidence"
        }
      }
    }
  }
}
