feat: introduce spec system + dashboard + health pipeline (AgentsMeeting template)

This commit is contained in:
hmo
2026-07-19 10:50:34 +08:00
parent 81c6dd2314
commit 747fdfe467
19 changed files with 1826 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
{
"module": "dashboard",
"version": "1.0",
"purpose": "MoFin 管理门户。独立 Flask 应用(端口 5804),统一展示系统健康状态、模块 spec 帮助和监控数据。",
"human_help": {
"title": "Dashboard — 管理门户",
"description": [
"MoFin 统一管理面板,提供系统健康状态总览和各模块的帮助文档。",
"采用深色主题 Web UI,与 AgentsMeeting Dashboard 一致的视觉风格。",
"访问地址: http://192.168.1.246:5804"
],
"usage": [
"打开浏览器访问 http://192.168.1.246:5804",
"F 健康 Tab — 查看所有服务运行状态和健康管线数据",
"G 规范 Tab — 查看开发规范文档",
"点击 ? 按钮 — 查看面向人类的模块帮助",
"点击 § 按钮 — 查看面向 AI 的接口约束文档"
],
"troubleshooting": [
"Dashboard 不响应 → ssh 246 'sudo systemctl restart mofin-dashboard'",
"F Tab 无数据 → 检查 crontab 中健康检查任务是否运行",
"Spec 加载失败 → 检查 specs/ 目录权限和 JSON 格式"
]
},
"ai_spec": {
"apis": [
{"method": "GET", "path": "/api/health", "returns": "{status:'ok', uptime:N}"},
{"method": "GET", "path": "/api/services", "returns": "{services[{name, type, port, status}]} — 所有注册服务的运行状态"},
{"method": "GET", "path": "/api/expected", "returns": "{expected[{name, port, expected, critical}], actual{name:status}} — 期望状态矩阵"},
{"method": "GET", "path": "/api/monitor", "returns": "{tier1{summary{ok,total}}, tier2{summary{ok,total}}, tasks[{name,status}]} — 聚合监控数据"},
{"method": "GET", "path": "/api/module-spec/<module>", "returns": "specs/{module}.json 内容"}
],
"dependencies": [
"specs/ 目录 — 所有模块的 spec JSON 文件",
"agents_health_check.py — Tier1 健康检查(生成 last_health_check.json",
"agents_daily_health.py — Tier2 日检(生成 last_daily_health.json",
"server.py :8899 — 业务 APIDashboard 通过 HTTP 检测其可达性)"
],
"constraints": [
"Dashboard 部署在 Linux 246 上,端口 5804",
"通过 systemd 守护(mofin-dashboard.service",
"不依赖 server.py :8899(可独立运行)",
"前端 5 秒轮询 /api/services + /api/expected",
"?§ 按钮通过 /api/module-spec/<module> 读取 spec JSON"
],
"must_not": [
"不要修改 server.py :8899 来集成 Dashboard(保持独立)",
"不要在 Dashboard 中硬编码业务数据(只做监控和文档展示)",
"不要移除 ?§ 按钮系统(这是 spec 可视化的核心)"
],
"related_files": [
"dashboard.py — Flask 后端",
"templates/dashboard.html — 前端",
"specs/ — Spec 文件目录",
"gateway/logs/ — 运行时日志"
]
}
}