From 44d0a435a0257eeaaaacddf6a422df00530f0a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Sat, 27 Jun 2026 02:08:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AE=A1=E9=81=93=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=A1=A8=E8=87=AA=E5=8F=91=E7=8E=B0+=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E7=BB=84=E4=BB=B6=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 自动发现:对比重要脚本列表和管道注册表 - 漏登记的不但要手动注册,体检会报"N个组件未注册管道" - 逼着新增组件时把数据流定义进pipeline_registry.json --- scripts/morning_health_check.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/scripts/morning_health_check.py b/scripts/morning_health_check.py index 594cd4a..4e83bb5 100755 --- a/scripts/morning_health_check.py +++ b/scripts/morning_health_check.py @@ -611,13 +611,39 @@ def run_check(item): elif check_spec == "pipeline:registry_audit": ok = True gaps = [] + unregistered = [] try: import json as j2 reg = j2.loads(open(str(DATA / "pipeline_registry.json")).read()) for p in reg.get("pipelines", []): if not p.get("verified"): gaps.append(p["name"]) - if gaps: + + # 自动发现:对比cron脚本列表和注册表,漏登的报警 + known_sources = set() + for p in reg.get("pipelines", []): + src = p.get("source", "") + for s in ["morning_health_check", "intraday_health_check", "strategy_review", + "xiaoguo_scanner", "xiaoguo_signal_consumer", "data_governance", + "price_monitor", "stale_push_wlin", "per_stock_reassess", + "macro_context_collector", "divergence_detector", "macro_signal_consumer", + "self_todo_executor", "strategy_evaluator", "hk_rate"]: + if s in src: + known_sources.add(s) + # 检查是否有重要脚本未出现在任何管道定义中 + all_scripts = ["morning_health_check", "intraday_health_check", "strategy_review", + "xiaoguo_scanner", "xiaoguo_signal_consumer", "data_governance", + "price_monitor", "stale_push_wlin", "per_stock_reassess", + "macro_context_collector", "divergence_detector", "macro_signal_consumer", + "self_todo_executor", "strategy_evaluator"] + for s in all_scripts: + if s not in known_sources: + unregistered.append(s) + + if unregistered: + ok = False + detail = f"{len(gaps)}条未验证 + {len(unregistered)}个组件未注册管道" + elif gaps: ok = False detail = f"{len(gaps)}条管道未验证: {', '.join(gaps[:5])}" else: