{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/giljo-ai/json-schema/giljo-ai-task-response-schema.json",
  "title": "TaskResponse",
  "description": "Task response with serial and user fields.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amh-openapi.json#/components/schemas/TaskResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Task ID"
    },
    "title": {
      "type": "string",
      "title": "Title",
      "description": "Task title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Task description"
    },
    "serial": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Serial",
      "description": "Display serial like TSK-0001"
    },
    "task_type": {
      "type": "string",
      "title": "Task Type",
      "description": "'TSK' (default) or 'HND' (agent session handover)",
      "default": "TSK"
    },
    "revision": {
      "type": "integer",
      "title": "Revision",
      "description": "Goal revision; bumped whenever the title or description changes",
      "default": 1
    },
    "completed_revision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed Revision",
      "description": "Revision the completion attested to; NULL when none was named"
    },
    "hidden": {
      "type": "boolean",
      "title": "Hidden",
      "description": "Per-row UI declutter flag. Default-list dashboard filters hidden=false.",
      "default": false
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Task status"
    },
    "priority": {
      "type": "string",
      "title": "Priority",
      "description": "Task priority"
    },
    "parent_task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Task Id",
      "description": "Parent task ID for subtasks"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Task creation timestamp"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At",
      "description": "Task start timestamp"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At",
      "description": "Task completion timestamp"
    },
    "due_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Due Date",
      "description": "Task due date"
    },
    "deleted_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Deleted At",
      "description": "Soft-delete timestamp (NULL for live tasks)"
    },
    "estimated_effort": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Estimated Effort",
      "description": "Estimated effort in hours"
    },
    "actual_effort": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Actual Effort",
      "description": "Actual effort in hours"
    }
  },
  "type": "object",
  "required": [
    "id",
    "title",
    "status",
    "priority",
    "created_at"
  ]
}