Files
Excersise-Tracker/docs/DECISIONS.md
T

342 lines
20 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Exercise Tracker decisions
This file records durable accepted decisions. Implementation detail and temporary status belong in `PROJECT_OVERVIEW.md`, `CURRENT_STATE.md`, or `HANDOFF.md`.
## ADR-001: Repository evidence is authoritative
- Status: Accepted
- Date: 2026-10-18
### Decision
For claims about current state, current code and configuration take precedence over maintained documentation, task requirements, handoff snapshots, and assumptions from earlier chats, in that order. Conflicts are reported rather than silently resolved from stale context.
### Context
The project may be developed across multiple conversations, people, machines, or deployment checkouts; conversational context can become stale.
### Consequences
Agents inspect repository evidence before acting. Durable facts are maintained in repository documents; `HANDOFF.md` remains supplementary and replaceable.
## ADR-002: Preserve existing behavior by default
- Status: Accepted
- Date: 2026-10-18
### Decision
Existing functionality, routes, controls, permissions, data flow, and public behavior are preserved unless an accepted task or explicit user instruction requests a behavioral change. Agents do not invent product requirements or perform unrelated refactoring.
### Context
Repository work must remain reviewable and scoped.
### Consequences
Changes stay within accepted scope and avoid accidental product redesign.
## Maintenance workflow
1. Discuss/receive requirements.
2. Record important accepted durable decisions here.
3. Record accepted implementation scope and acceptance criteria in `TASKS.md`.
4. Follow `docs/WORKFLOW.md` for task isolation, implementation, validation, Captain review, and completion status.
5. Update `CURRENT_STATE.md` with verified current state.
6. Refresh `HANDOFF.md` when transferring work.
## ADR-003: Offline local application architecture
- Status: Accepted
- Date: 2026-10-18
### Decision
Build Workout Tracker with React, Vite, React-Bootstrap, and IndexedDB for persistent local data. The application has no backend, authentication, or cloud dependency.
### Context
These are explicit requirements from the project owner and `docs/SPEC.md`.
### Consequences
The UI must work from locally available data, and persistence and backup flows must remain local. Implementation details and library choices beyond the named stack remain open.
## ADR-004: Documented routine is the initial-programme authority
- Status: Accepted
- Date: 2026-10-18
### Decision
Use `docs/WORKOUT_ROUTINE.md` as the authoritative source for the initial exercise programme. Do not invent, remove, or change prescribed exercises. Use `docs/SPEC.md` for application behavior.
### Context
The project owner identified these documents as authoritative; both are now present.
### Consequences
Keep the bundled seed distinct from local edits and historical records. Resolve programme wording differences in favor of `docs/WORKOUT_ROUTINE.md` for initial prescriptions.
## ADR-005: Seed, edits, and history have separate authority
- Status: Accepted
- Date: 2026-10-18
### Decision
Bundle the documented programme as versioned seed data, initialize a new local store from it once, and preserve subsequent user edits and historical workout data through app updates. Keep exercise-library content independent from prescriptions and logs. React components access IndexedDB through a storage adapter.
### Context
`docs/SPEC.md` requires editable routines, immutable historical performance in substance, offline use, and a tested local storage boundary.
### Consequences
Routine versions and dated records require distinct identities. Reseeding and schema migrations must never silently replace user edits or completed performance.
## ADR-006: Separate workout clock and interval timer with optional audio
- Status: Superseded by ADR-014
- Date: 2026-10-25
### Decision
A manually started whole-workout elapsed clock may run alongside one exercise, rest, or EMOM timer. Changing the active exercise/rest/EMOM timer requires an explicit action. Timer use does not itself create a completed workout record. Short audible cues for approaching and actual timer transitions are optional and muted by default, with equivalent visible feedback; background audio is not guaranteed.
### Context
The owner asked to time the entire workout and to hear timer cues during exercises where the screen cannot be watched. This supersedes the earlier `docs/SPEC.md` wording that allowed only one active timer of any kind.
### Consequences
The workout clock and interval timer need independent elapsed-time state and clock-controlled tests. The interface must expose sound on/off clearly and keep timing usable if browser audio is unavailable.
## ADR-007: External-load volume per workout minute
- Status: Superseded by ADR-014
- Date: 2026-10-25
### Decision
For a saved workout, calculate external-load volume as the sum of actual repetitions multiplied by actual external kilograms moved for each completed rep set. External load includes recorded vest mass, dumbbell mass multiplied by the number used, and EZ-bar total as applicable; body weight is excluded. Divide by the whole-workout clock's running minutes, including breaks and excluding paused time, and label the rate kg·reps/min. Show raw volume and elapsed time alongside the rate. Label partial workouts and incomplete loads; do not show a rate when duration is zero/missing or no qualifying loaded sets exist. Timed holds, hangs, and walks are tracked separately.
### Context
The owner requested a volume-per-minute workout measure and chose external load only and whole-workout time including breaks.
### Consequences
Set logs must retain actual reps and separate load components, including dumbbell count where needed. Workout and rest timing must remain distinguishable. History calculations use saved actuals and surface missing data rather than substituting prescribed values.
The walk-tracking clause in this decision is superseded by ADR-012; walks remain reference context and do not enter recorded workout volume.
## ADR-008: Wall clock instead of afternoon hold timers
- Status: Accepted
- Date: 2026-10-26
### Decision
Show the current local time in a persistent header across the app. Do not show per-exercise timer controls for the afternoon isometric holds and daily hanging practice. Show their prescribed durations as targets. The afternoon view may still show an already-running workout or interval timer so its state remains accessible. Morning exercise, rest, walk, and EMOM timers remain available.
### Context
The owner said the afternoon holds do not need timers and requested a clock visible at all times instead.
### Consequences
The wall clock is distinct from the manually started whole-workout elapsed clock and does not record performed duration. Future workout logging may capture actual afternoon hold and hang durations without requiring a timer.
The prescribed-duration display for afternoon holds in this decision is superseded by ADR-011.
The walk-timer clause is superseded by ADR-012.
The remaining workout and interval-timer clauses are superseded by ADR-014; the wall clock remains.
## ADR-009: Remove unrequested stretch exercises
- Status: Accepted
- Date: 2026-10-26
### Decision
Remove every previously listed stretch exercise from the initial programme and exercise definitions. Do not add exercises without the owner's request. Show the persistent local time clock more prominently.
### Context
The owner said the stretch movements had been added without specifying which ones and explicitly requested their removal and a larger clock. This updates the previous routine baseline in `docs/WORKOUT_ROUTINE.md` and seed data.
### Consequences
Version the revised seed and update routine tests and product documentation. Future plan editing and logging must not reintroduce the removed movements by default.
The temporary Monday/Friday rest-day presentation was corrected by ADR-010; the removal of unrequested exercise entries remains in force.
## ADR-010: Monday and Friday stretch routine placeholder
- Status: Accepted
- Date: 2026-10-26
### Decision
Label Monday and Friday mornings “Full body stretch routine” without listing exercises or durations. The owner will provide the specific stretches later. Keep the previously removed stretch definitions out of the seed until then.
### Context
The owner clarified that these mornings are for a full body stretching routine, while the specific movements are still undecided. This supersedes the rest-day presentation in ADR-009.
### Consequences
The routine seed stores a stretching session with an empty exercise list for both mornings. The UI shows the title without a rest badge or invented movement rows.
## ADR-011: Untimed isometrics and editable daily hang goal
- Status: Accepted
- Date: 2026-10-26
### Decision
Do not prescribe or display times for the five daily afternoon isometric holds. Keep their side guidance and day-specific effort guidance. The daily hanging goal starts at two minutes but can be changed by the owner and must persist locally across dates and reloads. Do not show daily-hang vest load yet; the owner may add weighted hangs later.
### Context
The owner explicitly removed the need for isometric hold times, asked to change the hang goal, and said vest use is for later.
### Consequences
The initial routine seed has no isometric duration targets or daily-hang load component. A narrow IndexedDB routine override stores the hang goal independently from the seed. Future storage migrations and routine editing must preserve that override; workout logging does not require timed isometric holds.
## ADR-012: Dog walks are reference context, not records
- Status: Superseded by ADR-013
- Date: 2026-10-26
### Decision
Keep the owner's usual three daily dog walks, typical 30–60 minute duration, and current 6 kg vest use as a compact routine reference. Do not offer walk slots, timers, completion controls, or saved walk records. A future calorie calculation may use the reference only when separately requested; do not estimate calories now or present typical values as measured activity.
### Context
The owner said walk recording is unnecessary and asked to mention walks as reference for possible later calorie calculations.
### Consequences
This replaces earlier walk-slot and walk-logging requirements in TASK-002, TASK-003, TASK-005, TASK-009, and the specification. The routine seed stores one reference rather than three daily walk exercises. Future backup and recording work must not require walk logs.
## ADR-013: Remove dog walks from the workout tracker
- Status: Accepted
- Date: 2026-10-26
### Decision
Remove dog walks entirely from the app's UI, routine seed, and active product requirements. No walk reference, timer, record, or calorie calculation is in scope.
### Context
After reviewing the reference-only presentation, the owner requested “remove dog walks.”
### Consequences
ADR-012's reference display and routine data are superseded. Keep prior decisions and completed tasks as history, while current implementation and specifications omit dog walks.
## ADR-014: Untimed strength recording
- Status: Accepted
- Date: 2026-10-27
### Decision
Remove workout, exercise, rest, and EMOM timers and their audio cues. Keep the large current local-time clock and editable daily hang goal. Record one actual total-repetition count and actual external weight for an EMOM exercise; record actual repetitions and external weight separately for each regular set. Store entries by date and exercise locally. Do not calculate or display volume per minute; future progress may show total external-load volume from these records.
### Context
The owner removed timers, specified EMOM totals and per-set rep/weight counts, and chose to remove volume per minute rather than manually enter workout duration.
### Consequences
TASK-006's timer scope and ADR-006/ADR-007 are superseded. Prescribed EMOM timing and rest guidance remain part of the programme, but the app does not run timers or turn those targets into performed records. TASK-014 adds initial strength entry and TASK-005 covers later accepted recording details. Existing hang-goal storage must survive the new IndexedDB store.
## ADR-015: Apply Roborto Workflow 2.0 around Context System 1.0
- Status: Accepted
- Date: 2026-10-28
### Decision
Keep the repository's Context System 1.0 files and project-specific rules. Use the task isolation, pre-implementation Git checks, Captain validation gate, manual-test handoff, diff review, and authority rules in `AGENTS.md` and `docs/WORKFLOW.md`. Do not silently establish an integration branch, worktree path, merge policy, or release branch while those conventions are undefined.
### Context
The owner explicitly requested a documentation-only reconciliation with Roborto Workflow 2.0. The repository already specified numbered tasks and isolated task work, but had no complete Git or Captain validation policy; uncommitted changes from multiple tasks are present on `task/001-foundation`.
### Consequences
Future implementation work must identify its accepted task and branch/worktree safely. Agent checks alone leave work awaiting Captain validation when that review is required. Captain must resolve the open Git conventions and existing mixed work before isolated task implementation proceeds.
## ADR-016: Record exercise-specific loads and carry weight into the next set
- Status: Accepted
- Date: 2026-10-28
### Decision
Strength entry fields follow the exercise's documented load type. Record vest, dumbbell, and EZ-bar weights by their actual component; exercises using vest and dumbbells have separate inputs. For paired dumbbells, enter kilograms per dumbbell and derive the total external load from two dumbbells. Adding a set copies the preceding set's entered weights but leaves repetitions blank. Do not prefill actual weights from prescribed targets. Keep earlier single-total entries as legacy totals without silently interpreting them as components.
### Context
The owner reported that dumbbell flys should record dumbbell weight, not vest weight; only some exercises use a vest, while some use vest and dumbbells. The owner also requested that the last entered set weight be the next set's default. This refines ADR-014's initial total-weight entry behavior.
### Consequences
TASK-014's strength entry UI and stored records use exercise-specific load components where the seed defines them. The stored `externalKg` remains a derived total for new records and an unclassified total for earlier entries. TASK-005 must preserve both forms and may extend recording beyond these strength entries.
## ADR-017: Equipment capabilities and measurements separate from performance
- Status: Accepted requirements; implementation pending TASK-015 approval
- Date: 2026-11-04
### Decision
Use the Captain's equipment assignments in WORKOUT_ROUTINE section 8 for TASK-015. Exercise capabilities contain equipment types and applicable measurements, not fixed weights. Prescriptions and actual performances remain independent. Actual equipment-specific load varies per set/minute; dumbbell load is per dumbbell and bar load includes the bar. Handles are support equipment, excluded from lifted load. Preserve historical values and original semantics rather than recomputing them from current definitions.
New EMOM tracking supports per-minute reps/load with derived totals, superseding ADR-014's aggregate-only rule for new records when implemented; old aggregates remain intact. Actual per-side hold duration does not restore prescribed afternoon hold times under ADR-011. Daily hang is bodyweight-only and its initial editable two-minute goal is continuous, with longest and cumulative actuals independent. Dog walks remain excluded from app UI/records under ADR-013, with bodyweight-only classification taking precedence over historical vest descriptions.
### Consequences
TASK-015 will add metadata-driven controls, versioned compatible storage and JSON contracts. ADR-016's per-dumbbell and explicit actual-load rules remain; controls will derive from definition capabilities rather than prescription load keys. Timer restoration remains unresolved: ADR-014's no-timer behavior stays in force until Captain approves a precise change. This decision records explicit requirements, not authority to implement in this planning turn.
## ADR-018: Timer-free TASK-015 and codex integration baseline
- Status: Accepted
- Date: 2026-11-04
### Decision
Captain explicitly selected timer-free behavior for TASK-015. Retain the local wall clock and prescribed rest/EMOM guidance without workout, exercise, rest or EMOM timers or audio.
Captain authorized committing the existing uncommitted work and merging it into `codex` before TASK-015 implementation. No codex branch or remote existed at inspection; create local codex from the original foundation commit, commit the reviewed pending work on task/001-foundation, and fast-forward merge it into codex. Use codex as the integration baseline for TASK-015 and a dedicated task/015-equipment-ui branch in the sole worktree once clean. No concurrent worktree is needed for sequential work. No push or deployment is authorized.
### Consequences
This resolves TASK-015's timer and dirty-baseline gates. Existing TASK-014 acceptance and completed prerequisites travel in the baseline commit. Further merges remain Captain-controlled unless explicitly authorized. The present merge instruction covers the pre-existing work, not the future TASK-015 implementation.
## ADR-019: Additive detailed performance with saved metadata
- Status: Accepted implementation; TASK-015 accepted by Captain on 2026-11-04
- Date: 2026-11-04
### Decision
Derive applicable controls from the versioned exercise definition's equipment and measurement metadata. Record new actuals as schemaVersion 1 detailed entries with date/period/exercise identity, format, definition/prescription snapshots and independent values/load/completion rows. Per-side actuals are left/right; dumbbells record kg each and one/two count. Missing draft values are null; zero is an explicit actual. New sets copy only load/count. Previous-session suggestions use compatible earlier completed detailed records and fill only empty drafts without completion or automatic save.
IndexedDB v3 adds performanceEntries with an exercise/period/format index. Keep existing strengthEntries and routineOverrides verbatim, exposing original-format records separately through their existing explicit editor. Do not decompose legacy totals, infer duration/side breakdowns or overwrite them when saving detailed entries. Do not combine both representations in volume/history. Definition changes never re-interpret saved snapshots.
Adapter JSON v2 covers all three stores; a v1 envelope supports the two legacy stores. No prior export/import implementation existed. Validate before mutation and use one atomic transaction, rejecting duplicate keys unless replacement is explicitly requested. TASK-009 still owns user-facing confirmations, import policy and backup UI. Timer-free behavior stays authoritative (ADR-018), and dark theming remains TASK-016.
TASK-015 refinement accepted by Captain (2026-11-04): floor flys always use two dumbbells. Definition v2 fixes the count at two and suppresses the redundant input, retaining kg-per-dumbbell entry and the count in stored actuals/calculations. Existing history is not rewritten; older paired snapshots hide the redundant field too. Other exercise counts are unchanged.
Subsequent TASK-015 refinement accepted by Captain (2026-11-04): remove “Dumbbells used” from every exercise. Keep count as internal load metadata with definition defaults for new rows, preserving already-recorded values. An unrecorded null count in an older draft may be filled from its saved definition only when the user explicitly saves. Kg-per-dumbbell entry and accurate total-load calculations remain.
Subsequent TASK-015 completion refinement accepted by Captain (2026-11-04): remove the per-row completion checkboxes. Successful explicit Save marks fully filled valid rows complete, leaving incomplete rows as drafts. Invalid entered values remain errors; zero is valid where applicable. Suggestions and browsing never mark achieved performance. Editing a saved row makes it an unsaved draft until Save; existing stored records are not rewritten merely by reading. Stored completion booleans remain compatible, so no database migration is required.