{
  "module": "infra",
  "version": "1.0",
  "purpose": "Platform 服务总览：展示 Windows 上运行的三个核心服务（WeChat Bridge、API Proxy、文章抓取服务）的运行状态，每个服务可通过其旁边的 ?/§ 查看详细文档。",
  "ui_location": "Infrastructure tab → Platform",

  "human_help": {
    "title": "Platform 服务概览",
    "description": [
      "Platform 区域展示在 Windows (192.168.1.16) 上运行的三个核心基础设施服务：",
      "• WeChat Bridge (:5801) — 微信消息桥接，连接微信 ↔ Hermes AI",
      "• API Proxy (:8787) — API 代理，转发 VolcEngine DeepSeek 请求",
      "• 文章抓取服务 (:5810) — 微信公众号全文抓取 + OCR",
      "",
      "每个服务右侧有单独的 ?（使用说明）和 §（AI Spec）按钮。",
      "点击可查看该服务的详细文档、API 端点和排障指南。",
      "",
      "其他基础设施部分（EasyTier / RDP / Usage / Ejabberd）各自独立，在本 tab 下方。"
    ],
    "usage": [
      "状态指示：绿色圆点 = 运行中，红色圆点 = 已停止",
      "点击服务旁的 ? 查看人类可读的说明文档",
      "点击服务旁的 § 查看 AI 接口文档（API、依赖、约束）",
      "如果服务 stopped：检查 Windows 上对应的进程是否在运行"
    ],
    "troubleshooting": [
      "如果所有服务都 stopped：Windows 可能关机了，或 wechat_agent 没启动",
      "如果单个服务 stopped：检查该服务的具体进程",
      "Dashboard 每 5-10s 自动刷新 Platform 状态"
    ],
    "related": "Ejabberd（底层通信总线）、F 健康 tab（系统整体健康）"
  },

  "ai_spec": {
    "apis": [
      {"method": "GET", "path": "/api/platform", "returns": "[{id,name,type,desc,status,health_data}] — 三个 Platform 服务的状态列表"}
    ],
    "dependencies": [
      "Platform 服务运行在 Windows (192.168.1.16)，Dashboard (Linux 246) 通过网络检测",
      "WeChat Bridge 使用 health_url = http://192.168.1.16:5801/health",
      "API Proxy 使用 port check (8787)",
      "文章抓取服务使用 health_url = http://192.168.1.16:5810/health"
    ],
    "constraints": [
      "Dashboard 从 246 通过 HTTP/端口扫描检测 Windows 服务",
      "如果 246 无法连通 16 上的端口，所有服务显示 stopped",
      "Platform 和 Ejabberd 内容在 infra-pe wrapper 中全量重渲染"
    ],
    "tests": [
      {"id": "IN01", "name": "Platform 状态正常返回", "endpoint": "GET /api/platform"}
    ],
    "related_modules": [
      {"module": "wechat_bridge", "relation": "Platform 核心服务 — 微信消息桥接"},
      {"module": "api_proxy", "relation": "Platform 核心服务 — API 代理转发"},
      {"module": "article_processor", "relation": "Platform 核心服务 — 文章抓取 + OCR"},
      {"module": "ejabberd", "relation": "XMPP 通信总线（独立于 Platform）"}
    ],
    "related_files": [
      "gateway/scripts/templates/dashboard.html — fI() 渲染函数",
      "gateway/scripts/dashboard.py — /api/platform 端点",
      "gateway/scripts/specs/infra.json — 本 spec 文件",
      "gateway/scripts/specs/wechat_bridge.json — WeChat Bridge 详细 spec",
      "gateway/scripts/specs/api_proxy.json — API Proxy 详细 spec",
      "gateway/scripts/specs/article_processor.json — 文章抓取服务详细 spec",
      "gateway/scripts/specs/easytier.json — EasyTier 详细 spec",
      "gateway/scripts/specs/rdp.json — RDP 详细 spec",
      "gateway/scripts/specs/usage_monitor.json — Usage monitor 详细 spec"
    ]
  }
}
