What is the Fitness MVP? #60

Closed
opened 2026-11-23 16:05:25 -05:00 by bobby · 1 comment
Owner

Part of #44

Question

What does the fitness domain need at MVP: core entities (workouts, exercises, body metrics?), the first endpoints/flows, how data gets in (manual, Bots, device integrations later), and what is explicitly deferred?

Part of #44 ## Question What does the fitness domain need at MVP: core entities (workouts, exercises, body metrics?), the first endpoints/flows, how data gets in (manual, Bots, device integrations later), and what is explicitly deferred?
bobby added the wayfinder:grilling label 2026-11-23 16:05:25 -05:00
bobby added a new dependency 2026-11-23 16:05:35 -05:00
bobby self-assigned this 2026-11-25 12:25:25 -05:00
Author
Owner

Resolution: Fitness MVP

Fitness in v1 is a hand-logged record of Workouts and body Measurements, one set per Person. It's greenfield: lifting is on pen and paper today, and cardio lives on an Apple Watch or Garmin. There's no historical import. Terms are in GLOSSARY.md → Fitness.

Ownership (ADR-0001 / ADR-0005 applied)

  • Workouts and Measurements are Personal data, one set per Person. There's no Household Fitness data apart from the Exercise catalog. A Person who isn't a Household member uses Fitness on the same terms but sees only their own Personal Exercises.
  • Exercises follow the Finance Category pattern: Household Exercises are usable by every Household member, and Personal Exercises only by their Person. A data migration seeds a starter set of Household Exercises. An entry in a Personal Workout points at a shared definition, so the Workout never changes owner.
  • Bots reach Fitness through ordinary fitness:read|write Bindings. None ship in v1.

Entities

  • Exercise: name; owner; archived; kind strength|bodyweight|timed|cardio. The kind decides what an entry records.
    • Lifecycle: create, rename, archive, merge A→B (same kind only: A's entries move to B, then A is archived), promote Personal → Household (one way).
    • The kind is frozen once a Workout uses the Exercise. An Exercise in use can't be hard-deleted (archive it instead). An unused one can.
    • A Person may merge their own Personal Exercise, or one Household Exercise into another (equal access). They can never merge another Person's Personal Exercise.
  • Workout: performed_on (required local date; a paper log often has no times); optional started_at and duration_s; note; optional external_id (unique per Person); recorded_by. It holds ordered entries[], and each entry has an exercise_id plus:
    • sets[] for strength, bodyweight, and timed Exercises. A Set has reps, load_g (added load for bodyweight), duration_s (timed), optional rpe, and a warmup flag (warmups are excluded from bests).
    • cardio{} for cardio Exercises: duration_s (required), distance_m (optional), and avg_hr_bpm (optional). Pace is computed on read.
    • A run is a Workout with one cardio entry. There's no separate Activity entity.
  • Measurement: kind from a fixed enum (body_weight, body_fat_pct, waist, chest, arm, thigh; extended by migration); an integer value in the kind's base unit (g, mm, hundredths of a percent); measured_on (required); optional measured_at; optional external_id; recorded_by.
  • Units: SI integers throughout (g, m/mm, s), the same way Finance uses cents. Display units are a client concern. "Entry" is an API shape, not a glossary term.

Getting data in

  • Persons call the API directly from a script, an iOS Shortcut, or by transcribing the paper log. A whole Workout is created in one POST, with every entry and Set in the body. No client ships in v1.
  • Idempotent creates: POSTs for Workouts and Measurements take an optional external_id. A repeat returns 200 with the existing record, so a retry on flaky gym wifi doesn't double-log. The v2 wearable importer reuses the same key. There's no separate ingest endpoint in v1.
  • Editing is plain REST: every record is hand-entered, so there's no imported source of truth to protect and no dismiss.

API surface (flat, /v1/fitness/..., owner + recorded_by on every record)

  • exercises: CRUD (delete only if unused), archive, /{id}/merge, /{id}/promote, /{id}/history (past Sets or cardio efforts plus the best non-warmup Set by load and by reps, computed on read, nothing stored).
  • workouts: list (filters: date range, Exercise; sorted by performed_on, then started_at), create whole, GET, PUT (replaces the whole Workout including entries), PATCH (top-level fields only), DELETE (hard).
  • measurements: list (filters: kind, date range), create, PATCH, DELETE (hard).

Deferred to Fitness v2

Templates, routines, programs, and goals; richer records (estimated 1RM, PR feeds); wearable import (Garmin/Apple Watch importer Bot reusing external_id, plus calories, elevation, splits, and GPS); daily aggregates (steps, sleep, resting HR, HRV); scheduling and notifications (workout reminders, "no weigh-in for 7 days" nudges); drop sets, supersets, and tempo. Nutrition is a separate future domain. Fitness v1 adds nothing to the map's Scheduling or ntfy fog.

No ADR: nothing here is hard to reverse, and shared Exercises follow the Finance Category precedent.

## Resolution: Fitness MVP Fitness in v1 is a **hand-logged record of Workouts and body Measurements**, one set per Person. It's greenfield: lifting is on pen and paper today, and cardio lives on an Apple Watch or Garmin. There's no historical import. Terms are in `GLOSSARY.md` → *Fitness*. ### Ownership (ADR-0001 / ADR-0005 applied) - **Workouts and Measurements are Personal data**, one set per Person. There's no Household Fitness data apart from the Exercise catalog. A Person who isn't a Household member uses Fitness on the same terms but sees only their own Personal Exercises. - **Exercises** follow the Finance Category pattern: **Household Exercises** are usable by every Household member, and **Personal Exercises** only by their Person. A data migration seeds a starter set of Household Exercises. An entry in a Personal Workout *points at* a shared definition, so the Workout never changes owner. - Bots reach Fitness through ordinary `fitness:read|write` **Bindings**. None ship in v1. ### Entities - **Exercise**: name; owner; archived; **kind** `strength|bodyweight|timed|cardio`. The kind decides what an entry records. - Lifecycle: create, rename, archive, **merge** A→B (same kind only: A's entries move to B, then A is archived), **promote** Personal → Household (one way). - The kind is **frozen once a Workout uses the Exercise**. An Exercise in use can't be hard-deleted (archive it instead). An unused one can. - A Person may merge their own Personal Exercise, or one Household Exercise into another (equal access). They can never merge another Person's Personal Exercise. - **Workout**: `performed_on` (required local date; a paper log often has no times); optional `started_at` and `duration_s`; note; optional `external_id` (unique per Person); `recorded_by`. It holds ordered `entries[]`, and each entry has an `exercise_id` plus: - `sets[]` for strength, bodyweight, and timed Exercises. A **Set** has `reps`, `load_g` (added load for bodyweight), `duration_s` (timed), optional `rpe`, and a `warmup` flag (warmups are excluded from bests). - `cardio{}` for cardio Exercises: `duration_s` (required), `distance_m` (optional), and `avg_hr_bpm` (optional). Pace is computed on read. - A run is a Workout with one cardio entry. There's no separate Activity entity. - **Measurement**: kind from a fixed enum (`body_weight`, `body_fat_pct`, `waist`, `chest`, `arm`, `thigh`; extended by migration); an integer value in the kind's base unit (g, mm, hundredths of a percent); `measured_on` (required); optional `measured_at`; optional `external_id`; `recorded_by`. - **Units:** SI integers throughout (g, m/mm, s), the same way Finance uses cents. Display units are a client concern. "Entry" is an API shape, not a glossary term. ### Getting data in - Persons call the API directly from a script, an iOS Shortcut, or by transcribing the paper log. **A whole Workout is created in one POST**, with every entry and Set in the body. No client ships in v1. - **Idempotent creates:** POSTs for Workouts and Measurements take an optional `external_id`. A repeat returns `200` with the existing record, so a retry on flaky gym wifi doesn't double-log. The v2 wearable importer reuses the same key. There's no separate `ingest` endpoint in v1. - **Editing is plain REST:** every record is hand-entered, so there's no imported source of truth to protect and no dismiss. ### API surface (flat, `/v1/fitness/...`, `owner` + `recorded_by` on every record) - `exercises`: CRUD (delete only if unused), archive, `/{id}/merge`, `/{id}/promote`, `/{id}/history` (past Sets or cardio efforts plus the best non-warmup Set by load and by reps, computed on read, nothing stored). - `workouts`: list (filters: date range, Exercise; sorted by `performed_on`, then `started_at`), create whole, `GET`, `PUT` (replaces the whole Workout including entries), `PATCH` (top-level fields only), `DELETE` (hard). - `measurements`: list (filters: kind, date range), create, `PATCH`, `DELETE` (hard). ### Deferred to Fitness v2 Templates, routines, programs, and goals; richer records (estimated 1RM, PR feeds); **wearable import** (Garmin/Apple Watch importer Bot reusing `external_id`, plus calories, elevation, splits, and GPS); daily aggregates (steps, sleep, resting HR, HRV); scheduling and notifications (workout reminders, "no weigh-in for 7 days" nudges); drop sets, supersets, and tempo. Nutrition is a separate future domain. Fitness v1 adds nothing to the map's Scheduling or ntfy fog. No ADR: nothing here is hard to reverse, and shared Exercises follow the Finance Category precedent.
bobby closed this issue 2026-11-25 13:06:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#60