Bläddra i källkod

refactor: context_manager 低分告警兼容 v6 severity_counts

lingfengQAQ 2 månader sedan
förälder
incheckning
dba022e48a
1 ändrade filer med 6 tillägg och 2 borttagningar
  1. 6 2
      webnovel-writer/scripts/data_modules/context_manager.py

+ 6 - 2
webnovel-writer/scripts/data_modules/context_manager.py

@@ -310,12 +310,16 @@ class ContextManager:
         low_score_ranges: List[Dict[str, Any]] = []
         for row in review_trend.get("recent_ranges", []):
             score = row.get("overall_score")
-            if isinstance(score, (int, float)) and float(score) < 75:
+            notes = row.get("notes", "")
+            has_blocking = "blocking=" in notes and "blocking=0" not in notes
+            is_low_score = isinstance(score, (int, float)) and float(score) < 75
+            if is_low_score or has_blocking:
                 low_score_ranges.append(
                     {
                         "start_chapter": row.get("start_chapter"),
                         "end_chapter": row.get("end_chapter"),
-                        "overall_score": score,
+                        "overall_score": score if isinstance(score, (int, float)) else 0.0,
+                        "notes": notes,
                     }
                 )