{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/veridu-io/json-schema/veridu-io-review-schema.json",
  "title": "Review",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/veridu-io-openapi.json#/components/schemas/Review",
  "type": "object",
  "properties": {
    "review_id": {
      "type": "string",
      "format": "uuid",
      "description": "Public UUID for the review — enumeration-safe."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed",
        "stale"
      ]
    },
    "repo_full_name": {
      "type": "string"
    },
    "pr_number": {
      "type": "integer"
    },
    "pr_url": {
      "type": "string",
      "format": "uri"
    },
    "verdict": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "level": {
          "type": "string",
          "enum": [
            "clean",
            "low",
            "medium",
            "high",
            "critical",
            "unknown"
          ],
          "description": "Worst effective finding severity; an unconfirmed possible/low-confidence singleton contributes at most medium while retaining its reported severity. Clean means a complete two-reviewer panel found nothing; unknown means the panel did not complete. Reviews written before rule 2 may carry legacy labels."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "blocking_level": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "low",
            "medium",
            "high",
            "critical",
            null
          ],
          "description": "Worst severity both reviewers independently assigned to a defect they both found. The only level that can block."
        },
        "basis": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "corroborated",
                "uncorroborated",
                "none"
              ]
            },
            "rule_version": {
              "type": "integer"
            }
          }
        }
      }
    },
    "agreements": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "disputes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Finding"
      }
    },
    "models": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "Finding": {
      "type": "object",
      "properties": {
        "severity": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "critical"
          ]
        },
        "severity_cap": {
          "type": "object",
          "description": "Present when decision logic caps an unsure, unconfirmed singleton while preserving its reported severity.",
          "properties": {
            "capped_to": {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            "reason": {
              "type": "string",
              "enum": [
                "unsure_singleton"
              ]
            }
          }
        },
        "confidence": {
          "type": "string",
          "enum": [
            "low",
            "possible",
            "likely",
            "high"
          ]
        }
      }
    }
  }
}