{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "plan-overview-fix-schema.json",
  "title": "Fix Plan Overview Schema",
  "description": "Fix 计划概览 — 继承 base + fix 专属字段。_metadata.plan_type 必须为 'fix'。",
  "allOf": [
    { "$ref": "plan-overview-base-schema.json" }
  ],
  "required": ["fix_context"],
  "properties": {
    "fix_context": {
      "type": "object",
      "required": ["root_cause", "strategy", "severity", "risk_level"],
      "properties": {
        "root_cause": {
          "type": "string",
          "description": "根因描述 (从 fix-plan-json-schema.root_cause 迁移)"
        },
        "strategy": {
          "type": "string",
          "enum": ["immediate_patch", "comprehensive_fix", "refactor"],
          "description": "修复策略 (从 fix-plan-json-schema.strategy 迁移)"
        },
        "severity": {
          "type": "string",
          "enum": ["Low", "Medium", "High", "Critical"],
          "description": "Bug 严重等级 (从 fix-plan-json-schema.severity 迁移)"
        },
        "risk_level": {
          "type": "string",
          "enum": ["low", "medium", "high"],
          "description": "修复风险等级 (从 fix-plan-json-schema.risk_level 迁移)"
        }
      },
      "additionalProperties": false,
      "description": "Fix 专属上下文 — 整合原 fix-plan-json-schema 的顶层 fix 字段"
    },

    "test_strategy": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string",
          "enum": ["unit", "integration", "e2e", "smoke", "full"],
          "description": "修复后的测试范围"
        },
        "specific_tests": {
          "type": "array",
          "items": { "type": "string" },
          "description": "需运行的特定测试文件或模式"
        },
        "manual_verification": {
          "type": "array",
          "items": { "type": "string" },
          "description": "手动验证步骤 (无自动化测试时)"
        }
      },
      "additionalProperties": false,
      "description": "修复验证测试策略 (从 fix-plan-json-schema.test_strategy 迁移)"
    },

    "rollback_plan": {
      "type": "object",
      "properties": {
        "strategy": {
          "type": "string",
          "enum": ["git_revert", "feature_flag", "manual"],
          "description": "回滚策略"
        },
        "steps": {
          "type": "array",
          "items": { "type": "string" },
          "description": "回滚步骤"
        }
      },
      "additionalProperties": false,
      "description": "回滚计划 (从 fix-plan-json-schema.rollback_plan 迁移)"
    },

    "_metadata": {
      "type": "object",
      "properties": {
        "diagnosis_angles": {
          "type": "array",
          "items": { "type": "string" },
          "description": "诊断角度 (fix 特有，从 fix-plan-json-schema._metadata.diagnosis_angles 迁移)"
        }
      },
      "description": "Fix 扩展的 metadata 字段 (与 base _metadata 合并)"
    }
  },

  "_field_migration_from_fix_plan_json": {
    "root_cause": "→ fix_context.root_cause",
    "strategy": "→ fix_context.strategy",
    "severity": "→ fix_context.severity",
    "risk_level": "→ fix_context.risk_level",
    "test_strategy": "直接迁移",
    "rollback_plan": "直接迁移",
    "tasks": "→ task_ids[] (引用 .task/ 下的独立文件)",
    "_metadata.diagnosis_angles": "直接迁移"
  }
}
