# Impact Report 模板

分析完成后，将结果写入 `local_knowledge/knowledge-card/impact-report.json`。

```json
{
  "meta": {
    "diff_range": "abc123..HEAD",
    "changed_files": 15,
    "analyzed_at": "2026-07-07T10:00:00Z"
  },
  "modules": [
    {
      "module": "p_watchface",
      "candidate_path": "p_watchface/",
      "operation": "new",
      "impacted_files": ["p_watchface/src/main/java/.../WatchFaceActivity.java"],
      "action": "needs_scan"
    },
    {
      "module": "p_old_feature",
      "module_path": "p_old_feature/",
      "operation": "deleted",
      "deleted_files": ["p_old_feature/src/main/java/.../XxxActivity.java"],
      "deletion_ratio": 1.0,
      "dependents": ["p_morepage"],
      "action": "needs_cleanup"
    },
    {
      "module": "p_location",
      "module_path": "p_location/",
      "operation": "modified",
      "card_operations": [
        {
          "summary_id": "a1b2c3d4-LocationCore",
          "name": "定位核心服务",
          "action": "update",
          "change_details": [
            {
              "type": "api_signature_change",
              "symbol": "LocationApi.getCurrentPosition",
              "description": "方法签名从 (Callback) 改为 (Callback, Timeout)",
              "affected_chapters": ["核心API", "使用方式"]
            }
          ]
        },
        {
          "summary_id": "e5f6g7h8-OldView",
          "name": "定位旧视图",
          "action": "delete",
          "reason": "核心路径文件已删除"
        }
      ],
      "module_impacts": ["p_location/src/main/java/.../UncoveredNewFile.java"]
    }
  ],
  "unrelated_changes": [
    { "file": "build.gradle", "reason": "构建配置文件变更" }
  ]
}
```

## 字段说明

| 字段 | 说明 |
|------|------|
| meta.diff_range | git diff 范围 |
| meta.changed_files | 变更文件总数 |
| modules[].module | 模块名 |
| modules[].operation | `new` / `deleted` / `modified` |
| modules[].action | `needs_scan` / `needs_cleanup`（new/deleted 级别）/ 该模块无 module 级 action 时走 card_operations |
| modules[].card_operations[].action | `update`（需更新卡片）/ `delete`（需删除卡片） |
| modules[].card_operations[].change_details | 变更详情，下游 card-splitter 用于 affected_chapters |
| modules[].module_impacts | 模块内有文件但无卡片覆盖的区域 |
| unrelated_changes | 与知识卡片无关的变更文件 |
