{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cyberdeliaskunkworks.com/data/schemas/package-manifest.schema.json",
  "title": "Cyberdelia Download Package Manifest",
  "type": "object",
  "required": ["package_id", "name", "version", "package_class", "origin", "status", "cyberdelia_path", "license"],
  "properties": {
    "package_id": {"type": "string", "minLength": 1},
    "name": {"type": "string", "minLength": 1},
    "version": {"type": "string", "minLength": 1},
    "package_class": {"enum": ["cyberdelia-built", "upstream-mirror", "patched-derivative", "research-package", "dataset-bundle", "manual-bundle", "other"]},
    "status": {"enum": ["planned", "assembling", "testing", "release-candidate", "released", "deprecated", "withdrawn"]},
    "origin": {
      "type": "object",
      "required": ["upstream_url"],
      "properties": {
        "upstream_url": {"type": ["string", "null"]},
        "upstream_author": {"type": ["string", "null"]},
        "upstream_version": {"type": ["string", "null"]},
        "retrieved_at": {"type": ["string", "null"], "format": "date-time"}
      }
    },
    "cyberdelia_path": {"type": "string", "pattern": "^/"},
    "summary": {"type": "string"},
    "platforms": {"type": "array", "items": {"type": "string"}},
    "architectures": {"type": "array", "items": {"type": "string"}},
    "dependencies": {"type": "array", "items": {"type": "string"}},
    "capabilities": {"type": "array", "items": {"type": "string"}},
    "required_privileges": {"type": "array", "items": {"type": "string"}},
    "network_effects": {"type": "array", "items": {"type": "string"}},
    "filesystem_effects": {"type": "array", "items": {"type": "string"}},
    "cleanup": {"type": "array", "items": {"type": "string"}},
    "known_risks": {"type": "array", "items": {"type": "string"}},
    "test_state": {"enum": ["not-tested", "static-reviewed", "lab-tested", "reproduced", "upstream-only", "not-applicable"]},
    "license": {
      "type": "object",
      "required": ["name", "redistribution"],
      "properties": {
        "name": {"type": ["string", "null"]},
        "redistribution": {"enum": ["allowed", "restricted", "unknown", "not-applicable"]},
        "source_url": {"type": ["string", "null"]},
        "notes": {"type": ["string", "null"]}
      }
    },
    "documentation": {
      "type": "object",
      "properties": {
        "upstream_readme": {"type": ["string", "null"]},
        "manuals": {"type": "array", "items": {"type": "string"}},
        "source_code": {"type": ["string", "null"]}
      }
    }
  },
  "additionalProperties": true
}
