{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citation-co/json-schema/citation-co-check-review-schema.json",
  "title": "CheckReview",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citation-co-openapi.json#/components/schemas/CheckReview",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "run": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "document_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "document_version": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "status": {
              "type": "string",
              "enum": [
                "queued",
                "processing",
                "completed",
                "partial",
                "failed"
              ]
            },
            "total_words": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "checked_words": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "tasks_total": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "tasks_done": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "coverage": {
              "type": "array",
              "items": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "message": {
              "type": [
                "string",
                "null"
              ]
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "document_id",
            "document_version",
            "status",
            "total_words",
            "checked_words",
            "tasks_total",
            "tasks_done",
            "coverage",
            "message",
            "created_at"
          ],
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "run_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "support",
              "citations",
              "accuracy",
              "consistency",
              "language",
              "similarity"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "important",
              "review",
              "suggestion"
            ]
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "applied",
              "dismissed"
            ]
          },
          "anchors": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "action_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "action": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "replace",
                      "insert"
                    ]
                  },
                  "content": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  },
                  "original": {
                    "type": "string"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "position": {
                    "type": "string",
                    "const": "end"
                  }
                },
                "required": [
                  "kind",
                  "content",
                  "version"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "stale": {
            "type": "boolean"
          },
          "incomplete": {
            "type": "boolean"
          },
          "changes_meaning": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "run_id",
          "kind",
          "severity",
          "title",
          "detail",
          "status",
          "anchors",
          "evidence",
          "dependencies"
        ],
        "additionalProperties": {}
      }
    }
  },
  "required": [
    "enabled",
    "run",
    "findings"
  ]
}