ubiquitous-invention/plans
Randall Stillwell 820dae6510 docs(plans): split workspace-invites convoy into identity + invites + autocomplete
User pushed back on "strict email match in v1" — the right architectural
answer is multi-email identity (one users row owning multiple verified
emails), not a stopgap. Scaling the convoy accordingly:

1. Task-multi-email-identity (NEW, P1, foundation)
   - user_email_identities table (user_id, email lowercased, verified_at,
     source: primary | oauth:<provider> | manual)
   - Refactor ensureUserIdByEmail -> ensureUserIdByVerifiedEmail against
     the new table.
   - OAuth callback writes a source='oauth:<provider>' identity when the
     provider returns email_verified=true. Cross-user conflict rejects.
   - Profile UI: "Linked emails" section, read-only in v1.
   - Exports userOwnsEmail(userId, emailLower) for invite accept to call.

2. Task-workspace-invites-and-roles (existing, narrowed)
   - All the original spec.
   - Accept procedure calls userOwnsEmail() instead of comparing
     users.email directly. Mismatch renders an explainer page, not a
     silent accept.

3. Task-invite-recipient-autocomplete (NEW, P1, polish)
   - invites.suggestRecipient returns typed suggestions across four
     kinds: member / pending_invite / known_user / new_email.
   - Tenancy fence on known_user is the security-relevant assertion;
     test for it explicitly.
   - Combobox UI renders each kind with its own affordance.

Three follow-ups filed explicitly to keep this convoy PR-sized:
- Task-manual-email-verification (add an email outside OAuth)
- Task-disconnect-linked-email (destructive, needs last-verified guard)
- Task-account-merge (handle the legacy duplicate-users case)

Epic file refreshed with the new task table, follow-up table, and a
phase ordering note. Identity lands first because it touches the
sign-in path; invites and autocomplete can ship in their own PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 10:02:38 -05:00
..
Plan-agent-coordination plans: scaffold daily-driver-finish, saas-hardening, agent-coordination 2026-06-01 23:52:22 -05:00
Plan-daily-driver-finish docs(plan): note agent-side prep on collab-editor smoke-test task 2026-06-02 00:26:34 -05:00
Plan-multitenant-cursor-sync feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
Plan-multitenant-saas-hardening docs(plans): split workspace-invites convoy into identity + invites + autocomplete 2026-06-02 10:02:38 -05:00
README.md feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00

Plans directory

Human- and agent-oriented backlog. Structure:

plans/
  Plan-<plan-slug>/
    Plan-<plan-slug>.md
    Epic-<epic-slug>/
      Epic-<epic-slug>.md
      Task-<task-slug>.md
      Task-<other-task>.md
  • Slug: lowercase, hyphenated, stable across renames of display title when possible.
  • Templates: copy from docs/templates/.
  • Chunking: keep each Task small enough for one Cursor agent or subagent to own; use Epics for milestones that need several tasks.

See docs/Glossary.md and config/CursorSync.md.

Import to database: from the repo root, with DATABASE_URL and your workspace UUID:

pnpm --filter @tasks/database watch:markdown-backlog

Set MARKDOWN_BACKLOG_WORKSPACE_ID (and optionally MARKDOWN_BACKLOG_REPO_ROOT). This runs an initial sync and watches plans/ for changes.