Skip to content

fix(x): treat owner identity as an email set - #846

Open
support318 wants to merge 1 commit into
rowboatlabs:mainfrom
support318:feat/identity-as-set
Open

fix(x): treat owner identity as an email set#846
support318 wants to merge 1 commit into
rowboatlabs:mainfrom
support318:feat/identity-as-set

Conversation

@support318

Copy link
Copy Markdown

Summary

Groundwork for multi-account / multi-inbox email (#823).

Single-account users see zero behavior change. This only fixes identity assumptions that would break if a second mailbox is ever connected:

  • config/user.json: add emails: string[] (full owner set); keep email as primary. Legacy { email } normalizes in-memory; saves write both fields.
  • classify_thread: replace process-global cachedUserEmail with a per-OAuth2Client WeakMap; match “user wrote in thread” against the full owner set (connected ∪ user.json emails).
  • build_graph: Owner block + Email Reply Gate + final reminder use the email set; company domains exclude free-mail.
  • sync_gmail.getAccountName: per-client cache (same bug class as the email singleton).

Out of scope (follow-ups): multi-token OAuth, account registry, IMAP, concurrent Gmail sync, path namespacing.

Related intent: #823 comment. This is staged PR-1 of a small sequence (identity → registry → IMAP → multi-Gmail).

Test plan

  • vitest for user_config, classify_thread, build_graph (new/extended)
  • Existing sync_gmail / classification_stamp tests still pass
  • npm run typecheck:core clean
  • Manual: single Gmail install — classify + graph owner block look the same as before
  • Optional: hand-edit user.json with two emails → reply gate matches secondary From

Groundwork for multi-account email (rowboatlabs#823): stop process-global identity
caches, migrate user.json to emails[], and match KG reply-gate / classify
self-detection against the full owner set.

Single-account behavior is unchanged (set size 1). OAuth multi-key and
multi-loop sync are intentionally out of scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant