{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://deadwater.ai/downloads/airops-editorial-feedback-schema.json",
  "title": "AirOps editorial feedback object",
  "description": "A reusable contract for routing editorial feedback through revision and QA workflows.",
  "type": "object",
  "additionalProperties": false,
  "required": ["status", "asset_id", "revision_scope", "items"],
  "properties": {
    "status": {
      "type": "string",
      "enum": ["approved", "needs_revision", "blocked"]
    },
    "review_id": {
      "type": "string",
      "minLength": 1
    },
    "asset_id": {
      "type": "string",
      "minLength": 1
    },
    "revision_scope": {
      "type": "string",
      "enum": ["field", "paragraph", "section", "full_asset"]
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/feedbackItem"
      }
    }
  },
  "$defs": {
    "feedbackItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "type", "instruction", "severity", "status", "acceptance_checks"],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "factual_accuracy",
            "messaging_alignment",
            "missing_evidence",
            "structural_clarity",
            "seo_linking",
            "claim_safety"
          ]
        },
        "section": {
          "type": "string"
        },
        "instruction": {
          "type": "string",
          "minLength": 1
        },
        "severity": {
          "type": "string",
          "enum": ["low", "medium", "high"]
        },
        "status": {
          "type": "string",
          "enum": ["open", "addressed", "verified", "wont_fix"]
        },
        "retrieve_from": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "brand_kit",
              "product_truth",
              "research_sources",
              "published_content",
              "policy_rules",
              "none"
            ]
          }
        },
        "preserve": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string"
          }
        },
        "acceptance_checks": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
