Files
Nexus/docs/changelog/2026-05-23-phase3-audit-fixes.md
T
Your Name 61b891db73 fix: Phase 3 line-walk fixes (3a-3d)
F3a-01 agent.py: _safe_float() prevents ValueError from non-numeric metric values
F3b-01 schedule_runner.py: fix tz-aware minus naive DateTime TypeError
F3b-02 schedule_runner.py: cron field divided by 0 returns False instead of crash
F3c-01 redis/client.py: mask credentials in REDIS_URL log output
F3d-01 main.py: cancel background tasks when primary worker lock is lost
F3d-02 main.py: strip whitespace from CORS origins after split

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 15:37:15 +08:00

1.5 KiB
Raw Blame History

Phase 3 逐行走读修复

日期: 2026-05-23
批次: 3a(安全核心)、3bbackground)、3c(基础设施)、3dmain/middleware

修复清单

ID 文件 说明 修复
F3a-01 agent.py:97-102 P2 float(cpu/mem/disk) 对非数字 Agent 数据 → ValueError/500 提取 _safe_float() 包裹转换,非数字值 WARNING 级跳过
F3b-01 schedule_runner.py:84 P1 nowtz-aware- last_run_atMySQL naive)→ TypeError → 已跑调度永远失败 统一去除 tzinfo 后再减
F3b-02 schedule_runner.py:47 P3 cron */0 → ZeroDivisionError step==0 时返回 False 跳过
F3c-01 redis/client.py:49 P2 Redis URL 含 auth 时密码写入日志 启动日志脱敏(user:**@host
F3d-01 main.py:116-118 P2 primary lock 丢失时续锁退出,后台任务继续双跑 lock 丢失时 cancel 所有后台任务
F3d-02 main.py:344 P2 CORS origins 不去除空格 o.strip() 过滤

审查结论

批次 覆盖 结论
3a auth_jwt.py、webssh.py、crypto.py、agent.py、dependencies.py 1 BUG 修复;安全核心均正确
3b heartbeat_flush、retry_runner、schedule_runner、self_monitor 2 BUG 修复;整体逻辑正确
3c engine_compat.py、session.py、redis/client.py 1 日志脱敏;新增文件无安全问题
3d main.py 2 BUG 修复;中间件注册顺序正确