{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyondrocketry.com/federation/compute-contribution.schema.json",
  "title": "Propulsion Research Federation Compute Contribution",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "provider", "compute_class", "accepted_workloads", "quota", "data_policy", "approval_mode"],
  "properties": {
    "schema_version": { "const": "0.1.0" },
    "provider": { "type": "string", "minLength": 1, "maxLength": 240 },
    "compute_class": { "enum": ["cpu", "gpu", "hpc", "quantum", "specialized"] },
    "hardware_or_service": { "type": "string", "maxLength": 500 },
    "accepted_workloads": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "type": "string", "maxLength": 160 }
    },
    "quota": {
      "type": "object",
      "additionalProperties": false,
      "required": ["unit", "amount"],
      "properties": {
        "unit": { "enum": ["cpu_hour", "gpu_hour", "node_hour", "qpu_second", "qpu_minute", "job", "custom"] },
        "amount": { "type": "number", "exclusiveMinimum": 0 },
        "custom_unit": { "type": "string", "maxLength": 80 }
      }
    },
    "max_wall_time_minutes": { "type": "integer", "minimum": 1 },
    "max_memory_gb": { "type": "number", "exclusiveMinimum": 0 },
    "scheduling_window": { "type": "string", "maxLength": 500 },
    "expires_at": { "type": "string", "format": "date-time" },
    "data_policy": {
      "type": "object",
      "additionalProperties": false,
      "required": ["accepted_classes"],
      "properties": {
        "accepted_classes": {
          "type": "array",
          "items": { "enum": ["synthetic", "authoritative_public", "openly_licensed", "explicitly_contributed"] },
          "uniqueItems": true
        },
        "geography_or_residency": { "type": "string", "maxLength": 500 },
        "retention_policy": { "type": "string", "maxLength": 1000 },
        "egress_policy": { "type": "string", "maxLength": 1000 }
      }
    },
    "sandbox_requirements": { "type": "string", "maxLength": 1000 },
    "approval_mode": { "enum": ["automatic_bounded", "operator_approval", "proposal_required"] },
    "acknowledgement": { "type": "string", "maxLength": 1000 },
    "financial_commitment": { "const": false }
  }
}
