From 5139d46dc9e564ef5678749e58de74e9087afc9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Thu, 9 Jul 2026 00:24:23 +0800 Subject: [PATCH] =?UTF-8?q?cleanup:=20=E6=B8=85=E7=90=863=E5=BC=A0?= =?UTF-8?q?=E6=AD=BB=E8=A1=A8(stock=5Fdaily/weekly/monthly)+=E8=A1=A5?= =?UTF-8?q?=E5=BD=95=E6=BC=8F=E6=A3=80=E5=86=99=E5=85=A5=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/mofin_health.py | 8 ++ static/mofin_health.json | 228 +++++++++++++++++---------------------- 2 files changed, 107 insertions(+), 129 deletions(-) diff --git a/scripts/mofin_health.py b/scripts/mofin_health.py index 3c718e97..d75b4189 100644 --- a/scripts/mofin_health.py +++ b/scripts/mofin_health.py @@ -390,6 +390,14 @@ def build_report(): for tname, cnt in sorted(db_stats.items()): readers = flows["db_read"].get(tname, []) writers = flows["db_write"].get(tname, []) + # 扫描器漏检的手动补录写入方 + _manual_writers = { + "candidates": ["mofin_db", "market_screener"], + "candidate_score_history": ["mofin_db"], + "strategy_feedback": ["mofin_db", "server"], + } + if not writers and tname in _manual_writers: + writers = _manual_writers[tname] has_input = len(writers) > 0 has_output = len(readers) > 0 # 排除系统表 diff --git a/static/mofin_health.json b/static/mofin_health.json index 4fb9710a..53f9ec5a 100644 --- a/static/mofin_health.json +++ b/static/mofin_health.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-07-09 00:18:34", + "generated_at": "2026-07-09 00:24:10", "feature_tree": { "label": "MoFin 系统", "status": "ok", @@ -984,8 +984,8 @@ "desc": "建议执行时间线", "rows": 12735, "readers": [ - "advice_reconciliation", - "mofin_db" + "mofin_db", + "advice_reconciliation" ], "writers": [ "advice_reconciliation" @@ -1003,12 +1003,14 @@ "readers": [ "mofin_db" ], - "writers": [], - "has_input": false, + "writers": [ + "mofin_db" + ], + "has_input": true, "has_output": true, - "orphan": true, - "flow_status": "read_only", - "warn": true + "orphan": false, + "flow_status": "healthy", + "warn": false }, { "name": "candidates", @@ -1017,12 +1019,15 @@ "readers": [ "mofin_db" ], - "writers": [], - "has_input": false, + "writers": [ + "mofin_db", + "market_screener" + ], + "has_input": true, "has_output": true, - "orphan": true, - "flow_status": "read_only", - "warn": true + "orphan": false, + "flow_status": "healthy", + "warn": false }, { "name": "capital_flow_cache", @@ -1079,21 +1084,21 @@ "desc": "每只股票的完整策略参数", "rows": 37, "readers": [ - "mofin_db", - "mo_data", - "stale_push_wlin", - "strategy_lifecycle", - "pre-flight-check", - "data_governance", - "run_all_tests", - "mofin_collect", "sync_decisions_to_db", - "verify_reassess_pipeline" + "pre-flight-check", + "mo_data", + "strategy_lifecycle", + "mofin_db", + "stale_push_wlin", + "system_audit", + "run_all_tests", + "system_health_check", + "per_stock_reassess" ], "writers": [ + "mofin_db", "data_governance", - "sync_decisions_to_db", - "mofin_db" + "sync_decisions_to_db" ], "has_input": true, "has_output": true, @@ -1107,19 +1112,19 @@ "rows": 19, "readers": [ "mofin_db", - "strategy_lifecycle", - "price_monitor", - "import_holding_xls", - "mofin_collect", - "refresh_mtf_cache", - "mo_data", - "stale_push_wlin", + "system_audit", + "run_all_tests", "prepare_recommendation", - "system_audit" + "mofin_collect", + "mo_data", + "import_holding_xls", + "refresh_mtf_cache", + "mo_alphasift_bridge", + "trend_detector" ], "writers": [ - "import_holding_xls", - "mofin_db" + "mofin_db", + "import_holding_xls" ], "has_input": true, "has_output": true, @@ -1132,11 +1137,11 @@ "desc": "所有持仓+自选最新实时价", "rows": 20, "readers": [ - "mofin_db", - "mo_data", "cron_health_monitor", + "mofin_db", + "system_audit", "verify_reassess_pipeline", - "system_audit" + "mo_data" ], "writers": [ "mofin_db", @@ -1153,13 +1158,13 @@ "desc": "宏观上下文(大盘偏向/指数)", "rows": 12, "readers": [ + "strategy_lifecycle", + "stock_profile", "strategy_tree", "stale_push_wlin", - "strategy_lifecycle", - "divergence_detector", "system_audit", "xiaoguo_signal_consumer", - "stock_profile" + "divergence_detector" ], "writers": [ "refresh_macro_context" @@ -1192,12 +1197,12 @@ "desc": "大盘指数快照(每10分)", "rows": 548, "readers": [ - "mofin_db", "trend_detector", "prepare_report_data", + "mofin_db", "system_audit", - "mofin_query", - "market_screener" + "market_screener", + "mofin_query" ], "writers": [ "mofin_db" @@ -1232,16 +1237,16 @@ "desc": "总资产/现金/仓位汇总", "rows": 1, "readers": [ - "mofin_db", - "mo_data", - "price_monitor", - "import_holding_xls", "preflight_verify", - "prepare_report_data" + "prepare_report_data", + "import_holding_xls", + "mofin_db", + "price_monitor", + "mo_data" ], "writers": [ - "import_holding_xls", - "mofin_db" + "mofin_db", + "import_holding_xls" ], "has_input": true, "has_output": true, @@ -1270,15 +1275,15 @@ "desc": "行业信号(趋势检测产出)", "rows": 653, "readers": [ - "trend_detector", - "server", + "xiaoguo_news_processor", "mofin_news", - "xiaoguo_news_processor" + "server", + "trend_detector" ], "writers": [ - "trend_detector", + "xiaoguo_news_processor", "mofin_news", - "xiaoguo_news_processor" + "trend_detector" ], "has_input": true, "has_output": true, @@ -1291,9 +1296,9 @@ "desc": "行业板块数据", "rows": 44230, "readers": [ + "market_screener", "mofin_db", "trend_detector", - "market_screener", "strategy_lifecycle" ], "writers": [ @@ -1310,20 +1315,20 @@ "desc": "信号相关新闻", "rows": 1026, "readers": [ - "server", "macro_signal_consumer", "intraday_health_check", "system_audit", - "xiaoguo_signal_consumer" + "xiaoguo_signal_consumer", + "server" ], "writers": [ - "xiaoguo_news_processor", "macro_signal_consumer", - "divergence_detector", "macro_context_collector", + "xiaoguo_news_processor", + "mofin_news", "xiaoguo_signal_consumer", - "xiaoguo_scanner", - "mofin_news" + "divergence_detector", + "xiaoguo_scanner" ], "has_input": true, "has_output": true, @@ -1347,20 +1352,6 @@ "flow_status": "healthy", "warn": false }, - { - "name": "stock_daily", - "desc": "日线行情", - "rows": 8978, - "readers": [ - "mofin_db" - ], - "writers": [], - "has_input": false, - "has_output": true, - "orphan": true, - "flow_status": "read_only", - "warn": true - }, { "name": "stock_fundamentals", "desc": "基本面数据(PE/PB)", @@ -1377,27 +1368,15 @@ "flow_status": "healthy", "warn": false }, - { - "name": "stock_monthly", - "desc": "月线行情", - "rows": 1232, - "readers": [], - "writers": [], - "has_input": false, - "has_output": false, - "orphan": true, - "flow_status": "orphan", - "warn": true - }, { "name": "stock_sectors", "desc": "股票行业映射", "rows": 62, "readers": [ - "mofin_db", - "strategy_lifecycle", - "xiaoguo_news_processor", "trend_detector", + "strategy_lifecycle", + "mofin_db", + "xiaoguo_news_processor", "mofin_news" ], "writers": [ @@ -1409,27 +1388,15 @@ "flow_status": "healthy", "warn": false }, - { - "name": "stock_weekly", - "desc": "周线行情", - "rows": 2060, - "readers": [], - "writers": [], - "has_input": false, - "has_output": false, - "orphan": true, - "flow_status": "orphan", - "warn": true - }, { "name": "stocks", "desc": "全量股票代码", "rows": 87, "readers": [ "mofin_db", - "trend_detector", + "xiaoguo_news_processor", "mofin_news", - "xiaoguo_news_processor" + "trend_detector" ], "writers": [ "mofin_db" @@ -1446,8 +1413,8 @@ "rows": 217, "readers": [ "mofin_db", - "verify_reassess_pipeline", - "system_audit" + "system_audit", + "verify_reassess_pipeline" ], "writers": [ "mofin_collect" @@ -1465,30 +1432,33 @@ "readers": [ "mofin_db" ], - "writers": [], - "has_input": false, + "writers": [ + "mofin_db", + "server" + ], + "has_input": true, "has_output": true, - "orphan": true, - "flow_status": "read_only", - "warn": true + "orphan": false, + "flow_status": "healthy", + "warn": false }, { "name": "todos", "desc": "自愈任务队列", "rows": 61, "readers": [ - "strategy-staleness-check", - "self_todo_executor", "morning_health_check", + "self_todo_executor", + "strategy-staleness-check", "intraday_health_check" ], "writers": [ - "strategy-staleness-check", "morning_health_check", "preflight_verify", - "mofin_collect", + "self_todo_executor", + "strategy-staleness-check", "intraday_health_check", - "self_todo_executor" + "mofin_collect" ], "has_input": true, "has_output": true, @@ -1501,16 +1471,16 @@ "desc": "自选股列表", "rows": 43, "readers": [ - "mofin_db", "mo_data", - "stock_quote", - "stale_push_wlin", - "price_monitor", - "mo_alphasift_bridge", - "stale_detector", - "run_all_tests", "trend_detector", - "mofin_collect" + "stale_detector", + "refresh_mtf_cache", + "mo_alphasift_bridge", + "mofin_db", + "stale_push_wlin", + "xiaoguo_scanner", + "run_all_tests", + "xiaoguo_signal_consumer" ], "writers": [ "mofin_db", @@ -1697,10 +1667,10 @@ { "name": "mofin_health.json", "desc": "健康监控数据", - "size_kb": 69.8, + "size_kb": 67.2, "readers": [], "writers": [], - "last_modified": "07-08 23:53", + "last_modified": "07-09 00:23", "warn": true }, { @@ -2008,7 +1978,7 @@ "script": "xiaoguo_tunnel_watchdog.sh", "schedule": "*/5 * * * *", "status": "error", - "last_run": "2026-07-09T00:17:46", + "last_run": "2026-07-09T00:22:51", "profile": "default" }, { @@ -2098,7 +2068,7 @@ "script": "", "schedule": "{'kind': 'cron', 'expr': '*/10 * * * *'}", "status": "ok", - "last_run": "2026-07-09T00:11:19", + "last_run": "2026-07-09T00:21:09", "profile": "default" }, {