← all documents · raw markdown · 8 KB

Account, Integrations & Security — Spec

Status: Draft roadmap · Date: 2026-07-18 · Owner: Ryan

Scope: The full account/security/integrations vision for Oracle Lattice OS —

real profile settings, notifications, sign-in security, device tracking, and the

linked-accounts engine (Google, Discord, YouTube, Twitch, Facebook, email, RSS)

that syncs external services into the ecosystem so AI helpers can act on them in

one place.

This is a multi-phase platform track, not one edit. Each external provider

needs its own OAuth app (you register it; I wire it), and each sync is its own

connector + background job. This doc is the plan + exactly what you provide.

---

0. What shipped already (this pass)

(next to the Oracle symbol), with an unread badge and a panel. The **feed

content** (mentions/replies/follows) is Phase 2 below; the bell + setNotifCount(n)

hook are live now.

Ecosystem, Agents, Appearance, Privacy, General).

---

1. Profile (Account → Profile)

Real, saveable profile. Ships against the existing /api/me/profile.

but rate-limited to 5 changes per rolling 30 days (server tracks

nameChanges: [{ts}]; UI shows "N of 5 changes left this month"). The @handle

underneath is immutable (identity anchor; changing it would break mentions).

POST /api/me/name { name } that enforces the 5/30-day cap and propagates the

new name to the display layer (posts/comments read the live user record, so this

is mostly a write + cache-bust).

2. Notifications (bell feed)

written when someone @mentions you, replies, reacts, follows, or

DMs you. Endpoints: GET /api/me/notifs (list + unread count),

POST /api/me/notifs/seen.

poll on the existing cadence. Mentions are detected server-side by scanning

new posts/comments/messages for @handle.

browser notification (reuses the notification system already built for DMs).

3. Sign-in & Security (Account → Sign-in & Security)

Only security lives here (nothing bleeds in from other tabs).

server verifies the 6-digit code. This is the portable option.

factor. Requires a Google OAuth app (Phase 4). A new/never-seen device is

challenged once; after you approve it, the device is trusted and skips

2FA next time (see §4).

2FA only fires on an unrecognized device.

4. Sessions & Devices (Account → Sessions & Devices)

Show every active/recent login so you can confirm it was you.

login time, last active, device ID (stable per-browser token),

IP address, approx location (geo-IP), and a VPN/proxy flag.

ipqualityscore). That's an external API + key — one of the few things here that

costs a call per new IP. Cached per IP.

others"**.

{ua, ip, deviceId, createdAt, lastActive, geo, vpn} and add

GET /api/me/sessions, POST /api/me/sessions/revoke.

5. Linked Accounts / Integrations engine (Account → Linked Accounts)

The big one. A generic OAuth + sync framework; each provider is a plugin with a

setup wizard in this menu. Every provider needs its own OAuth app you

register (client id/secret → .env), just like the Drive setup.

Framework:

Providers (ranked by value / effort):

1. Google *(high value)* — sign-in + Google services. Once linked, the in-app

Web browser uses your Google session (so Gmail/Drive/YouTube open logged in

as the account you authorized). Also powers Google-based 2FA. Scopes: openid,

email, profile (+ optional service scopes). *You provide: Google OAuth app.*

2. Discord *(high value)* — sync your servers. New "Discord Servers" section

in the Messages area showing your servers → categories → channels, so you use

Discord through Oracle: read, post, get updates. Config panel for which

servers/channels to mirror. *You provide: Discord OAuth app + bot for the

servers you want to bridge.*

3. YouTube *(high value)* — sync your Shorts/uploads into the Oracle

Shorts feed, each rendered with a small source badge ("via YouTube

(Google)"). *You provide: YouTube Data API (part of the Google app).*

4. RSS *(low effort, no OAuth)* — subscribe to any feed; new items appear as

posts/notifications with a source badge. Good first sync to prove the pipeline.

5. Twitch — stream status + clips into the feed. *You provide: Twitch app.*

6. Facebook / Instagram — cross-post + import. *You provide: Meta app (their

review is the slowest — plan for it).*

7. Email — connect a mailbox (IMAP/Gmail API) so AI helpers can triage/summarize

in a workspace. *You provide: app password or Gmail API scope.*

Source badges: every synced item carries {source:'youtube'|'rss'|…, url} and

renders a small metadata chip so users always see where content came from.

6. Ecosystem hub (the vision)

Once providers are linked, the Agents/workspace area becomes the single place

where your AI helpers act across everything: summarize a Discord channel, draft a

YouTube Short description, triage email, post an RSS item to the feed — all keyed

to your real identity (from the isolation fix) and stored in your Drive

folder (from the storage spec). This is where "one area to do what the user wants"

comes together.

---

7. Phased rollout

profile save; Sessions & Devices from UA + IP (VPN flag deferred to §4 API);

notifications store + bell feed + @mention detection. *All buildable now.*

OAuth), wire the bell to real notifications.

8. What I need from you (per provider)

For each of Google, Discord, YouTube, Twitch, Facebook: create the provider's OAuth

app, add the redirect URI I give you, and hand me the client id + secret (into

.env, never printed). RSS and TOTP need nothing from you. IP/VPN detection needs

one IP-intelligence API key.

9. Open decisions

1. Which providers to prioritize after Phase 1? (I recommend RSS → Google →

Discord → YouTube.)

2. Name-change limit: 5 per 30 days — confirm the number.

3. IP-intelligence provider for VPN detection (ipinfo vs ipqualityscore vs skip).

4. 2FA: TOTP first, Google-as-2FA later — OK?

Once you pick the Phase-1 scope and confirm the name-change number, I'll build

Phase 1 end-to-end (it needs nothing external).