{
  "$id": "https://public-agents.com/schemas/job.schema.json",
  "title": "job",
  "description": "A job (registry/jobs/<function>/<id>.json)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://public-agents.com/schemas/job.schema.json"
    },
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z]{2,6}\\.[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "function": {
      "type": "string",
      "pattern": "^[a-z]{2,6}$"
    },
    "name": {
      "type": "string",
      "minLength": 10,
      "maxLength": 90
    },
    "outcome": {
      "type": "string",
      "minLength": 20,
      "maxLength": 400
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1200
    },
    "measures": {
      "minItems": 2,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
      }
    },
    "aliases": {
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
      }
    },
    "related": {
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z]{2,6}\\.[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "deprecated"
      ]
    },
    "supersededBy": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z]{2,6}\\.[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        {
          "type": "null"
        }
      ]
    },
    "created": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "schemaVersion",
    "id",
    "function",
    "name",
    "outcome",
    "measures",
    "status",
    "created",
    "updated",
    "version"
  ],
  "additionalProperties": false
}
