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: