restore main tree to deployed 3bafd30 (HEL-529 校准)

Revert the full revert 6f99ee9 so main's tree content is byte-identical
to 3bafd30, which is the commit currently deployed and healthy on the
8766 xiaobai-datahub container (image hel531-3bafd30). No history
rewrite, no force push; this is a normal forward commit on top of main.

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
总工
2026-09-15 15:03:14 +08:00
committed by 施工员2号
co-authored by multica-agent
parent 6f99ee9d9e
commit 78931f9c42
8 changed files with 826 additions and 219 deletions
+13 -5
View File
@@ -31,10 +31,18 @@ class AdminAPI:
)
is_open = bool(cal and int(cal["is_open"]) == 1)
pubs = self.db.fetchall("SELECT * FROM publications WHERE trade_date = ?", (today,))
failed = self.db.fetchall(
"SELECT * FROM batches WHERE trade_date = ? AND state IN ('failed','staged')",
(today,),
)
# HEL-529 fix 2: "待处理"只保留当前仍未恢复的最新异常。一条失败/停滞
# 批次若已被同数据集更晚的成功批次或当日发布解决,就不再是当前故障,
# 历史记录仍完整保留在 batches/audit 明细里,不在此重复展示。
latest_by_dataset: dict[str, dict[str, Any]] = {}
for row in self.db.fetchall("SELECT * FROM batches WHERE trade_date = ? ORDER BY started_at, batch_id", (today,)):
latest_by_dataset[row["dataset"]] = row
published_datasets = {row["dataset"] for row in pubs if row["state"] == "published"}
anomalies = [
row
for dataset, row in latest_by_dataset.items()
if dataset not in published_datasets and row["state"] in ("failed", "staged")
]
calls = self.db.fetchall(
"SELECT * FROM src_calls ORDER BY id DESC LIMIT 20",
)
@@ -45,7 +53,7 @@ class AdminAPI:
"eod_status": self.scheduler.eod_status(today),
"revision_status": self.scheduler.revision_status(today),
"publications": pubs,
"anomalies": failed,
"anomalies": anomalies,
"recent_calls": _public_calls(calls),
"source_count": len(self.db.fetchall("SELECT provider FROM src_health")),
}