Keep top human/machine legacy categories below 0.5 for privacy blocking

The portal blocks images whose top ICU category is human or machine for non-admins. With the 0.5 threshold, 103 such images would have lost their detection and become visible. Those categories are now migrated when they were the image's top category, regardless of score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dom
2026-10-16 22:15:12 +02:00
co-authored by Claude Opus 5.5
parent ed105fbff8
commit 39b22f0124
3 changed files with 22 additions and 5 deletions
+2
View File
@@ -54,6 +54,8 @@ class StepFiles(unittest.TestCase):
det = steps["detection"]
self.assertIn("c.score >= 0.5", det)
self.assertIn("NOT IN ('', 'none')", det)
self.assertIn("c.category IN ('human', 'machine')", det)
self.assertIn("c.category IN ('human', 'machine')", ml.DETECTION_FILTER)
def test_dedupe_steps(self):
steps = dict(ml.load_steps("003_dedupe_gundi_twins.sql"))