{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cyberdeliaskunkworks.com/data/schemas/research-project.schema.json",
  "title": "Cyberdelia Research Project Manifest",
  "type": "object",
  "required": ["project_id", "title", "status", "question", "methods", "data_sources", "reproducibility"],
  "properties": {
    "project_id": {"type": "string", "minLength": 1},
    "title": {"type": "string", "minLength": 1},
    "status": {"enum": ["proposed", "source-acquisition", "staging", "active", "analysis", "verification", "published", "paused", "superseded"]},
    "question": {"type": "string", "minLength": 1},
    "hypotheses": {"type": "array", "items": {"type": "string"}},
    "methods": {"type": "array", "items": {"type": "string"}},
    "assumptions": {"type": "array", "items": {"type": "string"}},
    "stop_conditions": {"type": "array", "items": {"type": "string"}},
    "data_sources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "source_url", "custody_status"],
        "properties": {
          "id": {"type": "string"},
          "source_url": {"type": ["string", "null"]},
          "archive_object_id": {"type": ["string", "null"]},
          "custody_status": {"enum": ["source-indexed", "mirror-queued", "acquiring", "mirrored", "verified", "restricted", "source-lost"]},
          "notes": {"type": ["string", "null"]}
        }
      }
    },
    "compute": {
      "type": "object",
      "properties": {
        "priority": {"type": ["string", "null"]},
        "cpu_limit": {"type": ["string", "null"]},
        "gpu_limit": {"type": ["string", "null"]},
        "memory_limit": {"type": ["string", "null"]},
        "storage_limit": {"type": ["string", "null"]},
        "duration_class": {"type": ["string", "null"]},
        "preemptible": {"type": "boolean"}
      }
    },
    "reproducibility": {
      "type": "object",
      "required": ["code_versioned", "parameters_recorded", "logs_retained", "derived_outputs_separate"],
      "properties": {
        "code_versioned": {"type": "boolean"},
        "parameters_recorded": {"type": "boolean"},
        "logs_retained": {"type": "boolean"},
        "derived_outputs_separate": {"type": "boolean"},
        "environment": {"type": ["string", "null"]},
        "container": {"type": ["string", "null"]}
      }
    },
    "result_state": {"enum": ["not-run", "in-progress", "reproduced", "supported", "contradicted", "unresolved", "negative", "superseded"]},
    "publication": {
      "type": "object",
      "properties": {
        "article_url": {"type": ["string", "null"]},
        "ftp_path": {"type": ["string", "null"]},
        "citation": {"type": ["string", "null"]},
        "corrections_url": {"type": ["string", "null"]}
      }
    }
  },
  "additionalProperties": true
}
