{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://otd-framework.local/contracts/input.schema.json",
  "title": "Yoyo 游戏设计输入",
  "description": "供 OD/TD 设计者在 5–10 分钟内填写，用来设计集团其他同学参与的线上游戏。null 表示未知；空数组表示尚未提供。每轮最多追问 3 个关键问题，不把系统建议当作已确认信息。",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "purpose", "audience", "delivery", "learning", "design_preferences", "reference_projects", "work_transfer"],
  "properties": {
    "schema_version": { "const": "1.0.0" },
    "project_name": { "$ref": "#/$defs/optionalText" },
    "purpose": {
      "type": "object",
      "additionalProperties": false,
      "required": ["problem", "desired_behavior"],
      "properties": {
        "problem": { "$ref": "#/$defs/optionalText", "description": "希望解决的组织或人才问题，尽量描述现象而非预选课程名称。" },
        "critical_situation": { "$ref": "#/$defs/optionalText", "description": "问题发生于谁、什么任务与关键时刻。" },
        "current_behavior": { "$ref": "#/$defs/optionalText" },
        "desired_behavior": { "$ref": "#/$defs/optionalText", "description": "参与者以后应在什么情境下做出什么不同的行为。" },
        "business_relevance": { "$ref": "#/$defs/optionalText" },
        "problem_evidence": { "$ref": "#/$defs/textList", "description": "设计者提供的案例、观察或数据，不等于已经确认的问题原因。" },
        "priority": { "$ref": "#/$defs/optionalText", "description": "本次只优先改变什么；其他问题可以暂缓。" },
        "success_signals": { "$ref": "#/$defs/textList", "description": "可观察信号，不应强制要求无法测得的量化提升。" }
      }
    },
    "audience": {
      "type": "object",
      "additionalProperties": false,
      "required": ["roles"],
      "properties": {
        "roles": { "$ref": "#/$defs/textList" },
        "experience": { "$ref": "#/$defs/optionalText" },
        "participant_count": { "type": ["integer", "null"], "minimum": 1, "description": "游戏总参与人数，不是每队人数。未知时填 null，不用默认数代替。" },
        "prior_knowledge": { "$ref": "#/$defs/optionalText" },
        "learning_preference": {"enum": ["unknown", "explore", "guided", "mixed"], "description": "参与者更喜欢自行探索、先看示范或混合偏好。未知保持未知，不以智力、学历或职位代替。"},
        "domain_experience": { "enum": ["novice", "experienced", "mixed", "unknown"], "description": "与目标能力或知识相关的基础经验，独立于游戏熟悉度。" },
        "motivation_and_resistance": { "$ref": "#/$defs/optionalText" },
        "game_familiarity": { "enum": ["low", "mixed", "high", "unknown"] },
        "team_relationship": { "enum": ["existing", "cross", "individual", "unknown"], "description": "原有团队、跨团队或个人参与。" },
        "theme_preferences": { "$ref": "#/$defs/textList" },
        "visual_preferences": { "$ref": "#/$defs/textList" },
        "avoidances": { "$ref": "#/$defs/textList", "description": "明确反感、文化禁忌或不宜使用的表达。" },
        "accessibility_needs": { "$ref": "#/$defs/textList" }
      }
    },
    "delivery": {
      "type": "object",
      "additionalProperties": false,
      "required": ["channel", "participation_pattern"],
      "properties": {
        "channel": { "const": "online" },
        "participation_pattern": { "enum": ["daily_short", "weekly", "one_session", "flexible", "other", "unknown"] },
        "pattern_notes": { "$ref": "#/$defs/optionalText" },
        "team_size": { "type": ["integer", "null"], "minimum": 1, "description": "每队目标人数；1 表示单人参与。总人数不能整除时，方案要说明余下人员如何安排。未知时填 null。" },
        "rounds_per_session": { "type": ["integer", "null"], "minimum": 1, "description": "每次参与包含几轮游戏；不是整个项目的参与次数。未知时填 null。" },
        "session_minutes": { "type": ["number", "null"], "exclusiveMinimum": 0, "description": "每人每次参与的分钟数，包含引导、操作、交流和回顾。" },
        "sessions_per_week": { "type": ["integer", "null"], "minimum": 1, "maximum": 7, "description": "每周参与几次；特殊安排可用 pattern_notes 说明。" },
        "lifecycle_days": { "type": ["integer", "null"], "minimum": 1, "description": "从开始到结束共多少天，不等于每天都要参与。" },
        "collaboration_mode": { "enum": ["individual", "synchronous_team", "asynchronous_team", "mixed", "unknown"], "description": "单人、同一时间组队、各自找时间协作，或混合安排。" },
        "devices": { "type": "array", "uniqueItems": true, "items": { "enum": ["mobile", "desktop", "tablet"] } },
        "platform_constraints": { "$ref": "#/$defs/textList" },
        "facilitator_available": { "type": ["boolean", "null"] },
        "budget_or_build_constraints": { "$ref": "#/$defs/optionalText" }
      }
    },
    "learning": {
      "type": "object",
      "additionalProperties": false,
      "required": ["entry_path", "provided_theories", "knowledge_goals"],
      "properties": {
        "entry_path": { "enum": ["provided_theory", "problem_only", "mixed", "unknown"] },
        "provided_theories": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name"],
            "properties": {
              "name": { "type": "string", "minLength": 1 },
              "author_or_source": { "$ref": "#/$defs/optionalText" },
              "reference_url": { "$ref": "#/$defs/optionalText" },
              "customer_material": { "$ref": "#/$defs/optionalText" },
              "required_concepts": { "$ref": "#/$defs/textList" }
            }
          }
        },
        "knowledge_goals": { "$ref": "#/$defs/textList" },
        "desired_experiences": { "$ref": "#/$defs/textList", "description": "希望感受到的冲突、反馈、领悟或决策后果。" },
        "must_explain_directly": { "$ref": "#/$defs/textList" },
        "theory_selection_constraints": { "$ref": "#/$defs/optionalText" }
      }
    },
    "design_preferences": {
      "type": "object",
      "additionalProperties": false,
      "required": ["metaphor_preference"],
      "properties": {
        "metaphor_preference": { "enum": ["system_recommendation", "direct", "balanced", "immersive"], "description": "故事与工作情境的距离：由系统建议、贴近工作、借个故事、深入故事。与讲解时机分开。" },
        "reveal_preference": {"enum": ["system_recommendation", "before", "after", "optional"], "description": "先给示范、体验后点明，或自主领悟并按需查看解释。缺省保留旧版讲解偏好的含义。"},
        "challenge_preference": { "enum": ["system_recommendation", "gentle", "balanced", "challenging", "unknown"], "description": "挑战程度：由系统建议、轻松上手、适中、有挑战，或尚未确定。这是设计偏好，不是能力测试分数。" },
        "theme_preferences": { "$ref": "#/$defs/textList" },
        "visual_preferences": { "$ref": "#/$defs/textList" },
        "mechanic_preferences": { "$ref": "#/$defs/textList" },
        "hard_constraints": { "$ref": "#/$defs/textList" },
        "must_include": { "$ref": "#/$defs/textList" },
        "avoid": { "$ref": "#/$defs/textList" },
        "brand_requirements": { "$ref": "#/$defs/optionalText" }
      }
    },
    "reference_projects": {
      "type": "array",
      "description": "选填；不填写时只能提出差异化假设，不能声称市场唯一。",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "relationship", "known_features"],
        "properties": {
          "name": { "type": "string", "minLength": 1 },
          "relationship": { "enum": ["market_product", "past_internal_project", "other"] },
          "known_features": { "$ref": "#/$defs/textList" },
          "liked": { "$ref": "#/$defs/textList" },
          "avoid_repeating": { "$ref": "#/$defs/textList" },
          "source_url_or_notes": { "$ref": "#/$defs/optionalText" }
        }
      }
    },
    "work_transfer": {
      "type": "object",
      "additionalProperties": false,
      "required": ["enabled"],
      "properties": {
        "enabled": { "type": ["boolean", "null"], "description": "由设计者选择；null 时不擅自加入强制工作任务或持续追踪。" },
        "application_context": { "$ref": "#/$defs/optionalText" },
        "followup_constraints": { "$ref": "#/$defs/optionalText" }
      }
    },
    "followup_answers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["question_id", "answer"],
        "properties": {
          "question_id": { "type": "string", "minLength": 1 },
          "answer": { "type": "string", "minLength": 1 }
        }
      }
    }
  },
  "$defs": {
    "optionalText": { "type": ["string", "null"], "minLength": 1 },
    "textList": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
  }
}
