Skip to content

Bio Bridge

Google Health API β†’ SQLite β†’ Readiness Score pipeline. Daily training readiness calculator.

Status

  • Pipeline operational, daily 6am cron sync
  • 39 tests passing (34 integration)
  • Morning briefing: Jinja2 template, trend arrows, coaching directives
  • Gemini QA completed β€” all criticals/highs fixed
  • Google Health API scope addition in progress (cloud-platform scope added, needs Health-specific scopes)

Architecture

Pixel Watch 2 / Fitbit β†’ Google Health API β†’ authenticate.py β†’ sync.py β†’ bio_bridge.db β†’ report.py

Current Data

  • 7+ days in DB (Apr 8+)
  • Only early days have real RHR+sleep data (Fitbit sync is sporadic)
  • HR, sleep, steps all flowing; weight now aggregated
  • RHR baseline needs 14 days of real data

Known Gaps

  • No HRV source β€” Pixel Watch 2 doesn't expose HRV via Google Health API
  • HR/sleep sporadic β€” Fitbit sync delays, 7-day window helps
  • sync.py monolithic β€” 461 lines, needs refactoring (deferred)
  • Health API still 403 β€” cloud-platform scope alone insufficient, needs Health-specific OAuth scopes
  • Fitbit Web API deprecation β€” Google recommends waiting until end of May 2026 for stable Health API

Key Decisions

  • 7-day sync window (up from 3) β€” catches delayed Fitbit uploads
  • Symmetric readiness scoring (old formula was biased -55/+30, now -40/+30)
  • Graduated 5-band sleep quality (was binary >110 bonus / <80 penalty)
  • force_sync=False by default, --force flag to override
  • Project-local .env first, then ~/.env fallback

QA History

  • [[Gemini QA - Bio Bridge 2026-04-14]] β€” 2 criticals + 6 highs, all resolved
  • Unique DB constraint on raw_metrics(timestamp, metric_type, source)
  • Pinned requirements.txt versions
  • Bare except β†’ except Exception
  • datetime.utcnow() β†’ datetime.now(timezone.utc)
  • Weight aggregation added to DailySummary (avg_weight_kg)
  • Named constants extracted from magic numbers

Crons

  • Daily sync: 6am (Hermes cron "Bio Bridge Daily Sync")
  • Goal review: Sundays 10am (job a08617325030)
  • [[Security Posture]]
  • [[Hermes Memory Architecture]]
  • [[Mounjaro Hypertrophy Program]]
  • [[Google Workspace Setup]]