feat: --retry-uncertain re-diagnoses uncertain rows; fix docstring
This commit is contained in:
@@ -106,21 +106,31 @@ class SqliteDiagnosisSignalStore:
|
||||
)
|
||||
self._conn.commit()
|
||||
|
||||
def done_question_ids(self, baseline_run_id: str, diag_fingerprint: str) -> set[str]:
|
||||
def done_question_ids(
|
||||
self,
|
||||
baseline_run_id: str,
|
||||
diag_fingerprint: str,
|
||||
*,
|
||||
retry_uncertain: bool = False,
|
||||
) -> set[str]:
|
||||
"""查询指定 run 与诊断指纹下已完成的 question_id 集合。
|
||||
|
||||
参数:
|
||||
baseline_run_id: baseline run 标识。
|
||||
diag_fingerprint: 诊断口径指纹。
|
||||
retry_uncertain: True 时追加 `AND tier != 'uncertain'`,把 uncertain
|
||||
(信号不可信降级)题排除出已完成集,令其被重新诊断;默认 False。
|
||||
|
||||
返回:
|
||||
已落盘信号的 question_id 集合;无匹配时为空集,供断点续跑跳过。
|
||||
"""
|
||||
cursor = self._conn.execute(
|
||||
sql = (
|
||||
"SELECT DISTINCT question_id FROM baseline_diagnosis"
|
||||
" WHERE baseline_run_id = ? AND diag_fingerprint = ?",
|
||||
(baseline_run_id, diag_fingerprint),
|
||||
" WHERE baseline_run_id = ? AND diag_fingerprint = ?"
|
||||
)
|
||||
if retry_uncertain:
|
||||
sql += " AND tier != 'uncertain'"
|
||||
cursor = self._conn.execute(sql, (baseline_run_id, diag_fingerprint))
|
||||
return {r["question_id"] for r in cursor.fetchall()}
|
||||
|
||||
def load(self, baseline_run_id: str, diag_fingerprint: str) -> list[DiagnosisSignalRow]:
|
||||
|
||||
Reference in New Issue
Block a user