{
  "$version": "0.2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CipherCorpusRecord",
  "type": "object",
  "required": [
    "id", "title", "cipher_family", "cipher_type", "plaintext", "ciphertext", "key", "language", "alphabet", "text_length", "normalized_text_length", "spacing", "punctuation", "casing", "difficulty", "source_type", "source", "license", "expected_attacks", "tags", "created_by", "verified", "dataset_version", "split", "transcription_quality", "source_provenance"
  ],
  "properties": {
    "id": { "type": "string" },
    "title": { "type": "string" },
    "cipher_family": { "type": "string" },
    "cipher_type": { "type": "string" },
    "plaintext": { "type": "string" },
    "ciphertext": { "type": "string" },
    "key": { "type": "object" },
    "language": {
      "type": "string",
      "description": "ISO 639-1/2 code or BCP-47 language tag (e.g., 'en', 'fr', 'de', 'la', 'es')"
    },
        "split": {
          "type": "string",
          "enum": ["public", "blind"],
          "description": "Benchmark split: public (downloadable) or blind (held-out for evaluation)"
        },
        "transcription_quality": {
          "type": "string",
          "enum": ["clean", "noisy"],
          "description": "Indicates whether the transcription is clean or contains realistic noise/errors"
        },
        "source_provenance": {
          "type": "object",
          "description": "Provenance and rights info for historical or synthetic records",
          "properties": {
            "url": { "type": "string", "format": "uri" },
            "archive": { "type": "string" },
            "publication_date": { "type": "string" },
            "license": { "type": "string" }
          },
          "required": ["url", "archive", "publication_date", "license"]
        },
    "alphabet": { "type": "string" },
    "text_length": { "type": "integer" },
    "normalized_text_length": { "type": "integer" },
    "spacing": { "type": "string", "enum": ["preserved", "removed", "grouped", "mixed"] },
    "punctuation": { "type": "string", "enum": ["preserved", "removed", "mixed"] },
    "casing": { "type": "string", "enum": ["uppercase", "lowercase", "mixed"] },
    "difficulty": { "type": "string", "enum": ["beginner", "intermediate", "advanced", "expert"] },
    "source_type": { "type": "string", "enum": ["synthetic", "historical", "public_domain", "user_contributed"] },
    "source": { "type": "string" },
    "license": { "type": "string" },
    "notes": { "type": "string" },
    "expected_attacks": { "type": "array", "items": { "type": "string" } },
    "tags": { "type": "array", "items": { "type": "string" } },
    "created_by": { "type": "string" },
    "verified": { "type": "boolean" },
    "dataset_version": { "type": "string" },
    "year": { "type": "string" },
    "historical_context": { "type": "string" },
    "known_solution_method": { "type": "string" },
    "hints": { "type": "array", "items": { "type": "string" } },
    "tool_notes": { "type": "string" },
    "related_exhibit_url": { "type": "string" },
    "try_in_cipher_detective_url": { "type": "string" },
    "benchmark_split": { "type": "string", "enum": ["beginner", "intermediate", "advanced", "expert", "historical", "blind"] },
    "scoring_notes": { "type": "string" }
  }
}
