{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-doc-drift-response-schema.json",
  "title": "DocDriftResponse",
  "description": "Findings for a repository, with the rollup that makes them legible.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-doc-drift-api-openapi.yml#/components/schemas/DocDriftResponse",
  "properties": {
    "findings": {
      "items": {
        "$ref": "#/$defs/DocDriftFindingResponse"
      },
      "type": "array",
      "title": "Findings"
    },
    "findings_emitted": {
      "type": "integer",
      "title": "Findings Emitted"
    },
    "summary": {
      "anyOf": [
        {
          "$ref": "#/$defs/DocDriftSummaryResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "unavailable": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "not_computed",
            "index_predates_doc_drift",
            "drift_read_failed"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Unavailable"
    }
  },
  "type": "object",
  "required": [
    "findings",
    "findings_emitted",
    "summary"
  ],
  "$defs": {
    "DocDriftFindingResponse": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "file_path": {
          "type": "string",
          "title": "File Path"
        },
        "line_number": {
          "type": "integer",
          "title": "Line Number"
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "target": {
          "type": "string",
          "title": "Target"
        },
        "confidence": {
          "type": "number",
          "title": "Confidence"
        },
        "origin": {
          "type": "string",
          "title": "Origin"
        },
        "reason": {
          "type": "string",
          "title": "Reason"
        },
        "raw": {
          "type": "string",
          "title": "Raw"
        },
        "context": {
          "type": "string",
          "title": "Context"
        },
        "evidence": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Evidence"
        },
        "fingerprint": {
          "type": "string",
          "title": "Fingerprint"
        },
        "suggestion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Suggestion"
        },
        "suggestion_basis": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Suggestion Basis"
        },
        "first_seen_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Seen At"
        },
        "is_new": {
          "type": "boolean",
          "title": "Is New",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "id",
        "file_path",
        "line_number",
        "kind",
        "target",
        "confidence",
        "origin",
        "reason",
        "raw",
        "context",
        "evidence",
        "fingerprint"
      ],
      "title": "DocDriftFindingResponse",
      "description": "One assertion a document makes that the repository no longer satisfies.\n\n``file_path`` is the *document* to edit, never the target it names. A\nreader who reads it as the broken file has been told the opposite of the\ntruth, which is why the field keeps the name every other drift surface\ngives it."
    },
    "DocDriftSummaryResponse": {
      "properties": {
        "findings_total": {
          "type": "integer",
          "title": "Findings Total"
        },
        "documents": {
          "type": "integer",
          "title": "Documents"
        },
        "confidence": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "Confidence"
        },
        "by_kind": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "By Kind"
        },
        "findings_basis": {
          "type": "string",
          "title": "Findings Basis"
        },
        "new_since_last_update": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "New Since Last Update"
        }
      },
      "type": "object",
      "required": [
        "findings_total",
        "documents",
        "confidence",
        "by_kind",
        "findings_basis"
      ],
      "title": "DocDriftSummaryResponse",
      "description": "The rollup above the list, computed server-side over the same rows.\n\n``findings_total`` counts every finding matching the query, including any\nthe display cap left out, so a client cannot recompute a page as if it were\nthe repository."
    }
  }
}