Delete superseded refine reminders in the PR sweep

Merged
JS
7d ago
+236-15

The PR sweep left several "Some review comments on this pull request are not settled yet" reminders on a PR that still had open threads (#561 carried four). Only the review that posts a new reminder deleted the older ones, and the sweep deleted reminders only once every thread was resolved, so copies posted before that cleanup existed stayed forever. The sweep now lists every viewer reminder but the newest as superseded, and apply-pr-actions.sh re-reads the PR's live comments before deleting one: a copy that is already gone is reported as already done, and one that has become the only reminder is kept.

Verified with python3 -m unittest tests.test_skill_scripts (229 tests, new cases for ordering by time, a single reminder, another author's comment, the 100-comment window, and a refused delete), shellcheck, ruff and scripts/check-skill-refs.py. Run live on the repository, the refined sweep found and deleted five leftover reminders (#110, #295 twice, #584, #597). Codex, Agy and a Claude reviewer found no blocking issue; their findings on the live re-check, ordering and the comment window are fixed here.

Not changed: a PR with more than 100 comments still gets no cleanup, as before, and the three places that match "the viewer's reminder" (the sweep, the apply step and review-finish.sh) still spell the match separately.


Summary by cubic

Fixes leftover "Some review comments on this pull request are not settled yet" reminders stacking up on PRs that still have open threads.

The PR sweep now marks every refine reminder but the newest as superseded and deletes the superseded ones, while apply-pr-actions.sh re-reads the PR's live comments for each row so a concurrent review can't leave the PR with no current reminder. Copies that are already gone or have become the newest are reported or kept without error.

  • Adds why: to refine_stale entries to distinguish superseded from settled deletions.
  • Adds unit tests covering ordering by time, a single reminder, other authors' comments, the 100-comment window, and refused deletes.
  • On PRs with more than 100 comments or threads, cleanup is still skipped as before.