Audit batch 4: I-6 whitespace audit format, I-7 explicit non-sub2api capability gate, I-8 coord gate attribution, I-10 checked gates, I-11 gate-without-finding escalate, I-13 structured-first classification
This commit is contained in:
1 parent
06e4e16bbb
commit
cdac8039b3
5 files changed
+959
-47
No files matched your search
+16
-5
@@ -60,7 +60,16 @@ _DETAIL_RE = re.compile(
|
||||
r"^(?P<task_id>\S+)\s+tier=(?P<tier>\S+)\s+source=(?P<source>\S+)"
|
||||
r"\s+applied=(?P<applied>\S+)"
|
||||
r"(?:\s+suggested=(?P<suggested>\S+))?"
|
||||
r"(?:\s+chosen=(?P<chosen>\S+))?\s*$")
|
||||
# Audit batch 4 (I-6): chosen is the LAST field, so it may
|
||||
# greedily run to end of line — a legacy chosen model name
|
||||
# containing whitespace ("my model") now parses instead of
|
||||
# dropping the whole row. suggested stays \S+ (it is a middle
|
||||
# field); new policy models cannot contain whitespace (the
|
||||
# batch-4 policy whitelist drops them), so new rows always
|
||||
# parse, and legacy suggested-with-whitespace rows still land
|
||||
# in the unparseable bucket (counted, batch 2) rather than
|
||||
# being silently lost.
|
||||
r"(?:\s+chosen=(?P<chosen>.+?))?\s*$")
|
||||
|
||||
|
||||
def parse_worker_routing_detail(detail):
|
||||
@@ -70,9 +79,11 @@ def parse_worker_routing_detail(detail):
|
||||
A ``-`` placeholder also means None, never a model named "-".
|
||||
Audit batch 2 (I-1): 解析语义本身不变(失败仍返回 None),
|
||||
但 evaluate_shadow 不再静默跳过:不可解析的行计入
|
||||
dropped_rows["unparseable"],报告里可见(例如模型名含
|
||||
空白会使整行匹配失败,见 M7——行不再无声消失,只是
|
||||
不计为样本)。
|
||||
dropped_rows["unparseable"],报告里可见。
|
||||
Audit batch 4 (I-6): chosen 是行尾字段,含空白的
|
||||
legacy chosen 模型名现在能解析(见 _DETAIL_RE 注释);
|
||||
suggested 仍要求无空白,legacy suggested 含空白的行
|
||||
仍进 unparseable 桶计数,不静默消失。
|
||||
"""
|
||||
if not isinstance(detail, str):
|
||||
return None
|
||||
@@ -89,7 +100,7 @@ def parse_worker_routing_detail(detail):
|
||||
"source": match.group("source"),
|
||||
"applied": applied,
|
||||
"suggested_model": None if suggested in (None, "-") else suggested,
|
||||
"chosen_model": None if chosen in (None, "-") else chosen,
|
||||
"chosen_model": None if chosen in (None, "-") else chosen.strip(),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user