Active context
What I am actively working on.
Current stage and phase
- Stage 1: Foundation for Personal Coach — 1/11 phases complete
- Completed:
- Phase 1: Foundation
- Production-ready infrastructure with real-time webhooks, normalized splits, audit trails, performance optimization, admin system, mobile-first UI, filter persistence, thumbnails with maps, code quality (lint fixes + doc validation).
- Phase 1: Foundation
Stage 1 progress tracking
- Phase 1: Foundation — Production-ready base complete
- Phase 2: Advanced Analytics (auto best efforts calculation, ranking system, time windows)
- Phase 3: Statistics Dashboard (landscape graphs, bar charts, dynamic scaling)
- Phase 4: Activity Management (edit/delete with audit, Strava difference detection)
- Phase 5: UI Refinements & Components (filtered counts, clear/refresh filters, shadcn/ui Calendar/Popover, consistent buttons with icons, visual feedback)
- Phase 6: Multi-User Auth & Permissions (unified User model with multi-tenancy, UnifiedAuthAdapter, roles/permissions, session management, user/session CRUD)
- Phase 7: Data Import & Migration (batch client/session data import tools from TrainingPeaks with templates & validation)
- Phase 8: Monitoring & Alerting (background health monitoring, admin views, alerting & notifications)
- Phase 9: Advanced Testing & Quality (integration tests for components, visual regression tests, cross-browser compatibility, E2E testing)
- Phase 10: Infra & GitOps (k8s manifests, FluxCD, secrets, backups)
- Phase 11: Security & Reliability (auth layer, error taxonomy, structured logs)
Current focus (phase 2 - analytics)
- Webhook happy-path: Strava → webhook → worker → DB (see webhooks)
- Dedupe on re-imports (by stravaId + start_date + duration window)
- Best efforts (400m → 50km) with time windows (All-time, 2y, 1y, 3m)
Near-term
- Filters on feed + persistence (distance, time, type, source)
- Observability: one place to follow ingest → worker → DB
Known issues and risks
- Auto model switching breaks files in Cursor. Keep Claude 4 Sonnet locked.
- ChatGPT Tab multi-file edits can corrupt the repo. Keep manual apply only.
- Early days for backups — ensure Postgres dump + object storage policy.
- Strava rate limits: throttle background jobs; exponential backoff.
Guardrails
- Prompts: Assumptions → Request → Safeguards.
- Always test in small steps. One change → one run.
- Chrome DevTools open, Disable cache on Network tab.
- Keep admin “test scripts” ephemeral. Commit only real endpoints.
Cost tracking (final stage 1)
- See costs & time for ongoing tracking.
Definition of done (stage 1)
- New run arrives in < 30s via webhook
- No dupes on re-sync
- Thumbnails always present (retry/cleanup worker)
- Splits correct and explainable (rankings pending phase 2)
- CSV export reliable
- API p95 < 50ms on core routes
- One observability page shows ingest → worker → DB with errors explained
Up next (stage 2 preview)
- SwiftUI scaffold, Apple HealthKit permissions.
- Historical data import (10+ years for cycle prediction).
- Personal coaching voice foundation.