fix(nas): NAS 监控两检语义修——dmsk 事件驱动域 mtime 阈值放宽 80h(两日 lane exit=0 而 mtime 48h+实证)/vps-mirror 班前查昨日 DONE(早班查当日必空假黄) [nas]
CI/CD / test (push) Failing after 7s
CI/CD / nas-deploy (push) Has been skipped
CI/CD / nas-verify (push) Has been skipped

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-09-26 07:48:54 +08:00
parent 866a5b7cd7
commit 2f78b57c95
+8 -5
View File
@@ -93,9 +93,10 @@ def build_checks(now):
add(f"nas-corpus_{lane}", f"corpus {lane} 新鲜",
freshness(age, 34), {"age_h": round(age, 1) if age is not None else None})
# dmsk 三表 dt 分区(07:10 班)
# dmsk 三表 dt 分区(07:10 班)——事件驱动域: 无新披露不写盘(09-26 实证两日
# lane exit=0 而 mtime 48h+), mtime 弱信号, 阈值放宽到 80h(漏两个日窗才黄)
age = dir_age_hours(DMSK_ROOT, now)
add("nas-dmsk", "dmsk 三表分区新鲜", freshness(age, 34),
add("nas-dmsk", "dmsk 三表分区新鲜", freshness(age, 80),
{"age_h": round(age, 1) if age is not None else None})
# hot_rank: 昨交易日文件 + .pushed marker + 当日 cron.log FAIL 行
@@ -113,13 +114,15 @@ def build_checks(now):
add("nas-hot_rank-log", "hot_rank 日志无 FAIL",
"yellow" if log_fail else "green", {"fail_today": log_fail})
# vps-mirror 当日 DONE 且 fail=0(本监控挂其班尾, 查的是刚结束这班)
# vps-mirror 完成度: >=17:00 查当日 DONE fail=0; 班前(16:00 未到)查昨日
# (09-26 实证: 早班查当日必空=假黄)
want_day = now.strftime("%Y-%m-%d") if now.hour >= 17 else \
(now - dt.timedelta(days=1)).strftime("%Y-%m-%d")
mirror_ok = False
try:
with open(os.path.join(MIRROR_DIR, "push.log"), encoding="utf-8",
errors="replace") as fh:
lines = [l for l in fh.read().splitlines()
if now.strftime("%Y-%m-%d") in l]
lines = [l for l in fh.read().splitlines() if want_day in l]
mirror_ok = any("vps-mirror DONE" in l and "fail=0" in l
for l in lines[-20:])
except OSError: