@@ -956,11 +956,8 @@ def record_review_finding(
956956def _apply_accept (finding : dict , caption : str = None ) -> None :
957957 """Write the accepted caption as a new revision for a finding's media.
958958
959- The finding's fix is merged into the *live* caption
960- (:func:`src.caption_judge.apply_fix`), never written verbatim: accepting
961- a second finding must not resurrect the run-time caption and erase the
962- first accept (or a manual edit made since the run). An explicit
963- ``caption`` (inline edit before accept) still wins as-is.
959+ The fix is merged into the *live* caption (never written verbatim) so a
960+ second accept keeps the first; an explicit ``caption`` wins as-is.
964961 """
965962 type_row = store .get_caption_type (finding ["caption_type_id" ])
966963 caption_type = type_row ["name" ] if type_row else ""
@@ -980,8 +977,7 @@ def _apply_accept(finding: dict, caption: str = None) -> None:
980977 finding ["id" ], store .STATUS_ACCEPTED , applied_caption = final
981978 )
982979 # Rebase the media's other pending findings onto the new caption: their
983- # "original" then shows this accept applied, and their proposal is the
984- # same fix re-applied on top — the next accept diffs against reality.
980+ # "original" shows this accept applied, their proposal the fix on top.
985981 for sibling in store .pending_for_media (
986982 finding ["dataset_id" ],
987983 finding ["media_id" ],
@@ -996,10 +992,7 @@ def _apply_accept(finding: dict, caption: str = None) -> None:
996992def decide_review_finding (
997993 finding_id : int , action : str , caption : str = None
998994) -> dict :
999- """Accept (write a new revision) or reject one finding; return it.
1000-
1001- ``caption`` overrides the proposed text (an inline edit before accept).
1002- """
995+ """Accept (``caption`` = inline-edit override) or reject one finding."""
1003996 finding = store .get_finding (finding_id )
1004997 if finding is None :
1005998 return {}
@@ -1050,6 +1043,20 @@ def accept_rule_fixes(dataset_ref, rule_id: int) -> int:
10501043 return len (findings )
10511044
10521045
1046+ def reject_all_findings (dataset_ref ) -> int :
1047+ """Reject every pending finding of a dataset; return the count."""
1048+ dataset_id = _dataset_id (dataset_ref )
1049+ return 0 if dataset_id is None else store .reject_all_pending (dataset_id )
1050+
1051+
1052+ def clear_review_history (dataset_ref ) -> int :
1053+ """Delete the dataset's decided findings (history); return the count."""
1054+ dataset_id = _dataset_id (dataset_ref )
1055+ if dataset_id is None :
1056+ return 0
1057+ return store .clear_decided_findings (dataset_id )
1058+
1059+
10531060def media_path (dataset_ref , key : str ) -> str | None :
10541061 """Return the effective media file path for a key, or None when unset.
10551062
0 commit comments