d5b8bec8974fd6873cf2175c0a992b2f7d992f9c
User directive: no JSON, retire it fully, fix all related code. Changes: - price_monitor.py: record_event writes DB only; removed EVENTS_PATH/ load_events/save_events entirely - strategy_feedback.py: price events read from DB only (removed JSON fallback) - system_health_check.py: removed price_events.json from file-check list, DB-only event stats (was showing 0/0 due to wrong-DB resolution) - mo_config.py: removed dead price_events_path property (no callers) - mofin_health.py: price_events freshness reads DB table (authoritative now) - mofin_db.py: DATA_DIR/DB_PATH now ABSOLUTE (/home/hmo/MoFin/data) — was relative __file__.parent, so each hardlinked copy of mofin_db.py resolved to a DIFFERENT database (canonical vs web-dashboard vs profile-local third DB with 0 rows of everything except market_snapshots). This fragmentation was the real cause of health checks reading empty tables. - Unified all 4 mofin_db copies (root/scripts/deploy/profile) via hardlink - price_events.json archived to trashbox (fully backfilled: 6353 rows in DB) Verified: - record_event lands in DB only, JSON not recreated - system_health_check: 历史事件 6353 / 今日事件 2965 (was 0/0) - strategy_feedback + price_monitor full runs clean
MoFin 文档中心
文档驱动开发。每次代码变更必须同步更新对应文档。
阅读指引
🚀 新手入门(按顺序读)
| # | 文档 | 内容 | 时间 |
|---|---|---|---|
| 1 | SYSTEM_ARCHITECTURE.md | 系统总览:架构图、数据流、模块职责 | 10 min |
| 2 | portfolio-data-model.md | 核心数据模型:表结构、币种规则、常见错误 | 10 min |
| 3 | DEVELOPMENT_STANDARDS.md | 开发规范:代码结构、DB 规范、Prompt 规范、开发流程 | 15 min |
| 4 | CHANGELOG.md | 变更日志:所有改动的完整记录 | 5 min |
🔧 日常开发
| 文档 | 何时查阅 |
|---|---|
| DEVELOPMENT_STANDARDS.md | 每次写代码前 |
| TEST_PLAN.md | 每次改完代码后跑测试 |
| CHANGELOG.md | 改完后追加变更记录 |
📊 运维参考
| 文档 | 内容 |
|---|---|
| cron-catalog.md | Cron 任务清单(知微维护) |
| decisions-db-migration.md | JSON→DB 迁移记录(✅ 已完成) |
📦 历史文档(archive/)
旧的设计文档、需求文档、分析报告。仅供参考,不代表当前系统状态。
文档规范
- 每个 .md 文件顶部标注版本和日期
- 过时内容追加
> **已废弃** — 见 XXX 替代 - 不直接删除旧文档,移到
archive/保留 - 交叉引用使用相对路径
[xxx](xxx.md)
当前系统状态
- 数据:纯 SQLite(
/home/hmo/web-dashboard/data/mofin.db) - 币种:港股存 HKD,A 股存 CNY,汇总时转换
- JSON:已全部移除,无残留
- 测试:
scripts/run_all_tests.py— 33/33 通过 - 最新:
CHANGELOG.md查看完整变更
Languages
Python
83.7%
TeX
6.5%
HTML
6.4%
BibTeX Style
2.3%
Shell
0.9%
Other
0.2%