{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://learn.math101.ca/data/content-submission-schema.json",
  "title": "Math101 normalized editorial submission record",
  "description": "The private normalized record produced after a raw web-form payload is received, type-converted, host-timestamped, and triaged. This is not the direct HTML form contract; see content-submission-form.schema.json. Records remain private until editorial review.",
  "type": "object",
  "additionalProperties": false,
  "required": ["kind", "message", "submitted_at", "privacy_acknowledged"],
  "properties": {
    "kind": {
      "type": "string",
      "enum": ["question", "correction", "source_update", "guide_proposal", "lesson_proposal", "accessibility", "technical"]
    },
    "message": {"type": "string", "minLength": 10, "maxLength": 7000},
    "page_title": {"type": "string", "maxLength": 240},
    "page_url": {"type": "string", "format": "uri", "maxLength": 500},
    "source_urls": {
      "type": "array",
      "maxItems": 10,
      "items": {"type": "string", "format": "uri", "maxLength": 500},
      "uniqueItems": true
    },
    "experience_or_fact": {
      "type": "string",
      "enum": ["official_fact", "research", "personal_experience", "question", "unsure"]
    },
    "name": {"type": "string", "maxLength": 100},
    "reply_email": {"type": "string", "format": "email", "maxLength": 200},
    "may_quote_anonymously": {"type": "boolean", "default": false},
    "may_credit": {"type": "boolean", "default": false, "description": "Whether the contributor requested public credit if the reviewed contribution is used."},
    "privacy_acknowledged": {"const": true},
    "submitted_at": {"type": "string", "format": "date-time"},
    "editorial_status": {
      "type": "string",
      "enum": ["submitted", "triaged", "source_review", "draft", "approved", "published", "declined"],
      "default": "submitted"
    }
  }
}
