fix(maintenance): list each prompt the Pair repair kept (#550)
The job counted its protected prompts but listed none, so Protected 2 opened
an empty group. The apply now returns one row per kept prompt with the
review's reasons, in its order ("Prompt 7: kept, pairs disagree on category:
Adult, asian"), and the job keeps them all for the report.
This commit is contained in:
+13
-1
@@ -697,7 +697,19 @@ class MaintenanceRoutesMixin:
|
||||
rows,
|
||||
complete=plan.operation in COMPLETE_RECORD,
|
||||
)
|
||||
job.record_counted("protected", payload["protected"])
|
||||
if "kept" in result:
|
||||
# #550: each kept record with its reason, like the changed ones.
|
||||
kept = [
|
||||
{
|
||||
"path": "",
|
||||
"detail": f"Prompt {item['prompt_id']}: kept, "
|
||||
+ "; ".join(item["reasons"]),
|
||||
}
|
||||
for item in result["kept"]
|
||||
]
|
||||
job.record_counted("protected", len(kept), kept, complete=True)
|
||||
else:
|
||||
job.record_counted("protected", payload["protected"])
|
||||
line = _changed_line(
|
||||
plan.operation, result["changed"], result.get("marks", 0), result
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user