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
docs: add M48-M50 milestones for calendar, goals, and email management
Adam Eivy522441349e10
diff --git a/.changelog/v1.17.x.md b/.changelog/v1.17.x.mdnew file mode 100644index 0000000000..f53649f245--- /dev/null+++ b/.changelog/v1.17.x.md@@ -0,0 +1,12 @@+# Release v1.17.x - Changelog++Released: YYYY-MM-DD++## Overview++Roadmap expansion with three new productivity milestones.++## Features++- **M48-M50 roadmap milestones** — added Google Calendar Integration (M48), Life Goals & Todo Planning (M49), and Email Management (M50) to PLAN.md with full phase specs, dependency graph, routes, data schemas, and nav placement+- **Core goal #11** — added "Personal Productivity & Life Management" to GOALS.md, covering calendar sync, goal tracking with AI check-ins, and email management with Digital Twin voice draftingdiff --git a/GOALS.md b/GOALS.mdindex 9fc2c160aa..fa93613b48 100644--- a/GOALS.md+++ b/GOALS.md@@ -48,6 +48,10 @@ Tailscale VPN enables secure access from any device without public internet expoHelp the user live a long, healthy life. MeatSpace tracks physical health data — alcohol consumption, blood work, body metrics, epigenetic age, eye health, genome markers, and lifestyle factors — and surfaces it alongside mortality projections and longevity escape velocity tracking. Combined with genome-derived life expectancy and mortality-aware goal scoring, the system makes health data actionable: not just recording what happened, but informing what to do next. The same goal-tracking system that manages digital projects manages meatspace goals — exercise targets, biomarker improvements, habit changes — with the same urgency scoring and progress visualization.+### 11. Personal Productivity & Life Management++Calendar integration, life goal tracking, and email management transform PortOS from a developer tool into a complete personal operating system. Google Calendar sync with chronotype-aware scheduling ensures the user's human time is optimized alongside their digital systems. Goal tracking with AI-powered check-ins keeps long-term ambitions on track with calendar-booked work sessions. Email management with AI categorization, Digital Twin voice drafting, and a review-before-send outbox reduces email overhead while maintaining authentic communication.+## Secondary Goals- **Multi-Modal Identity Capture**: Voice, video, and image-based identity modeling beyond textdiff --git a/PLAN.md b/PLAN.mdindex 61db87c0cb..062ab2201c 100644--- a/PLAN.md+++ b/PLAN.md@@ -87,6 +87,9 @@ pm2 logs- [ ] **M45**: Data Backup & Recovery - Scheduled backup of `./data/` to external drive or NAS. All persistence is JSON files with zero redundancy — one bad write or disk failure loses brain, identity, health, and memory data. Incremental backup with restore verification.- [ ] **M46**: Unified Search (Cmd+K) - Global search across brain, memory, history, agents, tasks, and apps. Hybrid vector + BM25 extended to all data sources. Keyboard-driven launcher overlay.- [ ] **M47**: Push Notifications - Webhook-based alerts when agents complete tasks, critical errors occur, or goals stall. Discord/Telegram integration for mobile awareness without needing the dashboard open.+- [ ] **M48 P1-P4**: Google Calendar Integration - OAuth2, two-way event sync, chronotype-aware smart scheduling, CoS autonomous rescheduling, calendar UI with week/month views+- [ ] **M49 P1-P4**: Life Goals & Todo Planning - Enhanced goal model with todos and milestones, calendar time-blocking, AI-powered periodic check-ins, mortality-aware progress dashboard+- [ ] **M50 P1-P4**: Email Management - Gmail + Outlook integration, AI categorization and priority extraction, Digital Twin voice drafting, review-before-send outbox, Brain knowledge capture---@@ -193,6 +196,83 @@ External notification delivery for critical events when not actively viewing the*Touches: new server/services/pushNotify.js, server/routes/settings.js, Settings UI, cosEvents.js, errorRecovery.js*+### M48: Google Calendar Integration++Shared Google OAuth2 foundation — `server/services/googleAuth.js` handles OAuth2 consent flow, token storage/refresh, scope management. Tokens stored in `data/google/auth.json`. Reused by both Calendar and Gmail.++**Phases:**++- **P1: Calendar Read & OAuth** — Google OAuth2 service, calendar event listing, basic week/month calendar UI, settings page for Google connection+- **P2: Calendar Write & Sync** — Event CRUD (create/update/delete synced to Google), two-way incremental sync using Google's `syncToken`, conflict detection (last-writer-wins, Google as source of truth for external events), configurable sync interval (default 5min)+- **P3: Smart Scheduling & CoS** — Free slot finder API, chronotype-aware slot selection (reads `data/digital-twin/chronotype.json` for peak-focus windows), auto-schedule human tasks during optimal windows, CoS autonomous job `job-calendar-schedule` for rescheduling when conflicts arise+- **P4: Calendar UI Polish** — Week/day/month views, color coding by source/type, dashboard calendar widget (today's events), linked goal/todo indicators on events++**Data:** `data/google/auth.json` (OAuth tokens), `data/calendar/events.json` (local event cache with Google sync tokens), `data/calendar/config.json` (sync settings, working hours, chronotype preferences)++**Routes:** `GET/POST/PUT/DELETE /api/calendar/events`, `POST /api/calendar/sync`, `GET /api/calendar/free-slots`, `POST /api/calendar/schedule-task`, `GET /api/google/oauth/start`, `GET /api/google/oauth/callback`, `GET /api/google/status`++**Nav:** Top-level sidebar item "Calendar" (alphabetically between Chief of Staff and Dev Tools)++*Touches: new server/services/googleAuth.js, server/services/calendar.js, server/services/calendarScheduler.js, server/routes/google.js, server/routes/calendar.js, client/src/pages/Calendar.jsx, client/src/components/calendar/tabs/, Layout.jsx, autonomousJobs.js, data/digital-twin/chronotype.json*++### M49: Life Goals & Todo Planning++Extends the existing goal system in `server/services/identity.js` and `data/digital-twin/goals.json`. Adds rich progress tracking, todo sub-tasks, calendar time-blocking, and AI-powered check-ins. Gets its own top-level Goals page (not buried under Digital Twin).++**Phases:**++- **P1: Enhanced Goal Model & Todos** — Extend goal schema with: progress percentage + history, velocity (percent/month + trend), projected completion date, todo sub-tasks with status/priority/time estimates, time tracking (total minutes, weekly average). Dedicated Goals page with goal list and detail view+- **P2: Calendar Time-Blocking** (depends on M48 P2) — Schedule recurring goal work sessions on calendar, link calendar events to goals/todos via IDs, track actual time spent from calendar event durations, per-goal calendar config (preferred days, time slot preference, session duration)+- **P3: Check-in & Evaluation** — Periodic check-in prompts (weekly/monthly configurable per goal), AI evaluator uses Digital Twin + progress data to assess trajectory, timeline adjustment recommendations when behind schedule, CoS autonomous job `job-goal-check-in` for weekly evaluations, check-in history with mood/notes+- **P4: Dashboard & Visualization** — Goal progress dashboard widget with urgency badges, burn-down / progress timeline charts, integration with existing mortality-aware urgency scoring (M42 P3), "on track" / "behind" / "at risk" status indicators++**Data:** Extended `data/digital-twin/goals.json` with `todos[]`, `progressHistory[]`, `velocity{}`, `checkIns[]`, `calendarConfig{}`, `timeTracking{}` per goal. `checkInSchedule{}` at root level.++**Routes:** Extend `/api/digital-twin/identity/goals` with: `PUT /:id/progress`, `POST /:id/check-in`, `POST /:id/todos`, `PUT /:id/todos/:tid`, `POST /:id/schedule`, `POST /evaluate`++**Nav:** Top-level sidebar item "Goals" (alphabetically between Digital Twin and Insights)++*Touches: server/services/identity.js (extend), new server/services/goalEvaluator.js, server/routes/identity.js (extend), client/src/pages/Goals.jsx, client/src/components/goals/tabs/, Layout.jsx, autonomousJobs.js*++### M50: Email Management++Multi-provider email integration — Gmail via Google OAuth (shared with M48) + Outlook via Microsoft Graph API (separate OAuth2 flow). Provider abstraction layer so both behave identically from the service layer up.++Always review before send — AI-generated drafts go to an outbox queue. The user reviews, edits, and approves each response before it's sent. No auto-send.++**Phases:**++- **P1: Email Read & Provider Auth** — Gmail API integration using shared Google OAuth (`gmail.modify` scope), Microsoft Graph API with separate OAuth2 for Outlook, provider abstraction layer (`emailProvider.js`), email listing with pagination, thread view, basic email inbox UI+- **P2: AI Categorization & Priority Extraction** — LLM-powered classification (action required, informational, promotional, social, receipts), configurable rules for known senders (skip AI for obvious categories like GitHub notifications), todo extraction from email content (linkable to M49 goal todos), priority scoring, Brain system integration for knowledge capture from action/info emails+- **P3: Response Drafting with Digital Twin** — Draft responses using Digital Twin voice/style (reads COMMUNICATION.md, PERSONALITY.md, VALUES.md + recent thread context), outbox queue with pending/approved/sent states, draft review/editing UI, all drafts require manual approval before sending+- **P4: CoS Automation & Rules** — Automated classification on new emails via CoS job `job-email-triage`, rule-based pre-filtering, email-to-task pipeline (email todos → M49 goal todos), priority email notifications via existing notification system++**Data:** `data/email/config.json` (sync settings, categories, rules, brain capture config), `data/email/cache/YYYY-MM-DD.jsonl` (date-bucketed email cache, bodies fetched on demand), `data/email/outbox.json` (draft queue with status tracking), `data/outlook/auth.json` (Microsoft OAuth tokens)++**Routes:** `GET /api/email/messages`, `GET /api/email/threads/:threadId`, `POST /api/email/sync`, `POST /api/email/classify/:id`, `POST /api/email/draft/:id`, `GET/PUT/POST/DELETE /api/email/outbox/:id`, `POST /api/email/outbox/:id/approve`++**Nav:** Top-level sidebar item "Email" (alphabetically between Digital Twin and Goals)++**Dependency Graph:**++```+M48 P1 (Google OAuth + Calendar Read)+ ├── M48 P2 (Calendar Write + Sync)+ │ ├── M49 P2 (Calendar Time-Blocking)+ │ └── M48 P3 (Smart Scheduling + CoS)+ │ └── M48 P4 (Calendar UI Polish)+ └── M50 P1 (Gmail + Outlook Read — reuses Google OAuth)+ └── M50 P2 (AI Classification)+ └── M50 P3 (Response Drafting)+ └── M50 P4 (CoS Automation)++M49 P1 (Enhanced Goals + Todos) — independent, no deps+ ├── M49 P2 (Calendar Integration — needs M48 P2)+ └── M49 P3 (Check-ins) → M49 P4 (Dashboard)+```++*Touches: new server/services/email.js, server/services/emailProvider.js, server/services/emailClassifier.js, server/services/emailDrafter.js, server/routes/email.js, client/src/pages/Email.jsx, client/src/components/email/tabs/, Layout.jsx, brain.js, autonomousJobs.js, portos-ai-toolkit (Digital Twin context for drafting)*+### Tier 1: Identity Integration (aligns with M42 direction)- **Chronotype-Aware Scheduling** — Chronotype derivation exists (M42 P1) but isn't applied to task scheduling yet. Use peak-focus windows from genome sleep markers to schedule deep-work tasks during peak hours, routine tasks during low-energy. Display energy curve on Schedule tab. *Touches: taskSchedule.js, genome.js, CoS Schedule tab*@@ -275,3 +355,6 @@ All 10 audit items (S1–S10) from the 2025-02-19 security audit have been resol3. **M45**: Data Backup & Recovery — protect `./data/` from data loss4. **M44 P7**: Apple Health Integration — live sync + bulk XML import (spec above)5. **M46**: Unified Search (Cmd+K) — cross-cutting search across all data sources+6. **M48 P1**: Google Calendar — OAuth2 foundation + calendar read+7. **M49 P1**: Life Goals — Enhanced goal model with todos and progress tracking+8. **M48 P2**: Google Calendar — Event CRUD and two-way syncdiff --git a/package-lock.json b/package-lock.jsonindex 7080f4b326..d0162d57e2 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "portos",- "version": "1.17.0",+ "version": "1.17.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "portos",- "version": "1.17.0",+ "version": "1.17.1","license": "MIT","dependencies": {"express": "^4.21.2",diff --git a/package.json b/package.jsonindex c9a7732951..dbbad80358 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "portos",- "version": "1.17.0",+ "version": "1.17.1","private": true,"description": "Local dev machine App OS portal","author": "Adam Eivy (@antic|@atomantic)",