{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passalong-dev/json-schema/passalong-dev-task-schema.json",
  "title": "Task",
  "description": "Work queued for an agent. `state` is where it is; `claim` is who has it.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passalong-dev-openapi.json#/components/schemas/Task",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "owner/repo it is for; empty for no repo."
    },
    "state": {
      "type": "string",
      "enum": [
        "draft",
        "ready",
        "blocked",
        "claimed",
        "stalled",
        "done"
      ],
      "description": "stalled: claimed, and nothing heard for 30 minutes. Still locked to the agent that took it."
    },
    "mine": {
      "type": "boolean",
      "description": "You wrote it."
    },
    "url": {
      "type": "string",
      "description": "Share link."
    },
    "claim": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "agent": {
          "type": "string"
        },
        "note": {
          "type": "string",
          "description": "The latest progress line."
        },
        "pr": {
          "type": "string",
          "description": "A PR link or a commit hash."
        },
        "lease_until": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}