chore: format Phase B modules and register Phase B plan in wiki
This commit is contained in:
@@ -457,16 +457,20 @@ class QuestionGenStore:
|
||||
created_at=datetime('now')
|
||||
""",
|
||||
(
|
||||
question_id, question_hash, stage, round, agent_prediction,
|
||||
question_id,
|
||||
question_hash,
|
||||
stage,
|
||||
round,
|
||||
agent_prediction,
|
||||
None if agent_correct is None else int(agent_correct),
|
||||
verdict, pair_id, agent_config,
|
||||
verdict,
|
||||
pair_id,
|
||||
agent_config,
|
||||
),
|
||||
)
|
||||
self._conn.commit()
|
||||
|
||||
def completed_stages(
|
||||
self, question_id: str, question_hash: str, agent_config: str
|
||||
) -> set[str]:
|
||||
def completed_stages(self, question_id: str, question_hash: str, agent_config: str) -> set[str]:
|
||||
"""返回该题在当前 hash+config 下已完成的 stage 集合(续跑用)。
|
||||
|
||||
Parameters
|
||||
@@ -501,8 +505,7 @@ class QuestionGenStore:
|
||||
当前 agent 配置指纹;保留该 config 行,其余全部删除。
|
||||
"""
|
||||
self._conn.execute(
|
||||
"DELETE FROM adversarial_verdicts "
|
||||
"WHERE question_id=? AND agent_config!=?",
|
||||
"DELETE FROM adversarial_verdicts WHERE question_id=? AND agent_config!=?",
|
||||
(question_id, agent_config),
|
||||
)
|
||||
self._conn.commit()
|
||||
@@ -521,15 +524,12 @@ class QuestionGenStore:
|
||||
该轮 stage='cheat' 的 agent_correct 平均值;无数据时返回 0.0。
|
||||
"""
|
||||
row = self._conn.execute(
|
||||
"SELECT AVG(agent_correct) FROM adversarial_verdicts "
|
||||
"WHERE stage='cheat' AND round=?",
|
||||
"SELECT AVG(agent_correct) FROM adversarial_verdicts WHERE stage='cheat' AND round=?",
|
||||
(round_no,),
|
||||
).fetchone()
|
||||
return float(row[0]) if row and row[0] is not None else 0.0
|
||||
|
||||
def final_passed_question_ids(
|
||||
self, hash_by_qid: dict[str, str], agent_config: str
|
||||
) -> set[str]:
|
||||
def final_passed_question_ids(self, hash_by_qid: dict[str, str], agent_config: str) -> set[str]:
|
||||
"""在当前 hash+config 下通过两门的 question_id 集合(final JSON 全量重建用)。
|
||||
|
||||
终判规则(防 stale 泄漏):仅当该题在 **当前 question_hash + 当前
|
||||
@@ -559,9 +559,7 @@ class QuestionGenStore:
|
||||
).fetchall()
|
||||
if not rows:
|
||||
continue
|
||||
cheat_passed = any(
|
||||
stage == "cheat" and verdict == "passed" for stage, verdict in rows
|
||||
)
|
||||
cheat_passed = any(stage == "cheat" and verdict == "passed" for stage, verdict in rows)
|
||||
no_flip = any(verdict == "filtered_no_flip" for _, verdict in rows)
|
||||
if cheat_passed and not no_flip:
|
||||
passed.add(qid)
|
||||
|
||||
Reference in New Issue
Block a user