agent/9e1b957d4ba4-chat-models
docs/planning/social.md US-4, task 6: conversations, conversation_participants, messages (DM + world/room chat), and message_reports, following app/models/social.py's conventions (native enums, explicit index/constraint names, CASCADE FKs where appropriate). Delete behavior, chosen per-relationship: - conversations.user_a_id/user_b_id -> CASCADE: a DM is meaningless with one of its two participants gone, so it cascades away entirely (participants + messages with it). - messages.sender_id -> SET NULL: world/room chat history and reported messages must survive the sender's account being deleted, matching the existing actor-reference convention (WorldChunk.updated_by_id, WorldChunkRevision.actor_id). - messages.world_id/room_id -> CASCADE: chat scoped to a world/room has no meaning once that world/room is gone (mirrors WorldChunk). - message_reports.message_id -> SET NULL (not CASCADE): a moderation report must outlive the message it's about, mirroring WorldChunkRevision's audit-trail-survives-deletion precedent. - message_reports.reporter_id/moderator_id -> SET NULL: audit-actor references, same reasoning. Models + migration only, no endpoints, no text filtering (sibling tasks). Verified: migration upgrade/downgrade/upgrade round-trip against a real Postgres with schema inspected via \d against spec; new model tests cover DM creation, pair uniqueness + ordering check constraint, world/room messages, report defaults, and cascade behavior for both conversation-deletion and sender-deletion; full backend suite (160 tests) passes with no regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2FESCaMXeJpC9gSctiEeD
agp-game
Agentic Game Platform - Godot game built by autonomous agents
Description
Languages
GDScript
57.2%
Python
42.3%
Shell
0.5%