Cosmo · architecture audit

Health Estate Map

Every health component, where it lives, and what it talks to. Two systems, two servers, one database — Healthyst is the backend; everything else is a front door or a consumer.

Snapshot · Fri 22 May 2026
2 systems 2 servers + 1 cloud DB 3 active repos 3 archived today 6 tangles to fix
The map — how it all connects

Data flows top to bottom. Box colour shows which machine it runs on. Strava is the one true API; everything else arrives as screenshots.

DATA SOURCES FRONT DOORS — HOW DATA GETS IN BACKEND DATABASE screenshots Strava API persists Screenshot apps Withings · Renpho · Sleep Cycle Strava API · OAuth2 Cosmo Health Ingest service + PWA Hetzner cosmo-cloud box health.cosmokit.earthlingzero.com Health CLI Logging + queries local Mac Healthyst The hub — every front door reads & writes here REST API · AI coach · web · MCP server DigitalOcean prod box · healthyst.hecklerapps.com MongoDB Atlas database: healthyst · 12 collections
Hetzner cosmo-cloud DigitalOcean prod box MongoDB Atlas Local Mac Third-party
Components — in detail
1Data sources
Stravathird-party
API · OAuth2
The only real API integration. Wired in inside Healthyst.
Withings · Renpho · Sleep Cyclethird-party
body + sleep apps
No usable API path — data arrives by screenshot through Cosmo Health.
Historical exportsarchive
plans/health-journey/raw-data/
One-off dumps: Apple Health, Nike Run Club, parkrun, old MongoDB collections. Reference only, not a live feed.
↓  screenshots & the Strava API
2Front doors — how data gets in
Cosmo HealthHetzner
choujar/cosmo · services/health-ingest/
Screenshot-ingest service + the Vue PWA. Share a screenshot → Claude parses it → you confirm → it writes to Healthyst.
health.cosmokit.earthlingzero.com · systemd cosmo-health · :9210
Health CLIlocal Mac
choujar/cosmo · src/integrations/health/cli.js
Command-line logging & queries — the second front door. Also proxies the Strava commands.
↓  both read & write the same API
3Backend — the hub
HealthystDigitalOcean prod box
choujar/healthyst · /var/www/labs/healthyst
The brain. A REST API + AI coach (agent/) + web UI + an MCP server. Every front door reads and writes through here.
healthyst.hecklerapps.com · pm2 healthyst-api · Strava integration lives inside (api/services/strava.js)
↓  persists to
4Data store
MongoDB Atlascloud
database: healthyst
12 collections — sleep, activities, biometrics, meals, nutrition, notes, reflections, phases, plans, daily-activities, food-items, 75soft. The single source of truth for health data.
The knowledge map — where coaching knowledge lives

The architecture is mostly plumbing. This is the real tangle. The same coaching knowledge — your current phase, the coach's identity, your injury rules — is written down in several places at once. Red links mark knowledge that is duplicated and drifting apart.

Cosmo health skill ~/cosmo/.claude/skills/health/ The active coaching brain ACTIVE Stray skill copy ~/.claude/skills/health/ Looks like a stale full copy DUPLICATE Healthyst coach healthyst/agent/ Older coach docs + phase archives LEGACY Healthyst notes MongoDB · notes collection Injury protocols, kept as database records Health journey plans/health-journey/ ADHD analysis + the raw-data archive Cosmo memory cosmo-memory + auto-memory Persistent facts about you duplicated phase · identity · injuries injury rules
active — the keeper legacy — merge in fine as-is duplicated knowledge
The drift — same knowledge, multiple homes
!
Current phase — three answers
Healthyst coach says Phase 8. The cosmo skill says Phase 9. Reality is Phase 10.
!
Two coaching brains
Coach identity, phase context and workflows exist in both the cosmo health skill and Healthyst's /agent/ — separately maintained.
!
Injury rules in three places
Cervical-spine constraints live in the skill, in Healthyst's /agent/injuries/, and in the Healthyst notes collection.
!
A stray skill copy
A second health skill folder at ~/.claude/skills/health/ shadows the real one.
Proposed — one home for each (to discuss)
→
One coaching brain
The cosmo health skill. Healthyst goes back to being purely the API + database — no coach.
→
One current-phase file
Lives in the skill; everything else references it instead of restating it.
→
One injury-constraints doc
The MRI scan stays as a reference; the actual rules live in a single place.
→
Delete the stray skill copy
Once we have confirmed the cosmo one is complete and current.
Repositories
choujar/cosmoactivehealth-ingest service, health skill, health CLI, health-journey
choujar/healthystactivethe backend — API, AI coach, web, MCP
choujar/cosmo-memoryactivea few health topic drafts
choujar/Fitness-projectarchiveddormant since Apr 2025 — archived 22 May 2026
choujar/HealthTrackProarchiveddormant since Mar 2025 — archived 22 May 2026
choujar/healthpal-iosarchiveddormant since Feb 2025 — archived 22 May 2026
Drift & debt — what to untangle
1
Training phase tracked in three places
Healthyst's coach docs say Phase 8 (75 Soft). The cosmo health skill says Phase 9 (Comeback 5K). You're actually in Phase 10. Three sources, three answers.
2
Stale goals
Healthyst's CLAUDE.md still targets the Adelaide Half Marathon, sub-1:45, May 2026 — a cancelled race.
3
Two coaching brains
Healthyst has an /agent/ coach (phases, injuries, identity). The cosmo health skill also has coach identity, phases, workflows. Overlapping, separately maintained.
4
Two health skill folders
Both ~/cosmo/.claude/skills/health/ and ~/.claude/skills/health/ exist. The cosmo one is active; the global one is unexplained — likely a stale copy.
5
Hardcoded API key
The Healthyst API key is hardcoded in both server.mjs and cli.js instead of living in an env var.
6
Healthyst on the work production box
The Healthyst API runs on the KMZero DigitalOcean production server — a personal project sharing the work prod box. A deliberate early choice, now worth moving.
Planned moves
✓
Archive the 3 dormant repos
Done 22 May 2026 — Fitness-project, HealthTrackPro, healthpal-ios archived on GitHub.
→
Extract the ingest service into its own repo
services/health-ingest/ → choujar/cosmokit-health. The PB ledger stays in cosmo; cosmokit-health symlinks to it.
→
Move Healthyst off the work prod box
Migrate the Healthyst API onto the Hetzner cosmo-cloud box.
→
One source of truth for the training phase
Resolve the Phase 8 / 9 / 10 drift; pick one home for current-phase context.
→
API key to an env var
Pull the hardcoded Healthyst key out of server.mjs and cli.js.
→
Dedupe the health skill folder
Confirm the active skill location, remove the stale copy.
Cosmo health architecture audit · generated Fri 22 May 2026