mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-20 22:22:00 +00:00
复核把「首稿没过、重写后已通过」当缺口:report_repair、report_rewrite 这类「改过一次」的信号按同一个报告节点最后一次 report.checked 定档——最终通过的(没有违规;裁判摘要里不再有证据不支持的句子)不进复核的异常清单,复核模型被别的信号叫起来时,说明里另起一节「已经处理好的」写「报告「x」首稿有 N 处没过核对,重写后已全部通过」,不再写成「核对仍未全部通过、可能不准」;最终没过的照旧记缺口。report_repair、report_rewrite 的日志带上处数
This commit is contained in:
@@ -791,7 +791,7 @@ async def run_report(state: GraphState, ctx: NodeContext) -> dict[str, Any]:
|
||||
while (blocking := _blocking(doc["violations"], numbers)) and repairs < max_repairs \
|
||||
and not (repairs and not _fatal(blocking)):
|
||||
repairs += 1
|
||||
ctx.emit(EventType.LOG, level="warn", code="report_repair",
|
||||
ctx.emit(EventType.LOG, level="warn", code="report_repair", count=len(blocking), attempt=repairs,
|
||||
message=f"报告有 {len(blocking)} 处未通过核对({_named(blocking)}),"
|
||||
f"已要求模型重写(第 {repairs} 次)")
|
||||
messages = [*messages, response, HumanMessage(content=_repair_request(blocking, failed_rule))]
|
||||
@@ -979,7 +979,7 @@ async def _judge_inline(ctx: NodeContext, doc: dict[str, Any], catalog: dict[str
|
||||
if judge_cfg["rewrite_once"] and bad:
|
||||
texts = judging.unit_texts(doc)
|
||||
sentences = [(texts.get(uid, ""), _rewrite_reason(outcome["verdicts"][uid])) for uid in bad]
|
||||
ctx.emit(EventType.LOG, level="warn", code="report_rewrite",
|
||||
ctx.emit(EventType.LOG, level="warn", code="report_rewrite", count=len(bad),
|
||||
message=f"裁判认为 {len(bad)} 句结论证据不支持({_named([{'text': t} for t, _ in sentences])}),"
|
||||
"已退回写作模型仅修改这几句")
|
||||
again, raw = await draft([*messages, HumanMessage(content=_rewrite_request(sentences))])
|
||||
|
||||
Reference in New Issue
Block a user