Changelog¶
Development progress log — each commit is tracked here with date, task ID, and details.
2026-03-17¶
athion-sdk — SDK-001 through SDK-025: Typed models and service layer¶
- Commit:
27859aa - Tasks: SDK-001–SDK-025 — Buddy Service, Coach Managed Clients, Coach Portal, Circles Completion, Activity/GPS Service
- Details:
- Added typed models and service methods for all 25 SDK tasks
- BuddyService (6 tasks): challenge CRUD, matching, messaging, sessions, stats, models
- ManagedClientService (4 tasks): CRUD, health metrics, notes/progress, models
- Coach Portal services (11 tasks): intake, journey, messaging, notes, sessions, locations, billing, payouts, campaigns, analytics, models
- Circles completion (2 tasks): challenges, milestones — all 20 circle endpoints covered
- ActivityService (2 tasks): GPS activity CRUD with live tracking, activity models
2026-03-13¶
backend-api — BE-001: Add unique constraint for health metrics dedup¶
- Commit:
0b4b585 - Branch:
feature/BE-001-health-metrics-unique-constraint - Task: BE-001 — 1.1 Device Sync — Deduplication
- Details:
- Added migration
051_health_metrics_dedup.sql - Replaced old index
(device_id, metric_type, measured_at)with(user_id, device_id, metric_type, measured_at) - Duplicate health metrics now rejected at DB level
backend-api — BE-002: Handle duplicate metrics in sync handlers¶
- Commit:
0818360 - Branch:
feature/BE-001-health-metrics-unique-constraint - Task: BE-002 — 1.1 Device Sync — Deduplication
- Details:
- All INSERT queries now use
ON CONFLICT (user_id, device_id, metric_type, measured_at) DO NOTHING - Bulk sync response includes
{ inserted, skipped, failed }counts - Single-metric endpoints return 409 Conflict for duplicates
- Device
record_device_metrichandler also updated
backend-api — BE-003: Dedup integration tests¶
- Commit:
3dffa41 - Branch:
feature/BE-001-health-metrics-unique-constraint - Task: BE-003 — 1.1 Device Sync — Deduplication
- Details:
- Added
tests/dedup_sync_tests.rs - Tests bulk sync: 50 metrics inserted, same 50 skipped on second call
- Tests single-metric: returns 409 Conflict on duplicate
backend-api — BE-004 + BE-005: Field-level validation with partial success¶
- Commit:
bc5aac0 - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-004, BE-005 — 1.2 Device Sync — Bulk Validation
- Details:
- Added
validate.rsmodule with range checks for all metric fields - HR: 20-300, SpO2: 0-100, steps >= 0, temp: 30-45, HRV: 0-500, etc.
- Bulk sync: invalid metrics rejected with per-field errors, valid ones still inserted
- Single-metric: returns 422 with validation error details
backend-api — BE-006: Validation boundary tests¶
- Commit:
b7e46d1 - Branch:
feature/BE-001-health-metrics-unique-constraint - Task: BE-006 — 1.2 Device Sync — Bulk Validation
- Details:
- Added
tests/validation_tests.rswith 18 test cases - Min/max boundary tests for HR, SpO2, steps, sleep, temperature, HRV
- Bulk partial success test: 10 metrics, 2 invalid, 8 inserted
backend-api — BE-007/008/009/010: Device sync status tracking¶
- Commit:
c809068 - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-007, BE-008, BE-009, BE-010 — 1.3 Device Sync — Status Tracking
- Details:
- last_sync_at and connection_status updated on every sync (device + bulk endpoints)
- Added sync_count column (migration 052), incremented per sync
- Background task auto-disconnects devices idle 30+ min (runs every 5 min)
backend-api — BE-011/012/013: Device registration improvements¶
- Commit:
ce0da8c - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-011, BE-012, BE-013 — 1.4 Device Registration
- Details:
- UPSERT already existed; verified working correctly
- Registration response now includes
is_new: true/falseflag - Auto-detects device_type from name: "X3B" → ring, "JVC" → band, "GODZILLA" → station
- Added ring/band/station/unknown to valid device types
backend-api — BE-014/015/016: Historical backfill support¶
- Commit:
925aea3 - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-014, BE-015, BE-016 — 1.5 Historical Backfill
- Details:
- Increased bulk sync limit from 100 to 5000 (413 for >5000)
- Added
is_backfillflag to skip real-time alerts for old data - Backfill progress tracked in device meta (backfill_status, points_received)
- Added PayloadTooLarge error variant (HTTP 413)
backend-api — BE-017/018/019/020: Health Summary API improvements¶
- Commit:
3333943 - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-017, BE-018, BE-019, BE-020 — 1.6 Health Summary API
- Details:
- Steps aggregated as SUM, HR as AVG for daily summary
- Added sleep duration, sleep_score, deep/REM minutes to summary
- Added total_calories and active_minutes (both summed)
- Empty data returns 200 with nulls and
has_data: falseinstead of errors
backend-api — BE-021/022/023/024: Health Dashboard scores and trends¶
- Commit:
cf7f931 - Branch:
feature/BE-001-health-metrics-unique-constraint - Tasks: BE-021, BE-022, BE-023, BE-024 — 1.7 Health Dashboard API
- Details:
- Readiness score (0-100) based on sleep, resting HR, HRV
- Strain score (0-21 WHOOP-style) based on HR zones
- Recovery score (0-100) from HRV, resting HR, sleep quality
- Data sufficiency check: requires ≥3 days, returns "Insufficient Data" otherwise
- Trend arrows comparing today vs yesterday (up/down/stable with delta)
backend-api — BE-025/026/027: Structured sleep data, 7-day trend, and insights¶
- Commit:
550130c - Branch:
feature/BE-025-structured-sleep-data - Tasks: BE-025, BE-026, BE-027 — 1.8 Sleep Analysis API
- Details:
- Structured sleep data with stages (awake, light, deep, REM), sleep_score, total_duration, efficiency
- 7-day sleep trend endpoint returns daily score/duration/deep_minutes; missing nights as null
- Sleep insights generation with contextual text (e.g., "deep sleep increased 15%")
backend-api — BE-028/029/030: Daily, weekly, and monthly activity rollups¶
- Commit:
5d50220 - Branch:
feature/BE-028-daily-activity-rollup - Tasks: BE-028, BE-029, BE-030 — 1.9 Activity Metrics API
- Details:
- Daily activity rollup: steps, distance_km, calories, active_minutes, floors
- Weekly rollup: 7 daily summaries + weekly_total sums
- Monthly rollup: daily summaries for current month + monthly_total; missing days as nulls
backend-api — BE-031/032/033: Pattern detection, anomaly detection, and graceful empty response¶
- Commit:
e466db7 - Branch:
feature/BE-031-pattern-detection - Tasks: BE-031, BE-032, BE-033 — 1.10 Health Insights API
- Details:
- Pattern detection using Pearson correlation (sleep vs HRV, etc.) with confidence scores
- Graceful empty response for <7 days data: returns
{ patterns: [], message: "..." }with 200 - Anomaly detection flags unusual readings (e.g., resting HR 15% above baseline)
backend-api — BE-034/035/036/037/038/039/040: Coach-client permission enforcement¶
- Commit:
f3217db - Branch:
feature/BE-034-enforce-can-view-health - Tasks: BE-034, BE-035, BE-036, BE-037, BE-038, BE-039, BE-040 — 1.11 Coach-Client Permissions
- Details:
- Enforced all 6 permission flags:
can_view_health,can_view_body,can_view_workouts,can_view_food,can_view_devices,can_view_goals - Each flag gates the corresponding coach-client data endpoint (403 when denied, 200 when allowed)
- Integration test validates all 6 flags with true/false combinations
backend-api — BE-041/042/043/044/045: Live session lifecycle¶
- Commit:
3d7dff3 - Branch:
feature/BE-041-create-session - Tasks: BE-041, BE-042, BE-043, BE-044, BE-045 — 1.12 Live Session Lifecycle
- Details:
- Create session with past date validation (422 for past dates)
- Start session handler: scheduled → live transition, sets
started_at - Join session validation: live status + capacity check (409 when full)
- End session handler: live → ended, sets
ended_at, calculates duration - Duplicate reservation returns 409 Conflict
backend-api — BE-046/047: Agora token validation improvements¶
- Commit:
042bc2e - Branch:
feature/BE-046-agora-token-generation - Tasks: BE-046, BE-047 — 1.13 Agora Token Generation
- Details:
- Non-participants receive 403 Forbidden when requesting Agora token
- Duration-based token expiry: session duration + 30 min buffer
backend-api — BE-048 through BE-063: Coach managed clients, portal, and push notifications¶
- Tasks: BE-048–BE-052 (1.14 Coach Managed Clients), BE-053–BE-057 (1.15 Coach Portal Endpoints), BE-058–BE-063 (1.16 Push Notifications)
- Details:
- Managed clients: CRUD for offline clients, coach-logged health metrics
- Coach portal: intake forms CRUD, client journey timeline, messaging, billing, notes
- Push notifications: FCM token registration/invalidation, FCM send function, health alerts (abnormal HR/SpO2), session reminders (30 min before), sync reminders (no sync in 24h)
- Already implemented in existing codebase; verified and marked complete
backend-api — BE-064/065/066/067/068/069/070/071/072: GPS activity tracking with live support¶
- Commit:
3538529 - Branch:
feature/BE-064-activities-table - Tasks: BE-064, BE-065, BE-066, BE-067, BE-068, BE-069, BE-070, BE-071, BE-072 — 1.17 GPS Activity Tracking (Running/Cycling)
- Details:
- Activities table migration with full schema (type enum, GPS route as JSONB, summary, meta)
- Create activity endpoint with route validation and auto-calculated pace/speed
- List activities (paginated, route excluded for performance)
- Activity detail with full route for map display
- Soft delete activity (204 response)
- Activity stats: total distance, counts, weekly/monthly breakdowns, personal bests
- Live GPS point streaming (single or batched up to 50 points)
- Start live activity (status=in_progress) and finish with auto-calculations (distance, pace, elevation, calories)