{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jarch.space/project-submission.schema.json",
  "title": "JARCH project introduction",
  "description": "A JARCH-specific optional format for preparing an email introduction. No website endpoint accepts this JSON. Matching the schema does not establish qualification, authorization, verified evidence, or investment approval.",
  "type": "object",
  "additionalProperties": false,
  "required": ["project", "responsible_contact", "thesis_fit", "evidence", "seeking", "sender"],
  "properties": {
    "project": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "website"],
      "properties": {
        "name": { "$ref": "#/$defs/text" },
        "website": { "$ref": "#/$defs/publicUrl" },
        "category": { "$ref": "#/$defs/text" },
        "stage": { "$ref": "#/$defs/text" },
        "deal_type": { "enum": ["liquid_token", "pre_tge", "private_equity"] }
      }
    },
    "responsible_contact": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "email"],
      "properties": {
        "name": { "$ref": "#/$defs/text", "description": "Accountable person or team; do not include identity documents or other sensitive personal records." },
        "email": { "type": "string", "format": "email", "maxLength": 254 },
        "organization": { "$ref": "#/$defs/text" }
      }
    },
    "thesis_fit": { "$ref": "#/$defs/text" },
    "evidence": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["kind", "url", "summary"],
        "properties": {
          "kind": { "enum": ["product", "usage", "revenue", "protocol_fees", "retention", "technical_documentation", "github", "audit", "other"] },
          "url": { "$ref": "#/$defs/publicUrl" },
          "summary": { "$ref": "#/$defs/text", "description": "What this public source demonstrates, including limitations or whether the information is self-reported." }
        }
      }
    },
    "seeking": { "$ref": "#/$defs/text" },
    "sender": {
      "type": "object",
      "additionalProperties": false,
      "required": ["role"],
      "properties": {
        "role": { "enum": ["human", "authorized_agent"] },
        "operator_authorized": { "type": "boolean", "description": "A statement by the sender, not a permission granted by this website or proof verified by the schema." }
      },
      "allOf": [{
        "if": { "properties": { "role": { "const": "authorized_agent" } }, "required": ["role"] },
        "then": { "properties": { "operator_authorized": { "const": true } }, "required": ["operator_authorized"] }
      }]
    },
    "metrics": {
      "type": "array",
      "description": "Optional, sourced metrics only. Omit when unavailable; do not substitute invented or zero values for unknowns.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "value", "period", "source_url"],
        "properties": {
          "name": { "$ref": "#/$defs/text" },
          "value": { "$ref": "#/$defs/text" },
          "period": { "$ref": "#/$defs/text" },
          "source_url": { "$ref": "#/$defs/publicUrl" }
        }
      }
    },
    "diligence": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "network": { "$ref": "#/$defs/text" },
        "github_url": { "$ref": "#/$defs/publicUrl" },
        "token_docs_url": { "$ref": "#/$defs/publicUrl" },
        "audit_urls": { "type": "array", "items": { "$ref": "#/$defs/publicUrl" } },
        "raise_summary": { "$ref": "#/$defs/text" },
        "legal_structure": { "$ref": "#/$defs/text" }
      }
    }
  },
  "$defs": {
    "text": { "type": "string", "minLength": 1, "pattern": "\\S", "maxLength": 3000 },
    "publicUrl": { "type": "string", "format": "uri", "pattern": "^https?://", "maxLength": 2048, "description": "A public HTTP(S) source. Do not include signed links, credentials, tokens, or confidential documents." }
  }
}
