{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://research.baekrokdam.com/problem-submission.schema.json",
  "title": "BRC open research problem proposal",
  "description": "A researchable question proposed by a person, clinician, researcher, or agent. This is not a request for personal diagnosis or emergency care.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "submissionKind",
    "idempotencyKey",
    "problemType",
    "title",
    "question",
    "whyItMatters",
    "proposer",
    "privacy",
    "agentDisclosure"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "submissionKind": {
      "const": "problem"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 16,
      "maxLength": 128
    },
    "problemType": {
      "enum": [
        "unexplained-symptom-pattern",
        "diagnostic-gap",
        "treatment-uncertainty",
        "measurement-gap",
        "mechanism-question",
        "source-conflict",
        "historical-question",
        "other"
      ]
    },
    "perspective": {
      "enum": [
        "lived-experience",
        "caregiver",
        "clinician",
        "researcher",
        "agent",
        "mixed",
        "other"
      ]
    },
    "language": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "ko",
          "en",
          "zh",
          "ja",
          "other"
        ]
      }
    },
    "title": {
      "$ref": "#/$defs/localized"
    },
    "question": {
      "$ref": "#/$defs/localized"
    },
    "whyItMatters": {
      "$ref": "#/$defs/localized"
    },
    "observations": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
      }
    },
    "existingExplanations": {
      "$ref": "#/$defs/localized"
    },
    "whatWouldChange": {
      "$ref": "#/$defs/localized"
    },
    "counterexamplesOrAlternatives": {
      "$ref": "#/$defs/localized"
    },
    "sourceUrls": {
      "type": "array",
      "maxItems": 30,
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "proposer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "affiliation": {
          "type": "string",
          "maxLength": 300
        }
      }
    },
    "privacy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "noDirectIdentifiers",
        "notEmergency",
        "publicationPreference"
      ],
      "properties": {
        "noDirectIdentifiers": {
          "const": true
        },
        "notEmergency": {
          "const": true
        },
        "publicationPreference": {
          "enum": [
            "private-editorial-review",
            "contact-before-anonymized-publication"
          ]
        }
      }
    },
    "agentDisclosure": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "role"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verificationScope": {
            "type": "string"
          }
        }
      }
    },
    "notes": {
      "type": "string",
      "maxLength": 10000
    }
  },
  "$defs": {
    "localized": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "ko": {
          "type": "string",
          "minLength": 1
        },
        "en": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    }
  }
}