{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://twinethos.com/schemas/incident-registry-v0.1.schema.json",
  "title": "Incident registry v0.1",
  "description": "Real-world AI incidents cited as evidence by recommended guardrails. Rules reference incidents by incident_id and add their own relevance statement. Evidence grades: primary (operator, regulator, court, or original researcher disclosure) > press_of_record > trade_press > secondary. An incident must carry at least one source graded above secondary.",
  "type": "object",
  "required": [
    "schema_version",
    "registry_id",
    "incidents"
  ],
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "0.1"
    },
    "registry_id": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "incidents": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "incident_id",
          "title",
          "summary",
          "date",
          "status",
          "evidence_grade",
          "sources"
        ],
        "additionalProperties": false,
        "properties": {
          "incident_id": {
            "type": "string",
            "pattern": "^inc\\.[a-z0-9]+(?:[.-][a-z0-9]+)*$"
          },
          "title": {
            "type": "string",
            "minLength": 5
          },
          "summary": {
            "type": "string",
            "minLength": 40,
            "description": "Neutral statement of what the sources support. Allegations are attributed as allegations."
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$",
            "description": "When the incident occurred (not when it was reported), at the precision the sources support. When a legal filing is the only public record and the conduct period is not established, the filing date, with the summary saying 'filed <date>'."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "alleged",
              "disclosed_by_operator"
            ]
          },
          "evidence_grade": {
            "type": "string",
            "enum": [
              "primary",
              "press_of_record",
              "trade_press",
              "secondary"
            ],
            "description": "Best grade among the sources."
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "url",
                "publisher",
                "grade"
              ],
              "additionalProperties": false,
              "properties": {
                "url": {
                  "type": "string",
                  "pattern": "^https?://"
                },
                "publisher": {
                  "type": "string"
                },
                "grade": {
                  "type": "string",
                  "enum": [
                    "primary",
                    "press_of_record",
                    "trade_press",
                    "secondary"
                  ]
                }
              }
            },
            "contains": {
              "properties": {
                "grade": {
                  "enum": [
                    "primary",
                    "press_of_record",
                    "trade_press"
                  ]
                }
              },
              "required": [
                "grade"
              ]
            }
          }
        }
      }
    }
  }
}
