{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tailwaggingwebdesign.com/agent-work-order.schema.json",
  "title": "Tail Wagging Agent Work Order",
  "description": "Bounded subcontract request accepted by Tail Wagging Website Design Factory Northampton. Commercial terms are intentionally excluded. The entire JSON transport body is limited to 16,000 UTF-8 bytes (x-maxRequestBodyBytes, a documented extension to JSON Schema).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "contactEmail",
    "requestedOutcome"
  ],
  "properties": {
    "contactEmail": {
      "type": "string",
      "format": "email",
      "maxLength": 255
    },
    "requestedOutcome": {
      "type": "string",
      "minLength": 10,
      "maxLength": 4000
    },
    "agentName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "operatorName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "repositoryUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://",
      "maxLength": 2000
    },
    "siteUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://",
      "maxLength": 2000
    },
    "scope": {
      "type": "string",
      "enum": [
        "small_repo_fix",
        "website_build",
        "local_seo",
        "automation",
        "audit",
        "other"
      ]
    },
    "targetHeadSha": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{40}$"
    },
    "allowedActions": {
      "type": "array",
      "uniqueItems": true,
      "maxItems": 8,
      "items": {
        "type": "string",
        "enum": [
          "inspect",
          "edit",
          "test",
          "raise_pr"
        ]
      }
    },
    "blockedActions": {
      "type": "array",
      "uniqueItems": true,
      "maxItems": 12,
      "items": {
        "type": "string",
        "enum": [
          "merge",
          "deploy",
          "close_pr",
          "change_billing",
          "change_secrets",
          "expand_scope",
          "delete_data",
          "publish"
        ]
      }
    },
    "acceptanceCriteria": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
      }
    },
    "deliveryType": {
      "type": "string",
      "enum": [
        "pull_request",
        "patch",
        "report"
      ]
    },
    "notes": {
      "type": "string",
      "minLength": 1,
      "maxLength": 5000
    }
  },
  "x-maxRequestBodyBytes": 16000
}
