feat: social layer — messaging, Hire/Visit relationships, contacts, notifications#204
Open
feat: social layer — messaging, Hire/Visit relationships, contacts, notifications#204
Conversation
Based on origin/main (entity_id-clean base). Social system: - messaging/ module: MessagingService, Supabase-backed messages/chat_members/relationships - relationships: Hire/Visit state machine, request/approve/reject/upgrade/revoke/downgrade - contacts: GET/POST/DELETE /api/contacts → Supabase (multi-user) - notifications: NotificationBell, real-time pending approval - frontend: ContactsPage, AgentProfileSheet, AgentPublicPage, ChatsLayout badges Entity removal (no backward compat): - entity_id eliminated from all social contexts - Human identity: user_id = member_id (no entity indirection) - Agent identity: member_id (per-agent, not per-thread) - sender_entity_id → sender_id, mentioned_entity_ids → mentioned_ids - entity_ids → user_ids in chat creation - ContactRow owner/target_entity_id → owner_id/target_id - get_current_entity_id removed from dependencies.py - auth response no longer returns entity_id - contacts moved from SQLite → Supabase - EntityRow/EntityRepo retained for thread-layer only
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
- Restore origin/main service files (task_service, cron_service, resource_service) to preserve make_panel_task_repo / make_cron_job_repo / make_sandbox_monitor_repo interfaces - Restore origin/main test files (62 files) to preserve proper pytest.skip guards for pre-existing failures (FakeProvider missing volume, thread_config_repo removed, etc.) - Fix ruff: add noqa E402/E501/N803/N806/N815/N811 for pre-existing violations, add per-file-ignores for long SQL/prompt strings - Fix F821: add LOCAL_WORKSPACE_ROOT import in threads.py, add datetime/timezone imports in messaging_repo.py, fix user_id param in chat_tool_service.py - TypeScript: 0 errors
- pyproject.toml: restore origin/main deps (fastapi, uvicorn, ruff, pytest-timeout) - lifespan: guard messaging Supabase init with env var check (CI-safe) - frontend/api/types.ts: re-add social types (Relationship, Contact, AgentProfile, MessageStatus, MessageType, RelationshipState); update ChatMessage interface - frontend: add @supabase/supabase-js to package.json - frontend/api/client.ts: restore origin/main version (InviteCode, fetchInviteCodes etc.)
- ruff format: reformat 109 test files restored from origin/main - NotificationBell, RelationshipPanel: supabase?.removeChannel (null-safe) - ChatConversationPage: add message_type/signal/retracted_at to optimistic ChatMessage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/contacts: GET/POST/DELETE → Supabase (multi-user, replaces SQLite)/a/:memberIdpublic profile, no auth requiredmessage_readssubscription)Breaking changes
Entity concept removed from all social contexts (no backward compat):
sender_entity_idsender_idmentioned_entity_idsmentioned_idsentity_ids(chat create)user_idsContactRow.owner_entity_idowner_idContactRow.target_entity_idtarget_idget_current_entity_idauth response.entity_idHuman identity:
user_id = member_id(no entity indirection)Agent identity:
member_id(per-agent, not per-thread)EntityRow/EntityReporetained for thread-layer addressing only.Supabase schema
All tables already exist:
contacts(owner_id, target_id, relation, created_at, updated_at)messages(id, chat_id, sender_id, content, message_type, signal, mentions, retracted_at, ...)chat_members(chat_id, user_id, role, joined_at, ...)relationships(id, principal_a, principal_b, state, direction, hire_granted_at, ...)message_reads(message_id, user_id, read_at)Test plan
npx tsc --noEmit0 errors