Files
MoFin/specs/hygiene.json
T

50 lines
2.2 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"module": "hygiene",
"version": "1.0",
"purpose": "系统卫生审计——防止冗余/废弃/僵尸问题复发的每周自动检查(红线6-10 的 enforcement",
"human_help": {
"title": "系统卫生审计说明",
"description": [
"每周一 07:30 自动运行 system_hygiene_audit.py,检查六类系统卫生问题并推送 XMPP 报告。",
"这是 2026-07-20 冗余事件(三个数据库、31个分叉文件、小果僵尸进程)后建立的防复发机制。"
],
"usage": [
"手动运行: cd /home/hmo/.hermes/profiles/position-analyst/scripts && python3 system_hygiene_audit.py",
"查看报告: /home/hmo/MoFin/gateway/logs/hygiene_report.json"
],
"troubleshooting": [
"分叉副本(diverged_copy): 同名 .py 在不同位置内容不同 → 归档旧副本或硬链接到权威版",
"断裂硬链接(broken_hardlink): deploy 和 profile scripts 内容不一致 → 跑 sync_profile_scripts.sh",
"孤儿文件(orphan_data_file): 生产数据目录 >14 天的文件 → 归档到 archive/(红线8"
]
},
"ai_spec": {
"apis": [],
"dependencies": [
"deploy/profile-scripts/system_hygiene_audit.py",
"deploy/profile-scripts/sync_profile_scripts.sh",
"docs/dev-spec.md 红线 6-10"
],
"constraints": [
"检查项: 分叉副本/断裂硬链接/僵尸进程/孤儿文件/死cron/DB新鲜度",
"docker 容器内进程豁免僵尸检测",
"报告写入 gateway/logs/hygiene_report.json,有问题推 XMPP(:5805)",
"活文件注册表 LIVE_DATA_FILES 需随新数据文件引入而更新"
],
"must_not": [
"禁止只报告不修复——发现问题必须在当轮处理或创建 TODO",
"禁止将生产数据目录下 >14 天文件默认视为正常"
],
"tests": [
{"id": "H1", "name": "人为制造分叉副本,下一轮审计能发现"},
{"id": "H2", "name": "sync 断裂后审计报 broken_hardlink"},
{"id": "H3", "name": "全部检查通过时 status=ok 且不推 XMPP"}
],
"related_files": [
"deploy/profile-scripts/system_hygiene_audit.py",
"deploy/profile-scripts/sync_profile_scripts.sh",
"gateway/logs/hygiene_report.json"
]
}
}