{
  "lexicon": 1,
  "id": "tools.ozone.report.defs",
  "defs": {
    "reasonType": {
      "type": "string",
      "knownValues": [
        "tools.ozone.report.defs#reasonAppeal",
        "tools.ozone.report.defs#reasonOther",

        "tools.ozone.report.defs#reasonViolenceAnimal",
        "tools.ozone.report.defs#reasonViolenceThreats",
        "tools.ozone.report.defs#reasonViolenceGraphicContent",
        "tools.ozone.report.defs#reasonViolenceGlorification",
        "tools.ozone.report.defs#reasonViolenceExtremistContent",
        "tools.ozone.report.defs#reasonViolenceTrafficking",
        "tools.ozone.report.defs#reasonViolenceOther",

        "tools.ozone.report.defs#reasonSexualAbuseContent",
        "tools.ozone.report.defs#reasonSexualNCII",
        "tools.ozone.report.defs#reasonSexualDeepfake",
        "tools.ozone.report.defs#reasonSexualAnimal",
        "tools.ozone.report.defs#reasonSexualUnlabeled",
        "tools.ozone.report.defs#reasonSexualOther",

        "tools.ozone.report.defs#reasonChildSafetyCSAM",
        "tools.ozone.report.defs#reasonChildSafetyGroom",
        "tools.ozone.report.defs#reasonChildSafetyPrivacy",
        "tools.ozone.report.defs#reasonChildSafetyHarassment",
        "tools.ozone.report.defs#reasonChildSafetyOther",

        "tools.ozone.report.defs#reasonHarassmentTroll",
        "tools.ozone.report.defs#reasonHarassmentTargeted",
        "tools.ozone.report.defs#reasonHarassmentHateSpeech",
        "tools.ozone.report.defs#reasonHarassmentDoxxing",
        "tools.ozone.report.defs#reasonHarassmentOther",

        "tools.ozone.report.defs#reasonMisleadingBot",
        "tools.ozone.report.defs#reasonMisleadingImpersonation",
        "tools.ozone.report.defs#reasonMisleadingSpam",
        "tools.ozone.report.defs#reasonMisleadingScam",
        "tools.ozone.report.defs#reasonMisleadingElections",
        "tools.ozone.report.defs#reasonMisleadingOther",

        "tools.ozone.report.defs#reasonRuleSiteSecurity",
        "tools.ozone.report.defs#reasonRuleProhibitedSales",
        "tools.ozone.report.defs#reasonRuleBanEvasion",
        "tools.ozone.report.defs#reasonRuleOther",

        "tools.ozone.report.defs#reasonSelfHarmContent",
        "tools.ozone.report.defs#reasonSelfHarmED",
        "tools.ozone.report.defs#reasonSelfHarmStunts",
        "tools.ozone.report.defs#reasonSelfHarmSubstances",
        "tools.ozone.report.defs#reasonSelfHarmOther"
      ]
    },
    "reasonAppeal": {
      "type": "token",
      "description": "Appeal a previously taken moderation action"
    },
    "reasonOther": {
      "type": "token",
      "description": "An issue not included in these options"
    },
    "reasonViolenceAnimal": {
      "type": "token",
      "description": "Animal welfare violations"
    },
    "reasonViolenceThreats": {
      "type": "token",
      "description": "Threats or incitement"
    },
    "reasonViolenceGraphicContent": {
      "type": "token",
      "description": "Graphic violent content"
    },
    "reasonViolenceGlorification": {
      "type": "token",
      "description": "Glorification of violence"
    },
    "reasonViolenceExtremistContent": {
      "type": "token",
      "description": "Extremist content. These reports will be sent only be sent to the application's Moderation Authority."
    },
    "reasonViolenceTrafficking": {
      "type": "token",
      "description": "Human trafficking"
    },
    "reasonViolenceOther": {
      "type": "token",
      "description": "Other violent content"
    },

    "reasonSexualAbuseContent": {
      "type": "token",
      "description": "Adult sexual abuse content"
    },
    "reasonSexualNCII": {
      "type": "token",
      "description": "Non-consensual intimate imagery"
    },
    "reasonSexualDeepfake": {
      "type": "token",
      "description": "Deepfake adult content"
    },
    "reasonSexualAnimal": {
      "type": "token",
      "description": "Animal sexual abuse"
    },
    "reasonSexualUnlabeled": {
      "type": "token",
      "description": "Unlabelled adult content"
    },
    "reasonSexualOther": {
      "type": "token",
      "description": "Other sexual violence content"
    },

    "reasonChildSafetyCSAM": {
      "type": "token",
      "description": "Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority."
    },
    "reasonChildSafetyGroom": {
      "type": "token",
      "description": "Grooming or predatory behavior. These reports will be sent only be sent to the application's Moderation Authority."
    },
    "reasonChildSafetyPrivacy": {
      "type": "token",
      "description": "Privacy violation involving a minor"
    },
    "reasonChildSafetyHarassment": {
      "type": "token",
      "description": "Harassment or bullying of minors"
    },
    "reasonChildSafetyOther": {
      "type": "token",
      "description": "Other child safety. These reports will be sent only be sent to the application's Moderation Authority."
    },

    "reasonHarassmentTroll": {
      "type": "token",
      "description": "Trolling"
    },
    "reasonHarassmentTargeted": {
      "type": "token",
      "description": "Targeted harassment"
    },
    "reasonHarassmentHateSpeech": {
      "type": "token",
      "description": "Hate speech"
    },
    "reasonHarassmentDoxxing": {
      "type": "token",
      "description": "Doxxing"
    },
    "reasonHarassmentOther": {
      "type": "token",
      "description": "Other harassing or hateful content"
    },

    "reasonMisleadingBot": {
      "type": "token",
      "description": "Fake account or bot"
    },
    "reasonMisleadingImpersonation": {
      "type": "token",
      "description": "Impersonation"
    },
    "reasonMisleadingSpam": {
      "type": "token",
      "description": "Spam"
    },
    "reasonMisleadingScam": {
      "type": "token",
      "description": "Scam"
    },
    "reasonMisleadingElections": {
      "type": "token",
      "description": "False information about elections"
    },
    "reasonMisleadingOther": {
      "type": "token",
      "description": "Other misleading content"
    },

    "reasonRuleSiteSecurity": {
      "type": "token",
      "description": "Hacking or system attacks"
    },
    "reasonRuleProhibitedSales": {
      "type": "token",
      "description": "Promoting or selling prohibited items or services"
    },
    "reasonRuleBanEvasion": {
      "type": "token",
      "description": "Banned user returning"
    },
    "reasonRuleOther": {
      "type": "token",
      "description": "Other"
    },
    "reasonSelfHarmContent": {
      "type": "token",
      "description": "Content promoting or depicting self-harm"
    },
    "reasonSelfHarmED": {
      "type": "token",
      "description": "Eating disorders"
    },
    "reasonSelfHarmStunts": {
      "type": "token",
      "description": "Dangerous challenges or activities"
    },
    "reasonSelfHarmSubstances": {
      "type": "token",
      "description": "Dangerous substances or drug abuse"
    },
    "reasonSelfHarmOther": {
      "type": "token",
      "description": "Other dangerous content"
    },
    "reportAssignment": {
      "type": "object",
      "description": "Information about the moderator currently assigned to a report.",
      "required": ["did", "assignedAt"],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "DID of the assigned moderator"
        },
        "moderator": {
          "type": "ref",
          "ref": "tools.ozone.team.defs#member",
          "description": "Full member record of the assigned moderator"
        },
        "assignedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the report was assigned"
        }
      }
    },
    "reportView": {
      "type": "object",
      "required": [
        "id",
        "eventId",
        "status",
        "subject",
        "reportType",
        "reportedBy",
        "reporter",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Report ID"
        },
        "eventId": {
          "type": "integer",
          "description": "ID of the moderation event that created this report"
        },
        "status": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "Current status of the report"
        },
        "subject": {
          "type": "ref",
          "ref": "tools.ozone.moderation.defs#subjectView",
          "description": "The subject that was reported with full details"
        },
        "reportType": {
          "type": "ref",
          "ref": "com.atproto.moderation.defs#reasonType",
          "description": "Type of report"
        },
        "reportedBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the user who made the report"
        },
        "reporter": {
          "type": "ref",
          "ref": "tools.ozone.moderation.defs#subjectView",
          "description": "Full subject view of the reporter account"
        },
        "comment": {
          "type": "string",
          "description": "Comment provided by the reporter"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the report was created"
        },
        "updatedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the report was last updated"
        },
        "queuedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the report was assigned to its current queue"
        },
        "actionEventIds": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Array of moderation event IDs representing actions taken on this report (sorted DESC, most recent first)"
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "tools.ozone.moderation.defs#modEventView"
          },
          "description": "Optional: expanded action events"
        },
        "actionNote": {
          "type": "string",
          "description": "Note sent to reporter when report was actioned"
        },
        "subjectStatus": {
          "type": "ref",
          "ref": "tools.ozone.moderation.defs#subjectStatusView",
          "description": "Current status of the reported subject"
        },
        "relatedReportCount": {
          "type": "integer",
          "description": "Number of other pending reports on the same subject"
        },
        "assignment": {
          "type": "ref",
          "ref": "#reportAssignment",
          "description": "Information about moderator currently assigned to this report (if any)"
        },
        "queue": {
          "type": "ref",
          "ref": "tools.ozone.queue.defs#queueView",
          "description": "The queue this report is assigned to (if any)"
        },
        "isMuted": {
          "type": "boolean",
          "description": "Whether this report is muted. A report is muted if the reporter was muted or the subject was muted at the time the report was created."
        },
        "isAutomated": {
          "type": "boolean",
          "default": false,
          "description": "Whether this report was emitted by automated tooling."
        }
      }
    },
    "queueActivity": {
      "type": "object",
      "description": "Activity recording a report being routed to a queue.",
      "properties": {
        "previousStatus": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "The report's status before this activity. Populated automatically from the report row; not required in input."
        }
      }
    },
    "assignmentActivity": {
      "type": "object",
      "description": "Activity recording a moderator being assigned to a report.",
      "properties": {
        "previousStatus": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "The report's status before this activity. Populated automatically from the report row; not required in input."
        }
      }
    },
    "escalationActivity": {
      "type": "object",
      "description": "Activity recording a report being escalated.",
      "properties": {
        "previousStatus": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "The report's status before this activity. Populated automatically from the report row; not required in input."
        }
      }
    },
    "closeActivity": {
      "type": "object",
      "description": "Activity recording a report being closed.",
      "properties": {
        "previousStatus": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "The report's status before this activity. Populated automatically from the report row; not required in input."
        }
      }
    },
    "reopenActivity": {
      "type": "object",
      "description": "Activity recording a closed report being reopened. Only valid when the report is in 'closed' status.",
      "properties": {
        "previousStatus": {
          "type": "string",
          "knownValues": ["open", "closed", "escalated", "queued", "assigned"],
          "description": "The report's status before this activity. Populated automatically from the report row; not required in input."
        }
      }
    },
    "noteActivity": {
      "type": "object",
      "description": "Activity recording a note on a report. Use internalNote for moderator-only notes or publicNote for reporter-visible notes (or both).",
      "properties": {}
    },
    "reportActivityView": {
      "type": "object",
      "description": "A single activity entry on a report.",
      "required": [
        "id",
        "reportId",
        "activity",
        "isAutomated",
        "createdBy",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Activity ID"
        },
        "reportId": {
          "type": "integer",
          "description": "ID of the report this activity belongs to"
        },
        "activity": {
          "type": "union",
          "refs": [
            "#queueActivity",
            "#assignmentActivity",
            "#escalationActivity",
            "#closeActivity",
            "#reopenActivity",
            "#noteActivity"
          ],
          "description": "The typed activity object describing what occurred."
        },
        "internalNote": {
          "type": "string",
          "description": "Optional moderator-only note. Not visible to reporters."
        },
        "publicNote": {
          "type": "string",
          "description": "Optional public note, potentially visible to the reporter."
        },
        "meta": {
          "type": "unknown",
          "description": "Extensible JSON payload for loose activity-specific metadata (e.g. assignmentId)."
        },
        "isAutomated": {
          "type": "boolean",
          "description": "True if this activity was created by an automated process (e.g. queue router) rather than a direct human action."
        },
        "createdBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the actor who created this activity, or the service DID for automated activities."
        },
        "moderator": {
          "type": "ref",
          "ref": "tools.ozone.team.defs#member",
          "description": "Full member record of the moderator who created this activity"
        },
        "report": {
          "type": "ref",
          "ref": "#reportView",
          "description": "Full view of the report this activity belongs to."
        },
        "createdAt": {
          "type": "string",
          "format": "datetime",
          "description": "When this activity was created"
        }
      }
    },
    "liveStats": {
      "description": "Live statistics for reports for the current calendar day, filterable by queue, moderator, or report type.",
      "type": "object",
      "properties": {
        "pendingCount": {
          "type": "integer",
          "description": "Number of reports currently not closed."
        },
        "actionedCount": {
          "type": "integer",
          "description": "Number of reports closed today."
        },
        "escalatedCount": {
          "type": "integer",
          "description": "Number of reports escalated today."
        },
        "inboundCount": {
          "type": "integer",
          "description": "Reports received today."
        },
        "actionRate": {
          "type": "integer",
          "description": "Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer."
        },
        "avgHandlingTimeSec": {
          "type": "integer",
          "description": "Average time in seconds from report creation (or moderator assignment) to close."
        },
        "lastUpdated": {
          "type": "string",
          "format": "datetime",
          "description": "When these statistics were last computed."
        }
      }
    },
    "historicalStats": {
      "description": "A single daily snapshot of report statistics for a calendar date.",
      "type": "object",
      "required": ["date"],
      "properties": {
        "date": {
          "type": "string",
          "description": "The calendar date this snapshot covers (YYYY-MM-DD)."
        },
        "computedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When this snapshot was last computed."
        },
        "pendingCount": {
          "type": "integer",
          "description": "Number of reports not closed at time of computation."
        },
        "actionedCount": {
          "type": "integer",
          "description": "Number of reports closed during this day."
        },
        "escalatedCount": {
          "type": "integer",
          "description": "Number of reports escalated during this day."
        },
        "inboundCount": {
          "type": "integer",
          "description": "Reports received during this day."
        },
        "actionRate": {
          "type": "integer",
          "description": "Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer."
        },
        "avgHandlingTimeSec": {
          "type": "integer",
          "description": "Average time in seconds from report creation (or moderator assignment) to close."
        }
      }
    },
    "assignmentView": {
      "type": "object",
      "required": ["id", "did", "reportId", "startAt"],
      "properties": {
        "id": {
          "type": "integer"
        },
        "did": {
          "type": "string",
          "format": "did"
        },
        "moderator": {
          "type": "ref",
          "ref": "tools.ozone.team.defs#member",
          "description": "The moderator assigned to this report"
        },
        "queue": {
          "type": "ref",
          "ref": "tools.ozone.queue.defs#queueView"
        },
        "reportId": {
          "type": "integer"
        },
        "startAt": {
          "type": "string",
          "format": "datetime"
        },
        "endAt": {
          "type": "string",
          "format": "datetime"
        }
      }
    }
  }
}

