From d89351fbfe54db334916f538f03ecb5cb9c4d225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Sat, 27 Jun 2026 02:19:12 +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=8A=A8=E4=BF=AE=E5=A4=8D=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=96=B0=E7=BB=84=E4=BB=B6=E8=87=AA=E5=8A=A8=E7=99=BB=E8=AE=B0?= =?UTF-8?q?=E5=8D=A0=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 未注册脚本不再只报警——体检自动在pipeline_registry.json中 添加占位记录(verified=false, gap=自动发现待确认)。 Dad不需要做任何事,系统自愈。 --- scripts/morning_health_check.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/morning_health_check.py b/scripts/morning_health_check.py index b2e4b8e..518c7f8 100755 --- a/scripts/morning_health_check.py +++ b/scripts/morning_health_check.py @@ -646,7 +646,27 @@ def run_check(item): if unregistered: ok = False - detail = f"{len(gaps)}条未验证 + {len(unregistered)}个组件未注册管道" + detail = f"{len(gaps)}条待验证 + {len(unregistered)}个新组件未注册" + # 自动修复:把未注册的脚本加入注册表(占位) + try: + for s in unregistered: + reg["pipelines"].append({ + "id": f"auto-{s}", + "name": f"{s}(自动发现)", + "source": f"{s}.py (自动发现)", + "consumer": "未知(需确认)", + "end_user": "未知(需确认)", + "verified": False, + "verified_at": None, + "gap": "自动发现的组件,数据流待确认", + "fix": "手动编辑pipeline_registry.json完善此项", + "deadline": "发现后3天内" + }) + open(str(DATA / "pipeline_registry.json"), 'w').write( + j2.dumps(reg, ensure_ascii=False, indent=2)) + detail += f" → 已自动添加{len(unregistered)}条占位记录" + except Exception: + pass elif gaps: ok = False detail = f"{len(gaps)}条管道未验证: {', '.join(gaps[:5])}"