Implement TASK-015 metadata-driven exercise logging

This commit is contained in:
rob
2026-11-04 22:22:26 +00:00
parent 669bfc3910
commit 9c0e82037f
31 changed files with 1537 additions and 416 deletions
+25 -18
View File
@@ -4,7 +4,7 @@ This file holds accepted, scoped implementation work. It is not a speculative ba
## Proposed implementation sequence
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through TASK-003 and TASK-012–TASK-013 are complete; TASK-014 is complete following Captain acceptance on 2026-11-04; TASK-006 is superseded; TASK-005 and TASK-008 are accepted; TASK-015 is scoped and awaiting implementation approval; TASK-016 is accepted for planning only; the remaining tasks are proposed. Implement one task per isolated branch/worktree under `docs/WORKFLOW.md`. Preserve the documented initial programme, including optional/ranged prescriptions and distinct session types. TASK-013 supersedes the dog-walk reference added by TASK-012; TASK-014 supersedes timer work.
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through TASK-003 and TASK-012–TASK-013 are complete; TASK-014 is complete following Captain acceptance on 2026-11-04; TASK-006 is superseded; TASK-005 and TASK-008 are accepted; TASK-015 is Complete following Captain acceptance on 2026-11-04; TASK-016 is accepted for planning only; the remaining tasks are proposed. Implement one task per isolated branch/worktree under `docs/WORKFLOW.md`. Preserve the documented initial programme, including optional/ranged prescriptions and distinct session types. TASK-013 supersedes the dog-walk reference added by TASK-012; TASK-014 supersedes timer work.
### TASK-001: Application foundation and responsive shell
@@ -47,7 +47,7 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Acceptance criteria: Every seeded exercise opens a useful detail view; missing images have accessible placeholders; no hotlinked images or invented technique guidance.
- Relevant areas: Exercise library, detail UI, tests.
- Required validation: Detail and accessibility tests, offline asset check, responsive visual check.
- Non-goals: Producing final illustrations or logging notes.
- Non-goals: Producing final illustrations or logging notes. TASK-015 supplies the expandable detail shell and missing-content placeholders; this task owns reviewed content/detail extensions.
- Dependencies or blockers: TASK-002 and TASK-003; detailed technique text requires reviewed source/content.
### TASK-005: Extended workout recording
@@ -59,7 +59,7 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Relevant areas: IndexedDB adapter, domain model, recording UI, tests.
- Required validation: IndexedDB integration tests, migration/error cases, load-component and hang reload checks, partial-session checks, build.
- Non-goals: Progress charts, routine editor, backup UI.
- Dependencies or blockers: TASK-002, TASK-003, and TASK-014. The owner narrowed logging to EMOM totals and per-set reps/weight on 2026-10-27; further load and hang details remain accepted from earlier requests.
- Dependencies or blockers: TASK-014 and TASK-015. TASK-015 now owns metadata-driven load/count/side/duration/hang recording, completion and previous-session suggestions. TASK-005 retains notes, optional body weight and other extended recording without duplicating TASK-015.
### TASK-006: Timers during and between exercises
@@ -87,8 +87,8 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Status: Accepted
- Objective: Browse actual dated performance and transparent basic trends without a time-based rate.
- Scope: Completed/partial session history, prior vs current performance, reps and load trends, total external-load volume from recorded EMOM totals and regular sets, longest continuous and cumulative hang separately, optional body-weight trend.
- Acceptance criteria: External-load volume is the sum, across recorded regular sets and EMOM totals, of actual reps multiplied by recorded external kilograms moved (vest, dumbbell total based on count, and/or EZ-bar total; body weight excluded). Show the formula and raw totals; label partial workouts and incomplete load data. Timed-only work contributes no rep-load volume; routine edits leave history intact. Do not show volume per minute.
- Scope: Completed/partial session history, prior vs current performance, reps and load trends, total external-load volume from completed detailed minute/set rows and separately preserved legacy aggregates, longest continuous and cumulative hang separately, optional body-weight trend.
- Acceptance criteria: External-load volume is the sum, across completed detailed regular sets and each EMOM minute, of actual reps multiplied by recorded external kilograms moved (vest, dumbbell total based on count, and/or EZ-bar total; body weight excluded). Do not combine detailed and legacy representations for the same performance. Show the formula and raw totals; label partial workouts and incomplete load data. Timed-only work contributes no rep-load volume; routine edits leave history intact. Do not show volume per minute.
- Relevant areas: Queries/aggregations, history/progress UI, tests.
- Required validation: Calculation and view tests with mixed loading modes, missing weights, partial workouts, and timed-only exercises; responsive check.
- Non-goals: Coaching, calorie estimates, streaks.
@@ -103,7 +103,7 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Relevant areas: Backup format, storage transaction, settings UI, tests.
- Required validation: Full round trip in a fresh profile, invalid/old-version tests, transaction rollback test.
- Non-goals: Cloud synchronization or CSV export.
- Dependencies or blockers: TASK-005 and TASK-007; decide precise merge conflict behavior before implementing merge.
- Dependencies or blockers: TASK-015 supplies the tested JSON v2/v1 adapter; TASK-005/TASK-007 extend future stored content. User-facing preview/confirmation/conflict policy remains this task, with no automatic merge acceptance.
### TASK-010: Offline release and full UX verification
@@ -172,18 +172,19 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
### TASK-015: Exercise equipment specifications and context-aware UI
- Status: Accepted for scoping; awaiting Captain approval before implementation
- Lock-on: Captain selected TASK-015 for briefing on 2026-11-04 after accepting TASK-014. Implementation has not begun; timer scope and Git arrangement remain unresolved.
- Brief refreshed: 2026-11-04. This is the existing matching task, expanded rather than duplicated. No application implementation is authorized by this planning turn.
- Status: Complete
- Engaged: 2026-11-04 on `task/015-equipment-ui` from clean `codex` commit `669bfc3`. Timer-free. Focused UI brief: `docs/TASK-015_UI.md`.
- Lock-on: Captain selected TASK-015 for briefing on 2026-11-04 after accepting TASK-014. This was a briefing only; the subsequent ADR-018/engage instruction resolved timer/Git gates.
- Brief refreshed: 2026-11-04. This is the existing matching task, expanded rather than duplicated. Initial planning was documentation-only; subsequent engagement authorized implementation.
- Objective: Separate exercise capabilities, workout prescriptions, and actual performance, and use equipment/measurement metadata to drive a compact exercise interface.
#### Scope and boundaries
1. Add versioned equipment and measurement metadata to all 30 current exercise definitions, following the assignment matrix in `WORKOUT_ROUTINE.md`'s TASK-015 planning addendum. Supported equipment vocabulary: bodyweight, weighted vest, dumbbell(s), EZ curl bar, straight bar. No exercise is assigned a straight bar by this request; support the type without adding exercises. Multiple equipment types may be used simultaneously. Deep-push-up dumbbells are support handles, excluded from lifted load.
1. Add versioned equipment and measurement metadata to all 30 current exercise definitions, following the assignment matrix in `WORKOUT_ROUTINE.md`'s equipment assignment matrix. Supported equipment vocabulary: bodyweight, weighted vest, dumbbell(s), EZ curl bar, straight bar. No exercise is assigned a straight bar by this request; support the type without adding exercises. Multiple equipment types may be used simultaneously. Deep-push-up dumbbells are support handles, excluded from lifted load.
2. Remove fixed resistance from exercise capabilities. Retain prescription targets separately, and record actual equipment-specific resistance independently for each set/minute. Dumbbell entry is kilograms per dumbbell with count represented explicitly; EZ/straight-bar entry is total kilograms including the bar. Zero is valid where additional resistance is supported; blank is not an inferred zero.
3. Define repetitions, repetitions per side, duration, duration per side, distance where appropriate, and EMOM repetitions per minute. Preserve existing rep/set ranges, order, optional exercises, and unspecified targets. Carries currently prescribe duration per side; do not invent a distance target. Bird-dog and other unilateral holds allow actual seconds per side without inventing prescribed times.
4. Replace prescription-load-key-driven fields with reusable metadata-driven controls. Support independent set completion, partial drafts, per-set loads, EMOM minute rows, duration attempts, previous matching session suggestions, and existing next-set load defaults. Suggestions are editable drafts, never automatically performed/completed records. Match by exercise, period, format, measurement/side semantics, and compatible equipment; do not suggest future sessions, reinterpret legacy totals, or overwrite current-date work.
5. Compact cards show name, target sets/reps/duration, relevant equipment and rest guidance; actual entry is distinct. Use shared field headings on desktop with accessible row labels, stacked controls on mobile, and expandable details for available instructions, muscles, technique notes and local images/placeholders. Review this proposal through Frontend UI Design before code. Keep Today/Week navigation, exclusive Morning/Afternoon switching, local clock and editable hang goal. Timer behavior requires the decision below.
5. Compact cards show name, target sets/reps/duration, relevant equipment and rest guidance; actual entry is distinct. Use shared field headings on desktop with accessible row labels, stacked controls on mobile, and expandable details for available instructions, muscles, technique notes and local images/placeholders. Review this proposal through Frontend UI Design before code. Keep Today/Week navigation, exclusive Morning/Afternoon switching, local clock and editable hang goal. Timer-free behavior follows ADR-018.
6. Daily hang is bodyweight-only with an initial editable 120-second continuous target, actual seconds per attempt, optional additional attempts, longest continuous and total duration separately. Never infer success from cumulative duration or prefill 120 as achieved. Keep Saturday weighted finger hangs distinct.
7. Preserve old records, load interpretation, hang-goal overrides and any local plan edits through versioned storage/record upgrades. Define and test versioned JSON serialization and legacy import compatibility at the adapter boundary; the Settings backup interface and merge policy remain TASK-009.
8. Update SPEC, WORKOUT_ROUTINE, relevant decisions, data README, tasks/current state and handoff with approved requirements, schema rules, validation and Captain acceptance evidence.
@@ -195,7 +196,7 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Bulgarian split squats and all four specified mixed leg exercises support separate vest and dumbbell values. Different sets and EMOM minutes retain different loads after save/reload/date navigation, including explicit zero. Dumbbell counts and bar-inclusive totals produce correct saved external load.
- Rep exercises show reps or reps per side as appropriate; timed exercises show seconds or seconds per side without requiring reps. Carry distance is supported only when relevant metadata selects it. Finger-hang duration remains unspecified as a target.
- EMOM supports ten minute-by-minute rep/load entries, partial rounds and derived totals. Legacy aggregate EMOM records remain aggregate, available without invented minute allocations. No default targets become actuals; mixed-load volume, if calculated, uses the sum of each minute's reps times its own load, never total reps times one assumed weight.
- Completion is an explicit action independent of entering/suggesting values. Partial records survive reload; previous-session prefills and next-set defaults do not mark work complete or write records on browsing.
- Completion follows successful explicit Save, not a separate checkbox: fully filled valid rows complete, incomplete rows stay drafts. Partial records survive reload; previous-session prefills and next-set defaults do not mark work complete or write records on browsing.
- Daily hang attempts preserve actual seconds independently, compute longest and cumulative totals, and compare the continuous target to the longest attempt. Editable goal persists independently; unilateral isometric logging requires neither reps nor invented duration targets.
- Metadata/prescription changes, reseeding and upgrades leave existing actuals and historical load semantics unchanged. Test old total-only and component sets/EMOM, v1 hang-goal-only database and v2 database, unknown historical equipment, blocked/unavailable storage and failed transaction rollback. No legacy total is decomposed or per-minute load fabricated.
- Versioned JSON round trips restore both old and new records and relevant definition/prescription context; old versions are accepted through explicit adapters and invalid/unsupported input leaves data unchanged. No claim that old app binaries can read new records is required.
@@ -205,9 +206,9 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
#### Inspected implementation and likely affected files
- `src/data/exerciseDefinitions.json`: currently only IDs/names/categories; add equipment, measurement, support-role and version metadata.
- `src/data/initialRoutine.json`, `src/data/index.js`, `src/data/README.md`, `src/data/initialRoutine.test.js`: versioned prescription seed (currently v7), target/load separation and assignment invariants.
- `src/data/initialRoutine.json`, `src/data/index.js`, `src/data/README.md`, `src/data/initialRoutine.test.js`: versioned prescription seed (now v8), target/load separation and assignment invariants.
- `src/App.jsx`, `src/StrengthEntryEditor.jsx`, `src/HangGoalEditor.jsx`, `src/routineView.js`, `src/strengthLoad.js`, `src/styles.css`: exercise cards, metadata selectors, reusable set/minute/attempt fields, details and responsive layout; add focused domain/components as needed rather than hardcoding exercise IDs.
- `src/localDatabase.js`, `src/strengthStorage.js`, `src/hangGoalStorage.js` and their tests: versioned reads/writes, new performance shapes, compatible prior-session queries, historical context and overrides. Current strength validation accepts repetition sets, weight-only `load-sets`, and aggregate EMOM. The editor derives fields from prescription `load` keys; it cannot store actual duration/side/attempt/completion/minute data yet. TASK-014 already supplies suitcase-carry weight-only sets and vest inputs for front planks/side-plank hip raises; preserve those behaviors while replacing the exercise-ID exceptions with metadata.
- `src/localDatabase.js`, `src/strengthStorage.js`, `src/hangGoalStorage.js` and their tests: versioned reads/writes, new performance shapes, compatible prior-session queries, historical context and overrides. Legacy strength validation retains repetition sets, weight-only `load-sets` and aggregate EMOM. New PerformanceEditor/model/storage support actual duration/side/attempt/completion/minute data from metadata. The old editor remains available only for explicitly editing original-format records.
- `src/App.test.jsx`, `src/StrengthEntryEditor.test.jsx`, `src/routineView.test.js` and new focused metadata/storage/serialization tests.
- Documentation listed above; future TASK-009 consumes the serialization contract. No export/import implementation exists today.
@@ -215,19 +216,25 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
1. Approve unresolved timer/Git decisions and UI brief; reconcile task ownership below. Establish a safe dedicated task worktree from the agreed base without losing current uncommitted prerequisites.
2. Define separate versioned exercise capabilities, prescriptions and performance records. New records retain actual units, side, equipment/count and sufficient definition/prescription context for historical interpretation. Review whether old preset weights remain optional prescription information; never use them to generate actual loads or capabilities.
3. Add metadata and audited seed updates, then a versioned performance reader/writer with legacy adapters. IndexedDB is currently version 2 with `routineOverrides` and `strengthEntries`, keyed by date/exercise. Record schema versioning is needed; an IndexedDB version bump is required only if stores/indexes change. Prefer additive storage and preserving legacy records verbatim; decide exact stores/indexes after schema review. Test before integrating UI.
3. Add metadata and audited seed updates, then a versioned performance reader/writer with legacy adapters. The initial baseline was IndexedDB v2. The implemented v3 adds performanceEntries and its compound index while retaining routineOverrides and strengthEntries verbatim. New detailed records use schemaVersion 1 and saved definition/prescription snapshots. Test before integrating UI.
4. Build reusable card/measurement/load/row/detail components; add minute and duration flows plus compatible prior-session lookup. Apply the focused layout proposal, preserving the existing visual language.
5. Add JSON codec/version compatibility fixtures, regression tests and browser QA; update context and hand off an exact testable representation. No repository testtask adapter currently exists; recheck at handoff.
#### Dependencies, decisions and implementation gate
- TASK-014 is Complete following Captain acceptance on 2026-11-04; its uncommitted dated-load implementation is the technical baseline. No separate application work starts in this turn.
- TASK-014 is Complete following Captain acceptance on 2026-11-04; its committed dated-load implementation in codex 669bfc3 is the technical baseline.
- TASK-015 owns metadata, applicable per-side/duration/hang logging, completion and previous-session suggestions requested here, replacing the overlapping portions of TASK-005 when engaged. TASK-005 retains notes, optional body weight and other unrelated extended recording. TASK-004 supplies reviewed detail content; TASK-015 can provide the expandable shell and honest missing-content placeholders without waiting for TASK-011's final illustrations. TASK-008 consumes the new performance shapes; TASK-009 owns backup UI/import policy. Do not duplicate those features.
- **Timer decision resolved (2026-11-04):** Captain selected timer-free behavior. Keep only the wall clock and prescribed rest/EMOM guidance; no timers/audio return (ADR-018).
- **Git decision resolved (2026-11-04):** Captain authorized committing existing work and merging it into local `codex` before implementation. Create TASK-015 branch from that clean integration baseline per ADR-018 and WORKFLOW. Do not merge TASK-015 without further authority.
- The current explicit request resolves earlier planning questions: minute-by-minute EMOM is required (derived totals supplement it; existing aggregate history stays aggregate); isometric duration means actual logging, not prescribed hold targets; daily hang goal means continuous; dog walks are bodyweight-only classification context without authorized restoration of removed app screens/records. No fixed vest values enter definitions. These do not require repeated approval.
- Non-goals: unrelated redesign, new exercises, fabricated technique content/assets, dog-walk UI/logging, calorie calculations, routine editor, full history/backup UI, volume per minute, merge or deployment.
- Recommended skills when approved: Frontend UI Design → Webapp Feature → Frontend Visual QA → Code Review. No implementation or visual QA has run for TASK-015.
- Skills applied: Frontend UI Design, Webapp Feature, Frontend Visual QA availability check and Code Review of tracked/untracked task changes against codex. Browser inventory remained empty; no visual pass is claimed.
- Captain correction (2026-11-04): Remove all completion checkboxes; successful Save completes fully filled valid rows and retains incomplete drafts. Suggestions, browsing and failed saves do not create achieved performance.
- Captain correction (2026-11-04): Remove the count input from all exercises; retain definition defaults for new rows and preserve recorded historical counts internally for load calculations.
- Earlier Captain correction (2026-11-04): Floor flys always use two dumbbells. Hide their count control, retain kilograms per dumbbell and a fixed count of two in new records/calculations. Preserve original snapshot counts in existing records.
- Implementation evidence (2026-11-04): Metadata and seed v8, reusable detailed editor, left/right actuals, minute EMOM/conventional sets, load/count and completion, hang totals, compatible previous-session lookup, expandable details, additive IndexedDB v3 and JSON adapter v2/v1 are implemented. Original stores/records remain intact. Reviewed against codex 669bfc3; no unrelated theme/history/backup UI changes. All 129 tests across 11 files, lint, build, context validation (0 warnings) and whitespace checks pass on 2026-11-04. Exact Captain checklist is in HANDOFF. Captain subsequently authorized task commit/merge to local codex on 2026-11-04; no push/deployment authorized.
- Completion evidence (2026-11-04): Captain explicitly confirmed “task complete” after removal of all dumbbell-count inputs and completion checkboxes. Final checks passed 129 tests across 11 files, lint, build, context validation and whitespace checks. Agent browser QA was unavailable; Captain acceptance is recorded without claiming a separate agent visual pass. Captain subsequently explicitly authorized committing and merging this accepted task into local codex on 2026-11-04. No push or deployment is authorized.
### TASK-016: Apply a consistent dark theme
@@ -239,7 +246,7 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through T
- Relevant areas: `src/styles.css`, `src/main.jsx`, `src/App.jsx`, shared React-Bootstrap configuration, strength/hang editors where required, existing interaction tests and `docs/SPEC.md`. No workout data or IndexedDB migration is expected.
- Proposed approach: Inspect current UI and approve a restrained dark palette; centralize semantic colors for surfaces/text/borders/accent/status/focus; apply the supported Bootstrap dark theme plus local tokens; inspect all controls and states in the browser and correct contrast or native-control mismatches. Preserve existing green identity where contrast permits.
- Required validation: Mobile (including 320px) and desktop browser review across all sections and both workout periods; keyboard/focus and measured contrast checks; input, disabled, saved and error-state review; existing test suite, lint, build, context validation and `git diff --check`; Captain visual acceptance before Complete. Avoid tests that merely duplicate CSS declarations.
- Dependencies or blockers: Resolve the existing dirty-checkout/base/worktree arrangement under WORKFLOW before implementation. Coordinate styling with TASK-015 if it proceeds first; neither task requires implementing the other's behavior. No new app behavior is authorized here.
- Dependencies or blockers: Use the approved codex base and a clean dedicated task branch under WORKFLOW; TASK-015 currently occupies the sole worktree. Coordinate styling with TASK-015; neither task requires implementing the other's behavior. No new app behavior is authorized here.
- Non-goals: New layouts, unrelated UX redesign, light-mode variants, a theme picker, OS-theme switching, new settings or persistent preferences, and changes to workout definitions/storage/timers.
- Decisions required before implementation: Review the exact palette through the UI brief; default scope is a single dark theme. A light/dark switch would require separately approved scope.
- Recommended skills when engaged: Frontend UI Design → Webapp Feature → Frontend Visual QA. This record does not authorize implementation.