Background
The redesigned sidebar shows a workspace card (user name + usr_… id) that implies multi-org capability, but today every resource is owned by a single user_id — there's no org/workspace abstraction in the data model.
Scope
This is a major migration:
- New
orgs and org_members tables.
- Change every
WHERE user_id = $1 query to WHERE org_id = $1.
- Invite flow (email → join token → membership).
- RBAC (owner / admin / member at minimum).
- Org switcher in the sidebar workspace card.
- Migration path: every existing user gets a personal org seeded on first sign-in after deploy.
Recommendation
Defer until product genuinely needs multi-tenant (e.g., teams wanting shared agent inboxes, billing per workspace). The static workspace card is a placeholder that degrades gracefully; users don't see broken affordances.
Effort
L+ (multi-week migration touching auth, every API handler, and the dashboard data layer).
Source
BACKEND_TODO.md #9 (deferred bucket).
Background
The redesigned sidebar shows a workspace card (user name +
usr_…id) that implies multi-org capability, but today every resource is owned by a singleuser_id— there's no org/workspace abstraction in the data model.Scope
This is a major migration:
orgsandorg_memberstables.WHERE user_id = $1query toWHERE org_id = $1.Recommendation
Defer until product genuinely needs multi-tenant (e.g., teams wanting shared agent inboxes, billing per workspace). The static workspace card is a placeholder that degrades gracefully; users don't see broken affordances.
Effort
L+ (multi-week migration touching auth, every API handler, and the dashboard data layer).
Source
BACKEND_TODO.md #9 (deferred bucket).