{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://relay.vnppp.com/task.schema.json",
  "title": "Human Relay task submission",
  "description": "POST this JSON to /api/v1/tasks to create a task for human review. Creating a draft alone does not submit it.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "goal",
    "category",
    "location",
    "acceptance_criteria"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "status": {
      "const": "draft_not_submitted"
    },
    "goal": {
      "type": "string",
      "minLength": 5,
      "maxLength": 3000
    },
    "category": {
      "type": "string",
      "enum": [
        "physical-execution",
        "authorized-documents",
        "professional-review",
        "local-coordination",
        "privacy-sensitive"
      ]
    },
    "location": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "deadline": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Agreed deadline and time zone, or explicitly pending agreement."
    },
    "budget": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Amount and currency or an explicit request for a quote. Not a spending authorization."
    },
    "acceptance_criteria": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      }
    },
    "constraints": {
      "type": "array",
      "minItems": 0,
      "maxItems": 100,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      }
    },
    "agent_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "contact": {
      "type": "string",
      "maxLength": 300
    }
  }
}
