feat: 数据管道注册表+宏观风险集成+管道完整性审计

1. 新增 data/pipeline_registry.json — 数据管道注册表
   - 记录每条数据流的source→consumer→end_user
   - verified字段标记是否验证通过
   - 新增组件时必须在此注册,否则体检会报未验证

2. 宏观预警集成(修复管道缺口)
   - intraday_health_check: 读macro_risk_state.json,HIGH风险时报警
   - morning_health_check: 新增管道注册表审计项
     读pipeline_registry.json,未验证的管道标为异常

3. 管道完整性自发现机制
   注册表中verified=false的管道会在每日体检中标记
   逼迫新增组件时注册管道,否则睡不好觉
This commit is contained in:
知微
2026-06-27 02:04:22 +08:00
parent b4f957f80d
commit 120f35671d
2 changed files with 33 additions and 1 deletions
+16
View File
@@ -118,6 +118,22 @@ def check_signal_pipeline():
pass
log(unproc < 30, f"信号堆积: {unproc}条未处理(需<30")
# 宏观风险状态检查
try:
risk_path = DATA / "macro_risk_state.json"
if risk_path.exists():
risk = json.loads(risk_path.read_text())
level = risk.get("level", "none")
reason = risk.get("reason", "")
if level == "high":
log(False, f"🔴 宏观风险HIGH: {reason[:80]}")
elif level == "medium":
log(True, f"⚠️ 宏观风险MEDIUM: {reason[:80]}")
else:
log(True, "无宏观风险状态文件(可能未生成)")
except:
pass
def write_todos():
if not ISSUES: