File size: 2,494 Bytes
067623d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- a/core/benchmark.py
+++ b/core/benchmark.py
@@ -207,10 +207,15 @@
     Considers different criteria sets for standard/drafting vs analysis tasks.
     Averages scores for allowed criteria within a task first, then averages these task scores.
     Returns (average_score, error_message).
     """
-    # Define the specific criteria to include for standard/drafting tasks
-    STANDARD_ALLOWED_RUBRIC_CRITERIA = {
+    # Define the specific criteria to include for standard/drafting tasks.
+    # [JA-PATCH Fix-B1] Load from file instead of hardcoding so that the allowed
+    # set always matches whatever keys are in the criteria file (English keys when
+    # running the Japanese edition).
+    # The scoring subset intentionally excludes style markers (boundary_setting,
+    # moralising, sycophantic, etc.) – we keep only the EQ-positive criteria.
+    _EQ_POSITIVE_CRITERIA = {
         "demonstrated_empathy",
         "pragmatic_ei",
         "depth_of_insight",
         "social_dexterity",
@@ -218,10 +223,31 @@
         "message_tailoring",
         "theory_of_mind",
         "subtext_identification",
         "intellectual_grounding",
-        "correctness"
+        "correctness",
     }
+    try:
+        with open(C.STANDARD_RUBRIC_CRITERIA_FILE, 'r', encoding='utf-8') as _f:
+            _file_criteria = {
+                l.strip() for l in _f
+                if l.strip() and not l.strip().startswith('#')
+            }
+        # Intersect file keys with the known EQ-positive set so we never
+        # accidentally include style markers even if the file changes.
+        STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA & _file_criteria
+        if not STANDARD_ALLOWED_RUBRIC_CRITERIA:
+            logging.warning(
+                "[JA-PATCH] STANDARD_RUBRIC_CRITERIA_FILE yielded no EQ-positive "
+                "criteria – falling back to hardcoded set."
+            )
+            STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA
+    except Exception as _e:
+        logging.warning(
+            f"[JA-PATCH] Could not load standard rubric criteria file: {_e} "
+            "– falling back to hardcoded set."
+        )
+        STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA
     # Define the specific criteria to include for analysis tasks
     # Assumes analysis criteria are loaded from ANALYSIS_RUBRIC_CRITERIA_FILE
     # We need to load them here or pass them in. Let's load them.
     analysis_criteria = []