Submatter/plans/Plan-workspace-communications/Epic-workspace-chat/Epic-workspace-chat.md

60 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

---
kind: epic
slug: workspace-chat
title: Workspace chat foundation
plan_slug: workspace-communications
status: ready
priority: P1
tenant_id: global
cursor_epic_id: null
updated_at: "2026-10-22"
---
# Epic objective
Deliver durable channels and messages with a left-rail destination, reliable unread state, and horizontally scalable realtime delivery. The approved product includes project/supported-object contexts, but the current three-brief foundation accepts workspace contexts only. A bounded contextual integration task remains blocked on an authoritative object permission policy; existing generic `objects` project rows and tenant checks are not private-object ACLs. All paths follow the parent plan's workspace AND context AND channel access contract, including counts, notifications and realtime revocation.
## In scope / out of scope
**In scope**
- Channel, membership, message, thread, and read-cursor persistence.
- Workspace-authorized tRPC queries and mutations.
- WebSocket event delivery with Redis cross-instance fan-out and reconnect catch-up.
- Chat routes, channel navigation, composer, message list, and left-rail badge.
**Out of scope**
- Agent execution and tool calls.
- Unified non-chat notifications.
- Search indexing, voice/video, and external federation.
## Related tasks
| Task | Link |
|------|------|
| Persist channels, messages, and read state | `./Task-chat-persistence.md` |
| Deliver scalable realtime chat events | `./Task-chat-realtime-delivery.md` |
| Build chat routes and left-rail navigation | `./Task-chat-ui-and-navigation.md` |
| Bind project/supported-object contexts safely | `./Task-contextual-chat-authorization.md` |
## Dependencies
- Depends on: existing workspace authorization and Redis infrastructure.
- Blocks: unified chat notifications and agent participation.
## Acceptance criteria
- [ ] Every chat row and query is scoped by `workspace_id`.
- [ ] Sending a message commits durably before an event is broadcast.
- [ ] Reconnecting clients catch up from a durable cursor without relying on Redis history.
- [ ] Chat is reachable from the left rail and displays durable unread/mention state.
## Proposed timeline
| Phase | Window | Notes |
|-------|--------|-------|
| Persistence | 1 | Schema, migrations, authorization, API tests |
| Realtime | 2 | Outbox, WebSockets, Redis fan-out, catch-up |
| UI | 3 | Routes, composer, feed, rail badge |