You are correct - the SQL is visible in the ‘official’ badges and that is what it does. It also is set up to deliberately let the ‘lesser’ trust level badges hang around.
For example, here is the SQL for TL3:
SELECT u.id user_id, current_timestamp granted_at FROM users u
WHERE trust_level >= 3 AND (
:backfill OR u.id IN (:user_ids)
)
As you can’t edit the SQL on ‘official’ badges, my workaround was to simply clone each official badge and change the >= to simply =. This ensures that only one badge is given (at least once the old one has been revoked overnight).
I see now that this might be your actual problem - that the Titles remain on folk after they have lost their trust levels (and badges once revoked on the daily SQL check). I haven’t looked at this in detail to try and repro it, but have you unchecked “Allow badge to be used as title” for those?
I note that this is sorted on the new User Card experiment here in Meta
:
That pretty much deals with the issue from my perspective. But it would be nice if it was also sorted on the /u/username/summary.
P.S.
I’ve edited the title of the OP to reflect the focus more tightly. Had moved it to Contribute > Feature but then realised that we aren’t actually clear on that (yet) - keep going!
