{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rokoslist.com/data/schema.json",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "source_reviewed_at": {
      "type": "string"
    },
    "canonical_url": {
      "type": "string"
    },
    "ranking_method": {
      "type": "string"
    },
    "interpretation": {
      "type": "string"
    },
    "privacy_scope": {
      "type": "string"
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "format": {
      "type": "string"
    },
    "statements": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "date_label": {
            "type": "string"
          },
          "evidence_kind": {
            "const": "letter_signature"
          },
          "position": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "summary"
            ],
            "additionalProperties": false
          },
          "context": {
            "type": "string"
          },
          "match_basis": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "url",
          "date_label",
          "evidence_kind",
          "position",
          "context",
          "match_basis"
        ],
        "additionalProperties": false
      }
    },
    "profiles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string"
          },
          "rank": {
            "type": "integer",
            "minimum": 1
          },
          "profile_url": {
            "type": "string",
            "format": "uri"
          },
          "advocacy_activity": {
            "enum": [
              "Dedicated advocacy",
              "Public commentary",
              "Letter supporter"
            ]
          },
          "evidence_kind": {
            "enum": [
              "letter_signature",
              "personal_statement",
              "campaign_role"
            ]
          },
          "signature": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "statement_id": {
                    "enum": [
                      "asi-statement",
                      "fli-pause-2023",
                      "uk-asi-letter-2026"
                    ]
                  },
                  "source_name": {
                    "type": "string"
                  },
                  "statement_url": {
                    "enum": [
                      "https://futureoflife.org/open-letter/pause-giant-ai-experiments/",
                      "https://images.controlai.com/final%20letter.pdf",
                      "https://superintelligence-statement.org/"
                    ]
                  },
                  "checked_at": {
                    "type": "string",
                    "format": "date"
                  },
                  "match_basis": {
                    "type": "string"
                  }
                },
                "required": [
                  "statement_id",
                  "source_name",
                  "statement_url",
                  "checked_at",
                  "match_basis"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "kind": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "url",
                "kind",
                "date"
              ],
              "additionalProperties": false
            }
          },
          "professional_role": {
            "type": "string"
          },
          "source_listed_affiliation": {
            "type": "string"
          },
          "position": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "summary"
            ],
            "additionalProperties": false
          },
          "evidence": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "date_label": {
                "type": "string"
              },
              "source_name": {
                "type": "string"
              },
              "reviewed_at": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "title",
              "url",
              "date_label",
              "source_name",
              "reviewed_at"
            ],
            "additionalProperties": false
          },
          "context": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "rank",
          "profile_url",
          "advocacy_activity",
          "evidence_kind",
          "signature",
          "sources",
          "professional_role",
          "source_listed_affiliation",
          "position",
          "evidence",
          "context"
        ],
        "additionalProperties": false
      }
    },
    "signers": {
      "type": "object",
      "properties": {
        "fields": {
          "const": [
            "id",
            "name",
            "rank",
            "professional_role",
            "source_listed_affiliation",
            "statements"
          ]
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array",
            "minItems": 6,
            "maxItems": 6,
            "prefixItems": [
              {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              },
              {
                "type": "string"
              },
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string"
              },
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "enum": [
                    "asi-statement",
                    "fli-pause-2023",
                    "uk-asi-letter-2026"
                  ]
                }
              }
            ]
          }
        }
      },
      "required": [
        "fields",
        "rows"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schema_version",
    "updated_at",
    "source_reviewed_at",
    "canonical_url",
    "ranking_method",
    "interpretation",
    "privacy_scope",
    "count",
    "format",
    "statements",
    "profiles",
    "signers"
  ],
  "additionalProperties": false
}
