From 42d2b4b245f872ef778beb8c28e63f210722bc65 Mon Sep 17 00:00:00 2001 From: Keysat Date: Tue, 16 Jun 2026 14:49:59 -0500 Subject: [PATCH] Repurpose Communications tab as admin-only email-activity panel (v0.1.0:80) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Communications tab is now an admin-only search over captured Gmail (email_* tables), part of consolidating on the fundraising grid + email capture as the canonical system of record. - New GET /api/email/activity (admin-enforced server-side): filter by investor / mailbox / direction with free-text search over subject, snippet, and sender. Query logic in db.query_email_activity. - Soft-delete honored on the per-mailbox sighting (emails carry no deleted_at; deletion lives on email_account_messages). - Direction decided at the email level (outbound if the sender is one of our mailboxes), mirroring digest_builder. - Graveyard investors are hidden from the filter dropdown (CRM-wide graveyard=0 convention) but their email stays visible in the list and findable by free-text search — this is an audit surface. - Communications page rewritten to render the panel; the classic manual "Log Communication" form is retired (the grid context menu remains the manual-log path). Nav item + page are admin-only. - Tests: email_integration/test_email_activity_panel.py (filters, per-sighting soft-delete, roll-ups, graveyard handling, route 401/403); full suite 22/22. Frontend render verified via a jsdom mount smoke test plus the pinned classic-runtime Babel transform. Code-only, no schema migration (version migrations are no-ops). --- AGENTS.md | 10 +- backend/email_integration/db.py | 104 +++++ backend/email_integration/routes.py | 28 ++ .../test_email_activity_panel.py | 210 +++++++++ frontend/index.html | 402 ++++++------------ start9/0.4/startos/utils.ts | 5 +- start9/0.4/startos/versions/index.ts | 5 +- start9/0.4/startos/versions/v0.1.0.80.ts | 21 + 8 files changed, 494 insertions(+), 291 deletions(-) create mode 100644 backend/email_integration/test_email_activity_panel.py create mode 100644 start9/0.4/startos/versions/v0.1.0.80.ts diff --git a/AGENTS.md b/AGENTS.md index fdeae7d..3327a7e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -101,14 +101,14 @@ Subsystem rules live in `docs/guides/` and lazy-load in Claude Code via `.claude ## Current state -_Phase 0 substrate + Phase 1 thesis/outreach are built; **box and repo at v0.1.0:79** (latest: **P0 hotfix** — the unpinned Babel CDN auto-upgraded to v8 and blanked the entire UI; pinned `@babel/standalone@7.29.7` + closed 3 server-side admin gaps; prior: retired `lp_profiles` + LP Tracker). **Decision (2026-06-16): the fundraising grid + email capture is the canonical system of record** — vestigial classic-CRM surfaces get pruned or repurposed (see `ROADMAP.md` → "Consolidate on the fundraising grid as canonical"). Longer-term backlog: `ROADMAP.md`._ +_Phase 0 substrate + Phase 1 thesis/outreach are built; **box and repo at v0.1.0:80** (latest: **email-activity panel** — the Communications tab is now the admin-only captured-Gmail search over the `email_*` tables; prior: P0 hotfix pinning `@babel/standalone@7.29.7` after the unpinned CDN auto-upgraded to v8 and blanked the UI). **Decision (2026-06-16): the fundraising grid + email capture is the canonical system of record** — vestigial classic-CRM surfaces get pruned or repurposed (see `ROADMAP.md` → "Consolidate on the fundraising grid as canonical"). Longer-term backlog: `ROADMAP.md`._ - **Working (all draft-only):** CRM + ingest (chunk→embed→Qdrant + retrieval) + redaction boundary; Gmail capture (DWD) + email-activity propose→approve; Thesis Workshop + Architect (Claude) with dual-approval gate; Outreach Draft Assistant + follow-up radar + per-user voice + Tier-B in-thread Gmail draft creation. -- **Deployed & verified live: v0.1.0:79** (box `$START9_BOX_HOST`/immense-voyage.local; `installed-version`→`0.1.0:79`, migration chain `…78→79` clean, server up on `:8080`; **login screen render-confirmed in-browser by Grant after a hard refresh** — not just curl/health). **v0.1.0:79 was a P0 hotfix:** the page loaded `@babel/standalone` from unpkg **unpinned**, so the CDN served **Babel 8.0.0**, whose `@babel/preset-react` automatic JSX runtime prepends an ESM `import {jsx} from "react/jsx-runtime"` — illegal in this classic (non-module) inline `