{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tale-dev/json-schema/tale-dev-task-review-schema.json",
  "title": "TaskReview",
  "description": "A task’s ordinary pending review, owned by the captured person or agent. Native agent verdicts use task_review; the public review POST relays a person’s decision.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tale-dev-tasks-api-openapi.yml#/components/schemas/TaskReview",
  "type": "object",
  "required": [
    "approvalId",
    "taskId",
    "round",
    "requestedFor",
    "reviewer",
    "agentSlug",
    "runId",
    "implementationAgentId",
    "evidenceRevision",
    "agentReviewBlockedReason",
    "createdAt"
  ],
  "properties": {
    "approvalId": {
      "type": "string"
    },
    "taskId": {
      "type": "string"
    },
    "round": {
      "type": "integer",
      "description": "Which review of this task this is; 0 when unrecorded"
    },
    "requestedFor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human reviewer compatibility field; null for an agent or absent recipient. Use reviewer for typed ownership."
    },
    "reviewer": {
      "anyOf": [
        {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "required": [
            "kind",
            "userId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "user"
              ]
            },
            "userId": {
              "type": "string"
            }
          }
        },
        {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "required": [
            "kind",
            "agentId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "agent"
              ]
            },
            "agentId": {
              "type": "string"
            }
          }
        }
      ],
      "description": "The recipient captured by this pending review."
    },
    "agentSlug": {
      "type": [
        "string",
        "null"
      ],
      "description": "Compatibility display text for the implementation driver, not its identity; use implementationAgentId for the actual native source agent."
    },
    "runId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The run whose settle parked the task in review, if any"
    },
    "implementationAgentId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The exact source run’s agent in this organization, project and task; null without a matching native source."
    },
    "evidenceRevision": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-f0-9]{64}$",
      "description": "Opaque compare-and-set digest of local task, source result and discussion evidence. Null without a settled native source. It does not verify external pull-request heads or checks."
    },
    "agentReviewBlockedReason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "reviewer_unavailable",
        "permission_missing",
        "source_required",
        "source_changed",
        "self_review",
        "human_policy",
        "policy_unavailable",
        null
      ],
      "description": "Current reason a captured agent cannot decide; null for a human review or an eligible agent. Derived from current project scope, permission, policy and source; it never changes review ownership. Restore the indicated condition or explicitly transfer to an eligible reviewer."
    },
    "createdAt": {
      "type": "integer",
      "minimum": 0,
      "description": "Epoch milliseconds"
    }
  }
}