feat(comments,admin): preserve deleted comment threads and add admin reports
Implement two significant changes to improve content moderation and thread integrity:
1. Admin Reports System
- Add off-protocol content reporting for serious issues (CSAM, doxing, etc.)
- New endpoint: POST /xrpc/social.coves.admin.submitReport
- Rate limited to 10 requests/minute, requires OAuth authentication
- Full stack: handler, service, repository, and database migration
2. Preserve Deleted Comment Thread Structure
- Deleted comments now appear as "[deleted]" placeholders instead of being hidden
- Comment counts are preserved on deletion to maintain accurate thread totals
- Nested replies now properly increment root post's comment_count
- Improved resurrection handling to avoid double-counting when same parent
3. Error Handling Improvements
- serializeOptionalFields() now returns errors instead of silently ignoring failures
- Reconciliation failures now roll back transactions (previously just logged warnings)
- Post consumer uses errors.Is() for proper error type checking
Changes:
- Add internal/api/handlers/adminreport/* for report submission
- Add internal/core/adminreports/* for domain logic and errors
- Add internal/db/postgres/admin_report_repo.go for persistence
- Add migration 028_create_admin_reports_table.sql
- Update comment_consumer.go to preserve counts on delete
- Update comment_repo.go to include deleted comments in queries
- Update post_consumer.go error handling and nested reply counting
- Update tests to verify new placeholder behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>