{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clment-com/json-schema/clment-com-finding-schema.json",
  "title": "Finding",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clment-com-openapi.yml#/components/schemas/Finding",
  "type": "object",
  "required": [
    "id",
    "title",
    "status",
    "severity",
    "note"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pass",
        "fail",
        "warning",
        "not_applicable"
      ],
      "description": "The verdict the AI reached against the rulebook item. `pass`\nfindings are reported too — a review is an account of what was\nchecked, not only of what failed.\n"
    },
    "severity": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low"
      ]
    },
    "note": {
      "type": "string",
      "description": "The AI's explanation of the finding."
    },
    "clause": {
      "type": "string",
      "description": "The contract clause the finding refers to, when identified."
    },
    "quotedText": {
      "type": "string",
      "description": "The passage from the contract the finding is about."
    },
    "suggestedLanguage": {
      "type": "string",
      "description": "Replacement wording the AI proposes, when it proposes any."
    },
    "actionSummary": {
      "type": "string",
      "description": "One-line statement of the ask, used as the redline comment."
    },
    "confidence": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "sourceStatus": {
      "type": "string",
      "enum": [
        "contract_text",
        "playbook_rule",
        "inferred",
        "needs_verification"
      ],
      "description": "Where the finding came from — quoted text, a rule, or inference."
    },
    "humanDecision": {
      "allOf": [
        {
          "$ref": "#/$defs/HumanDecision"
        }
      ],
      "nullable": true,
      "description": "The reviewer's verdict, or null if unreviewed."
    },
    "includeInRedline": {
      "type": "boolean",
      "description": "Whether this finding is flagged for the redline."
    }
  },
  "$defs": {
    "HumanDecision": {
      "type": "string",
      "description": "A reviewer's verdict on an AI finding.",
      "enum": [
        "agree",
        "partial",
        "disagree"
      ]
    }
  }
}