With increasing document management capability (AttachmentsUnderRevisionControl) we are likely to face more issues of topics and attachments getting out of synch. Ideally we'd have a design where this wasn't possible, but TWiki in its current form is similar to many commercial systems e.g. Documentum, in having this issue. I propose:
library functions to check match between topic attachment information, the attachments and the history repository
library functions to do fixes
command line and/or cgi tools for doing verification and fix