fix(x): treat owner identity as an email set - #846
Open
support318 wants to merge 1 commit into
Open
Conversation
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.
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
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: addemails: string[](full owner set); keepemailas primary. Legacy{ email }normalizes in-memory; saves write both fields.classify_thread: replace process-globalcachedUserEmailwith a per-OAuth2ClientWeakMap; match “user wrote in thread” against the full owner set (connected ∪user.jsonemails).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
vitestforuser_config,classify_thread,build_graph(new/extended)sync_gmail/classification_stamptests still passnpm run typecheck:corecleanuser.jsonwith twoemails→ reply gate matches secondary From