{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SEO Report Generator JSON Export",
  "description": "Exact shape produced by the SEO Report Kit SEO report generator 'Download JSON'. Values are user-entered from verified sources; a blank field exports as null rather than an estimate.",
  "type": "object",
  "required": [
    "schemaVersion",
    "prepared_by",
    "client",
    "kpis",
    "next_actions"
  ],
  "properties": {
    "schemaVersion": {
      "type": "integer"
    },
    "prepared_by": {
      "type": "string"
    },
    "client": {
      "type": "string"
    },
    "client_context": {
      "type": [
        "string",
        "null"
      ]
    },
    "reporting_period": {
      "type": [
        "string",
        "null"
      ]
    },
    "cadence": {
      "type": [
        "string",
        "null"
      ]
    },
    "report_owner": {
      "type": [
        "string",
        "null"
      ]
    },
    "reviewer": {
      "type": [
        "string",
        "null"
      ]
    },
    "client_approver": {
      "type": [
        "string",
        "null"
      ]
    },
    "data_confidence": {
      "type": [
        "string",
        "null"
      ]
    },
    "report_goal": {
      "type": [
        "string",
        "null"
      ]
    },
    "source_ledger": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "source",
          "evidence",
          "date_range",
          "caveat"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          },
          "date_range": {
            "type": "string"
          },
          "caveat": {
            "type": "string"
          }
        }
      }
    },
    "gsc_findings": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "subject",
          "signal",
          "evidence",
          "verify_next"
        ],
        "properties": {
          "subject": {
            "type": "string"
          },
          "signal": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          },
          "verify_next": {
            "type": "string"
          }
        }
      }
    },
    "wins": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "kpis": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "metric": {
            "type": [
              "string",
              "null"
            ]
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "prior": {
            "type": [
              "string",
              "null"
            ]
          },
          "change": {
            "type": [
              "string",
              "null"
            ]
          },
          "direction": {
            "enum": [
              "up",
              "down",
              "neutral"
            ]
          },
          "change_verdict": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "improved",
              "declined",
              null
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "work_completed": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "risks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "next_actions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "owner": {
            "type": [
              "string",
              "null"
            ]
          },
          "due": {
            "type": [
              "string",
              "null"
            ]
          },
          "expected_evidence": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "data_rule": {
      "type": "string"
    },
    "implementation_tracker": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "due": {
            "type": "string"
          },
          "expected_evidence": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      }
    },
    "_meta": {
      "type": "object"
    }
  }
}
