Record deleted messages and let moderators restore them (0.3.0) #11
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 199 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.317
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11"
general
weight: 0.35
BenA-SA
Why
Deleting a message blanked it and dropped its mentions and references, with no record of what it said or who deleted it, and no way to undo it. Comply 100 lets Senior Oversight delete other people's messages. They need to confirm who deleted what, thread replies included, and undo mistakes.
What (ADR-0012)
MessageDeletion: one row per deletion, holding the original encoded body, the mentioned user ids, the reference rows,deleted_by/deleted_atandrestored_by/restored_at. Migration0003.ChatService.delete_message()writes the row in the same transaction and returns it. The message is still blanked, so no read path can show deleted text.ChatService.restore_message(user, message)undoes the latest deletion. The body, mentions and references come back, nobody is notified again, and viewers get the normaleditedbroadcast.can_restore_messageandcan_view_deletions. The default for both is whoever manages the channel.message_deletedandmessage_restored, plushuddle.message.deleted/restoredlog lines.MessageDeletion.objects.in_channels(channels)and.unrestored().Tests
tests/test_deletion_audit.py(8 tests):- what a deletion records, including who deleted it and the signal;
- thread replies;
- restoring text, mentions and references;
- permission checks;
- nothing to restore;
- two delete/restore cycles.