You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the non-BISAC nonfiction reset re-runnable (PP-5129)
Migration 52d1bbdd4671 repairs subjects that were stored as nonfiction
because an unresolvable BISAC code fell through the ruleset catch-all.
It only sets checked=false; the re-scoring happens later, in
classify_unchecked_subjects.
That leaves a window. If old code reaches those subjects first -- a
still-running scripts server, or a host that redeploys itself via
watchtower or ECS/Fargate auto_restart -- it re-scores them under the
superseded rules and re-stamps checked=true. The reset is consumed
rather than lost, so nothing errors, nothing retries, and no later run
revisits them. The repair quietly did nothing, having paid for a full
reindex. Raised in review on #3726; it is not preventable from inside
the migration, so make it recoverable instead.
Adds reset_non_bisac_nonfiction_subjects, a Celery task that re-applies
the reset, with ResetNonBisacNonfictionSubjectsScript and
bin/work_reset_non_bisac_nonfiction_subjects to queue it -- the same
three layers as reclassify_null_audience_works, which repairs the
sibling audience defect.
The task resets only. Re-scoring stays with classify_unchecked_subjects,
which picks these subjects up on its next nightly run and can be
triggered immediately through bin/work_classify_unchecked_subjects. One
task, one job, and no large reindex fired the moment someone runs the
repair.
The selection lives on BISACClassifier as contradicts_stored_fiction, so
the migration and the task cannot disagree about which rows are
affected. Both already import the classifier, so this adds no coupling
that was not there, and it puts the definition with the code that owns
the answer. The migration is updated to use it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments