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
+19
View File
@@ -320,3 +320,22 @@ Captain authorized committing the existing uncommitted work and merging it into
### 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.