{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-decision-record-response-schema.json",
  "title": "DecisionRecordResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-openapi.json#/components/schemas/DecisionRecordResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "repository_id": {
      "type": "string",
      "title": "Repository Id"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "context": {
      "type": "string",
      "title": "Context"
    },
    "decision": {
      "type": "string",
      "title": "Decision"
    },
    "rationale": {
      "type": "string",
      "title": "Rationale"
    },
    "alternatives": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Alternatives"
    },
    "consequences": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Consequences"
    },
    "affected_files": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Affected Files"
    },
    "affected_modules": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Affected Modules"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags"
    },
    "source": {
      "type": "string",
      "title": "Source"
    },
    "evidence_commits": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Evidence Commits"
    },
    "evidence_file": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Evidence File"
    },
    "evidence_line": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Evidence Line"
    },
    "confidence": {
      "type": "number",
      "title": "Confidence"
    },
    "staleness_score": {
      "type": "number",
      "title": "Staleness Score"
    },
    "verification": {
      "type": "string",
      "title": "Verification",
      "default": "unverified"
    },
    "kind": {
      "type": "string",
      "title": "Kind",
      "default": "architectural"
    },
    "scope": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scope"
    },
    "superseded_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Superseded By"
    },
    "last_code_change": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Code Change"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "evidence_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Evidence Count"
    },
    "evidence_preview": {
      "anyOf": [
        {
          "$ref": "#/$defs/EvidencePreview"
        },
        {
          "type": "null"
        }
      ]
    },
    "currency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency"
    },
    "accepter": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Accepter"
    },
    "accepter_kind": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Accepter Kind"
    },
    "accepter_session": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Accepter Session"
    },
    "blockers": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Blockers"
    },
    "decision_text_missing": {
      "type": "boolean",
      "title": "Decision Text Missing",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "id",
    "repository_id",
    "title",
    "status",
    "context",
    "decision",
    "rationale",
    "alternatives",
    "consequences",
    "affected_files",
    "affected_modules",
    "tags",
    "source",
    "evidence_commits",
    "evidence_file",
    "evidence_line",
    "confidence",
    "staleness_score",
    "superseded_by",
    "last_code_change",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "EvidencePreview": {
      "properties": {
        "source": {
          "type": "string",
          "title": "Source"
        },
        "source_quote": {
          "type": "string",
          "title": "Source Quote"
        },
        "verification": {
          "type": "string",
          "title": "Verification"
        },
        "evidence_file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Evidence File"
        },
        "evidence_line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Evidence Line"
        }
      },
      "type": "object",
      "required": [
        "source",
        "source_quote",
        "verification"
      ],
      "title": "EvidencePreview",
      "description": "The top-ranked evidence row, slimmed for list rows."
    }
  }
}