Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat([issue-2147]): org drawer social-account cross-link picker
Adam Eivy24a61b7487d3
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 3d1c994685..25ba60d59f 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -33,6 +33,7 @@## Privacy Center+- **[issue-2147] The Privacy Center org drawer now cross-links to your Digital Twin social accounts — from both sides.** Completing Phase 8 (epic #2138): the create/edit organization drawer gains a **Linked social account (Digital Twin)** picker that lets you point any org at one of your twin's social accounts. It pairs with the twin's existing "Add to org registry" / "in org registry" badge so the link is visible and editable from either surface, and a stale link to a since-deleted account is preserved rather than silently dropped. (`client/src/components/privacy/OrgDrawer.jsx`)- **[issue-2142] A new Privacy Center UI puts your encrypted PII vault and the organizations that hold it in one place.** Building on the Phase 1 encrypted vault (#2140) and Phase 2 trusted-organizations registry (#2141), a deep-linkable `/privacy/:tab` page (Identity → Privacy, `⌘K`/voice-navigable) ships three tabs: **Overview** — a doctor-style readout of whether AES-256-GCM encryption is engaged, vault record counts by type, and org counts by trust stance, with quick-jump cards into the other tabs; **Vault** — records grouped by type showing only the precomputed masked value (`•••, Portland OR` / `a•••@example.com`), with per-record "Share with Twin" / "Use for scans" optimistic toggles (hard-disabled for sensitive SSN/passport/license/financial types), a create/edit `Drawer`, and an explicit per-record **Reveal** action that decrypts plaintext only on click (never cached in list state) — plaintext never renders until you ask for it; **Organizations** — a trust/category/status chip-filtered list with per-org holdings status badges and a create/edit drawer whose holdings picker checkboxes over your vault records (masked) to record which fields each org holds. All mutations update local state directly (no full-list refetch), deletes use an inline confirm row (no `window.confirm`), and every tab is usable at 360px. Each tab path is registered in the nav manifest (`nav.identity.privacy-*`). (`client/src/pages/Privacy.jsx`, `client/src/components/privacy/`, `client/src/services/apiPrivacy.js`, `server/lib/navManifest.js`)- **[issue-2144] The Privacy Center can now find where you're exposed on people-search sites.** Phase 5 of the Privacy Center (epic #2138) adds a database of ~20 major data brokers (Spokeo, Whitepages, BeenVerified, Radaris, MyLife, and the PeopleConnect cluster — Intelius/TruthFinder/Instant Checkmate/US Search), a read-only exposure scan that searches each broker using only the identity facts you've marked as scan-eligible in the vault (never your SSN, passport, license, or financial details), and a per-broker case ledger that tracks each listing through its removal lifecycle. Scans respect a hard rule: a CAPTCHA or bot-wall is recorded as "blocked" and never bypassed, and a broker can only be marked "removed" by a fresh scan that confirms your listing is actually gone — never by a submission page saying so. Nothing runs on startup: the broker list loads on first view and you can grow it on demand from the public BADBOOL and California data-broker registries (your curated brokers are never overwritten), and scans run only when you start one or schedule them. This is the data + scan backbone for the upcoming opt-out automation (Phase 6) and Brokers UI tab.- **[issue-2143] Moved, changed your number, or got a new email? The Privacy Center now tracks who still needs updating.** Phase 4 of the Privacy Center (epic #2138) adds a change-of-address inventory: a new **Changes** tab (`/privacy/changes`, `⌘K`/voice-navigable under Identity) where you declare "this field changed from A to B" — the old vault record is retired to `previous` (with an end date), a new encrypted record is created for the new value, and every organization recorded as holding the old value is automatically flagged **update pending**. You then work the checklist per organization — mark **updated** once they've got the new value, mark **removed** if they dropped the field entirely — with a live progress bar per change that reads "done" only when zero orgs are still pending. For any org with a contact email you can draft a plain "please update my records" email (old → new) straight into the Comms drafts queue as an **unapproved** draft you review before it ever sends (template-only, no AI, no auto-send). Works for any field, not just addresses — phone, email, and name changes get their own change type. All privacy records stay encrypted-at-rest and machine-local; the inventory joins only masked values, never plaintext. (`server/services/privacyChanges.js`, `server/routes/privacy.js`, `server/lib/privacyValidation.js`, `server/lib/db.js`, `client/src/pages/Privacy.jsx`, `client/src/components/privacy/{PrivacyChangesTab,DeclareChangeDrawer}.jsx`, `client/src/services/apiPrivacy.js`, `server/lib/navManifest.js`)diff --git a/client/src/components/privacy/OrgDrawer.jsx b/client/src/components/privacy/OrgDrawer.jsxindex 27bafbe785..0fd1b7350d 100644--- a/client/src/components/privacy/OrgDrawer.jsx+++ b/client/src/components/privacy/OrgDrawer.jsx@@ -3,7 +3,7 @@ import Drawer from '../Drawer';import FormField from '../ui/FormField';import { useAsyncAction } from '../../hooks/useAsyncAction';import {- createPrivacyOrg, updatePrivacyOrg, getOrgHoldings, setOrgHoldings,+ createPrivacyOrg, updatePrivacyOrg, getOrgHoldings, setOrgHoldings, getSocialAccounts,} from '../../services/api';import toast from '../ui/Toast';import { ORG_CATEGORIES, ORG_TRUST_LEVELS, ORG_STATUSES, VAULT_TYPES, labelFor } from './constants';@@ -12,7 +12,14 @@ const inputCls = 'w-full bg-port-bg border border-port-border rounded px-3 py-2const EMPTY = {name: '', category: 'other', website: '', trust: 'trusted', status: 'active',- contactEmail: '', contactPhone: '', notes: '',+ contactEmail: '', contactPhone: '', notes: '', socialAccountId: '',+};++// Human label for a Digital Twin social account in the picker.+const accountLabel = (a) => {+ const handle = a.username ? `@${a.username}` : '';+ const name = a.displayName && a.displayName !== a.username ? ` (${a.displayName})` : '';+ return `${a.platform || 'other'} · ${handle}${name}`.trim();};// Create/edit an organization plus which vault records it holds. The holdings@@ -23,6 +30,7 @@ export default function OrgDrawer({ open, org, vaultRecords, onClose, onSaved })const editing = !!org;const [form, setForm] = useState(EMPTY);const [selected, setSelected] = useState(() => new Set()); // vaultRecordId set+ const [socialAccounts, setSocialAccounts] = useState([]); // Digital Twin accounts for the cross-link pickeruseEffect(() => {if (!open) return;@@ -36,6 +44,7 @@ export default function OrgDrawer({ open, org, vaultRecords, onClose, onSaved })contactEmail: org.contact?.email ?? '',contactPhone: org.contact?.phone ?? '',notes: org.notes ?? '',+ socialAccountId: org.socialAccountId ?? '',}: { ...EMPTY });setSelected(new Set());@@ -45,6 +54,11 @@ export default function OrgDrawer({ open, org, vaultRecords, onClose, onSaved }).then((h) => setSelected(new Set((h || []).map((x) => x.vaultRecordId)))).catch(() => {});}+ // Load Digital Twin social accounts for the cross-link picker (#2147). Degrades+ // to no picker options if the twin has none — never blocks org editing.+ getSocialAccounts()+ .then((res) => setSocialAccounts(res?.accounts || []))+ .catch(() => setSocialAccounts([]));}, [open, org]);const set = (k, v) => setForm((prev) => ({ ...prev, [k]: v }));@@ -67,6 +81,9 @@ export default function OrgDrawer({ open, org, vaultRecords, onClose, onSaved })status: form.status,contact,notes: form.notes,+ // Cross-link to a Digital Twin social account (#2147). Empty → null so a+ // cleared link persists as an explicit clear rather than an empty string.+ socialAccountId: form.socialAccountId || null,};const savedOrg = editing@@ -124,6 +141,26 @@ export default function OrgDrawer({ open, org, vaultRecords, onClose, onSaved })<input type="text" value={form.website} onChange={(e) => set('website', e.target.value)} placeholder="https://…" className={inputCls} maxLength={2000} /></FormField>+ <FormField label="Linked social account (Digital Twin)">+ <select+ value={form.socialAccountId}+ onChange={(e) => set('socialAccountId', e.target.value)}+ className={inputCls}+ >+ <option value="">— None —</option>+ {/* Preserve a stale link (account since deleted) so the select isn't blank. */}+ {form.socialAccountId && !socialAccounts.some((a) => a.id === form.socialAccountId) && (+ <option value={form.socialAccountId}>Linked account (unavailable)</option>+ )}+ {socialAccounts.map((a) => (+ <option key={a.id} value={a.id}>{accountLabel(a)}</option>+ ))}+ </select>+ <p className="text-[11px] text-gray-500 mt-1">+ Cross-links this org to one of your Digital Twin social accounts — the account shows an “in org registry” badge in return.+ </p>+ </FormField>+<div className="grid grid-cols-1 sm:grid-cols-2 gap-3"><FormField label="Contact email"><input type="email" value={form.contactEmail} onChange={(e) => set('contactEmail', e.target.value)} className={inputCls} maxLength={320} />diff --git a/client/src/pages/Privacy.test.jsx b/client/src/pages/Privacy.test.jsxindex 59ceb7e7c3..e9a407ad01 100644--- a/client/src/pages/Privacy.test.jsx+++ b/client/src/pages/Privacy.test.jsx@@ -31,6 +31,11 @@ vi.mock('../services/api', () => ({deletePrivacyOrg: vi.fn().mockResolvedValue({ ok: true }),getOrgHoldings: vi.fn().mockResolvedValue([]),setOrgHoldings: vi.fn(),+ getSocialAccounts: vi.fn().mockResolvedValue({+ accounts: [+ { id: 'sa-1', platform: 'github', username: 'octocat', displayName: 'The Octocat', url: 'https://github.com/octocat' },+ ],+ }),getPrivacyChanges: vi.fn().mockResolvedValue([{id: 'ev-1', vaultRecordId: 'rec-1', replacementRecordId: 'rec-9', kind: 'address_change',@@ -99,6 +104,15 @@ describe('Privacy Center', () => {expect(screen.getAllByText('Trusted').length).toBeGreaterThanOrEqual(1);});+ it('exposes the Digital Twin social-account cross-link picker in the org drawer (#2147)', async () => {+ renderAt('/privacy/organizations');+ await waitFor(() => expect(screen.getByText('Acme Bank')).toBeInTheDocument());+ fireEvent.click(screen.getByRole('button', { name: /New organization/i }));+ // The picker labels itself and offers the twin's social account as an option.+ await waitFor(() => expect(screen.getByText(/Linked social account/i)).toBeInTheDocument());+ expect(screen.getByText(/github · @octocat \(The Octocat\)/)).toBeInTheDocument();+ });+it('renders the Changes tab with a declared change and its progress', async () => {renderAt('/privacy/changes');// Masked old → new values render; the change kind badge shows.