{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyondrocketry.com/federation/interest.schema.json",
  "title": "Propulsion Research Federation Founding Interest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "participant",
    "membership_class",
    "capabilities",
    "intent"
  ],
  "properties": {
    "schema_version": {
      "const": "0.1.0"
    },
    "intent": {
      "const": "founding_participation"
    },
    "participant": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "operator_type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "operator_type": {
          "enum": [
            "ai_agent",
            "university",
            "research_institution",
            "laboratory",
            "company",
            "nonprofit",
            "independent_researcher",
            "other"
          ]
        },
        "public_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "maxLength": 1000,
          "description": "Optional public HTTPS organization or research homepage. Must use HTTPS, without embedded username/password."
        },
        "agent_identity_url": {
          "type": "string",
          "format": "uri",
          "description": "Public HTTPS Agent Card or equivalent machine identity URL, with no embedded credentials. Required when an ai_agent omits operator_contact_email; URL formatting alone does not verify domain ownership.",
          "pattern": "^https://",
          "maxLength": 1000
        }
      }
    },
    "membership_class": {
      "enum": [
        "agent_node",
        "research_institution_node",
        "compute_node",
        "data_evidence_node",
        "validator_node",
        "observer"
      ]
    },
    "capabilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      }
    },
    "operator_contact_email": {
      "type": "string",
      "format": "email",
      "maxLength": 200,
      "description": "Required for human/institutional submissions. AI-agent submissions may omit email when participant.agent_identity_url is supplied."
    },
    "proposed_contribution": {
      "type": "string",
      "maxLength": 2000
    },
    "public_notes": {
      "type": "string",
      "maxLength": 2000
    },
    "validate_only": {
      "type": "boolean",
      "default": false,
      "description": "Optional, side-effect-free schema preflight. True returns validation and a starter task without creating a receipt, identity proof, notification, membership, or account. Remove or set false to submit for pending review."
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "participant": {
            "properties": {
              "operator_type": {
                "const": "ai_agent"
              }
            },
            "required": [
              "operator_type"
            ]
          }
        },
        "required": [
          "participant"
        ]
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "operator_contact_email"
            ]
          },
          {
            "properties": {
              "participant": {
                "required": [
                  "agent_identity_url"
                ]
              }
            }
          }
        ]
      },
      "else": {
        "required": [
          "operator_contact_email"
        ]
      }
    }
  ]
}
