Complete workout recording baseline and project context
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# Initial routine data
|
||||
|
||||
`exerciseDefinitions.json` holds stable IDs, names, and categories. `initialRoutine.json` holds the versioned seven-day prescription and refers to definitions by ID. Neither file contains completed workout records or user edits.
|
||||
|
||||
Each day has separate `morning` and `afternoon` sessions. An exercise's `order` is one-based within its session. A `{ "min", "max" }` pair preserves a documented range; equal bounds represent a single target. Durations use seconds unless the field says `Min`. `null` means the source does not specify a value, especially for current hanging ability, finger-hang duration, and unknown loads. A `goalDurationSec` is a goal, not an achieved duration.
|
||||
|
||||
Loads keep vest, dumbbell, and EZ-bar components separate. The 6 kg and 10 kg values are prescribed vest settings only. The source is [`docs/WORKOUT_ROUTINE.md`](../../docs/WORKOUT_ROUTINE.md); any approved change to the initial programme must update that document and this seed together. A future broader storage adapter must copy this seed only when creating a new local routine, then preserve user edits and history.
|
||||
|
||||
Strength entry fields follow each exercise's `load` keys. `dumbbellKgEach` means the mass of each of two dumbbells; `dumbbellKg` means one dumbbell. Mixed `vestKg` and dumbbell keys produce separate inputs. Actual entries do not assume the seed's prescribed weights. New records retain components and a derived total external weight; older entries with only `externalKg` remain legacy totals.
|
||||
|
||||
Afternoon isometric holds have no prescribed duration. The daily hang starts with a two-minute goal but no vest field. A user-changed hanging goal is stored separately in IndexedDB by `hangGoalStorage.js`; seed updates must not overwrite it.
|
||||
|
||||
Suitcase carries also expose their single-dumbbell load as dated weight-only set entries (`kind: load-sets`). These contain actual load and derived external kilograms, without fabricated repetitions or performed duration. The carry duration-per-side prescription remains separate. Existing repetition sets and EMOM totals are unchanged; no IndexedDB store upgrade is needed.
|
||||
|
||||
Seed v7 adds vest-only support (`vestKg: null`) to front planks and side-plank hip raises without prescribing a numeric load. Front planks reuse weight-only `load-sets`; hip raises retain repetition sets. Historical bodyweight-only entries remain prior totals until the user explicitly chooses component entry. No database migration is required.
|
||||
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{"id":"pull-up","name":"Pull-ups","category":"strength"},
|
||||
{"id":"ez-bar-bent-over-row","name":"EZ-bar bent-over rows","category":"strength"},
|
||||
{"id":"single-arm-dumbbell-row","name":"Single-arm dumbbell rows","category":"strength"},
|
||||
{"id":"suitcase-carry","name":"Suitcase carries","category":"strength"},
|
||||
{"id":"weighted-deep-push-up","name":"Weighted deep push-ups using dumbbells as handles","category":"strength"},
|
||||
{"id":"dumbbell-floor-fly","name":"Dumbbell floor flys","category":"strength"},
|
||||
{"id":"push-up-plus","name":"Push-up plus","category":"strength"},
|
||||
{"id":"feet-elevated-weighted-push-up","name":"Feet-elevated weighted push-ups","category":"strength"},
|
||||
{"id":"bulgarian-split-squat","name":"Bulgarian split squats","category":"strength"},
|
||||
{"id":"single-leg-romanian-deadlift","name":"Single-leg Romanian deadlifts","category":"strength"},
|
||||
{"id":"squat","name":"Squats","category":"strength"},
|
||||
{"id":"single-leg-calf-raise","name":"Single-leg calf raises","category":"strength"},
|
||||
{"id":"front-plank","name":"Front plank","category":"strength"},
|
||||
{"id":"chin-up","name":"Chin-ups","category":"strength"},
|
||||
{"id":"hanging-knee-raise","name":"Hanging knee raises","category":"strength"},
|
||||
{"id":"finger-hang","name":"Finger hangs","category":"strength"},
|
||||
{"id":"single-arm-preacher-curl","name":"Single-arm preacher curls over a chair","category":"strength"},
|
||||
{"id":"hammer-curl","name":"Hammer curls","category":"strength"},
|
||||
{"id":"single-arm-shoulder-press","name":"Standing single-arm dumbbell shoulder press","category":"strength"},
|
||||
{"id":"leaning-single-arm-lateral-raise","name":"Leaning single-arm lateral raises","category":"strength"},
|
||||
{"id":"bent-over-rear-delt-fly","name":"Bent-over rear-delt flys","category":"strength"},
|
||||
{"id":"lying-dumbbell-triceps-extension","name":"Lying dumbbell triceps extensions","category":"strength"},
|
||||
{"id":"single-arm-triceps-extension","name":"Single-arm triceps extensions","category":"strength"},
|
||||
{"id":"side-plank-hip-raise","name":"Side-plank hip raises","category":"strength"},
|
||||
{"id":"deep-squat-hold","name":"Deep squat hold","category":"isometric"},
|
||||
{"id":"ninety-ninety-hip-hold","name":"90/90 hip hold","category":"isometric"},
|
||||
{"id":"bird-dog-hold","name":"Bird-dog hold","category":"isometric"},
|
||||
{"id":"single-leg-balance","name":"Single-leg balance","category":"isometric"},
|
||||
{"id":"prone-swimmer-iso","name":"Prone swimmer iso","category":"isometric"},
|
||||
{"id":"daily-hang","name":"Daily hanging practice","category":"hang"}
|
||||
]
|
||||
@@ -0,0 +1,4 @@
|
||||
import exerciseDefinitions from './exerciseDefinitions.json'
|
||||
import initialRoutine from './initialRoutine.json'
|
||||
|
||||
export { exerciseDefinitions, initialRoutine }
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,107 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { exerciseDefinitions, initialRoutine } from './index.js'
|
||||
|
||||
const weekdays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
|
||||
const isometricIds = ['deep-squat-hold', 'ninety-ninety-hip-hold', 'bird-dog-hold', 'single-leg-balance', 'prone-swimmer-iso']
|
||||
const morningIds = {
|
||||
monday: [],
|
||||
tuesday: ['pull-up', 'ez-bar-bent-over-row', 'single-arm-dumbbell-row', 'suitcase-carry'],
|
||||
wednesday: ['weighted-deep-push-up', 'dumbbell-floor-fly', 'push-up-plus', 'feet-elevated-weighted-push-up'],
|
||||
thursday: ['bulgarian-split-squat', 'single-leg-romanian-deadlift', 'squat', 'single-leg-calf-raise', 'front-plank'],
|
||||
friday: [],
|
||||
saturday: ['chin-up', 'hanging-knee-raise', 'finger-hang', 'single-arm-preacher-curl', 'hammer-curl'],
|
||||
sunday: ['single-arm-shoulder-press', 'leaning-single-arm-lateral-raise', 'bent-over-rear-delt-fly', 'lying-dumbbell-triceps-extension', 'single-arm-triceps-extension', 'side-plank-hip-raise'],
|
||||
}
|
||||
|
||||
const exercise = (day, period, id) => initialRoutine.days[day][period].exercises.find((item) => item.exerciseId === id)
|
||||
const range = (min, max = min) => ({ min, max })
|
||||
|
||||
describe('documented initial routine', () => {
|
||||
it('is versioned, has one stable definition per used exercise, and retains every day and exercise order', () => {
|
||||
expect(initialRoutine.version).toBe(7)
|
||||
expect(initialRoutine.source).toBe('docs/WORKOUT_ROUTINE.md')
|
||||
expect(Object.keys(initialRoutine.days)).toEqual(weekdays)
|
||||
|
||||
const definitionIds = exerciseDefinitions.map(({ id }) => id)
|
||||
expect(new Set(definitionIds).size).toBe(definitionIds.length)
|
||||
const usedIds = new Set()
|
||||
|
||||
for (const day of weekdays) {
|
||||
const sessions = initialRoutine.days[day]
|
||||
expect(sessions.morning.sessionType).toBe(day === 'monday' || day === 'friday' ? 'stretching' : 'strength')
|
||||
expect(sessions.morning.exercises.map(({ exerciseId }) => exerciseId)).toEqual(morningIds[day])
|
||||
expect(sessions.afternoon.sessionType).toBe('isometrics-and-hang')
|
||||
expect(sessions.afternoon.exercises.map(({ exerciseId }) => exerciseId)).toEqual([...isometricIds, 'daily-hang'])
|
||||
expect(sessions).not.toHaveProperty('walks')
|
||||
|
||||
for (const session of Object.values(sessions)) {
|
||||
expect(session.exercises.map(({ order }) => order)).toEqual(session.exercises.map((_, index) => index + 1))
|
||||
for (const item of session.exercises) {
|
||||
expect(definitionIds).toContain(item.exerciseId)
|
||||
expect(typeof item.optional).toBe('boolean')
|
||||
usedIds.add(item.exerciseId)
|
||||
}
|
||||
}
|
||||
}
|
||||
expect([...usedIds].sort()).toEqual([...definitionIds].sort())
|
||||
expect(definitionIds).toHaveLength(30)
|
||||
expect(definitionIds).not.toContain('dog-walk')
|
||||
expect(initialRoutine).not.toHaveProperty('activityReference')
|
||||
expect(exerciseDefinitions.some(({ category }) => category === 'stretch')).toBe(false)
|
||||
})
|
||||
|
||||
it('preserves strength ranges, EMOM timing, rest, and separate known and unknown load components', () => {
|
||||
for (const [day, id] of [['tuesday', 'pull-up'], ['saturday', 'chin-up']]) {
|
||||
const item = exercise(day, 'morning', id)
|
||||
expect(item.prescription).toMatchObject({ kind: 'emom', rounds: 10, intervalSec: 60, repsPerRound: range(3, 4) })
|
||||
expect(item.rest).toEqual({ kind: 'remainder-of-interval', intervalSec: 60 })
|
||||
expect(item.load).toEqual({ vestKg: 6 })
|
||||
}
|
||||
expect(exercise('tuesday', 'morning', 'pull-up').prescription.initialRepsPerRound).toBe(4)
|
||||
expect(exercise('tuesday', 'morning', 'single-arm-dumbbell-row').prescription).toMatchObject({ sets: range(3, 4), reps: range(8, 15), per: 'side' })
|
||||
expect(exercise('tuesday', 'morning', 'suitcase-carry').prescription).toMatchObject({ sets: range(3), durationSec: range(30, 60), per: 'side' })
|
||||
expect(exercise('wednesday', 'morning', 'weighted-deep-push-up').load).toEqual({ vestKg: 10 })
|
||||
expect(exercise('wednesday', 'morning', 'feet-elevated-weighted-push-up').load).toEqual({ vestKg: 10 })
|
||||
expect(exercise('wednesday', 'morning', 'dumbbell-floor-fly').load).toEqual({ dumbbellKgEach: null })
|
||||
expect(exercise('thursday', 'morning', 'bulgarian-split-squat').load).toEqual({ vestKg: 10, dumbbellKgEach: null })
|
||||
expect(exercise('thursday', 'morning', 'squat').load).toEqual({ vestKg: 10, dumbbellKgEach: null })
|
||||
expect(exercise('thursday', 'morning', 'front-plank').prescription.durationSec).toEqual(range(30, 60))
|
||||
expect(exercise('thursday', 'morning', 'front-plank').load).toEqual({ vestKg: null })
|
||||
expect(exercise('sunday', 'morning', 'side-plank-hip-raise').load).toEqual({ vestKg: null })
|
||||
expect(exercise('saturday', 'morning', 'finger-hang').prescription).toMatchObject({ sets: range(2, 3), durationSec: null })
|
||||
expect(exercise('sunday', 'morning', 'single-arm-triceps-extension')).toMatchObject({ optional: true, prescription: { sets: range(2, 3), reps: range(10, 15), per: 'arm' } })
|
||||
expect(initialRoutine.days.sunday.morning.exercises.filter(({ optional }) => optional).map(({ exerciseId }) => exerciseId)).toEqual(['single-arm-triceps-extension'])
|
||||
})
|
||||
|
||||
it('keeps untimed afternoon holds and daily hanging practice separate from Saturday finger hangs', () => {
|
||||
const efforts = {
|
||||
monday: range(5, 6), tuesday: range(3, 4), wednesday: range(3, 4),
|
||||
thursday: range(3, 4), friday: range(6, 7), saturday: range(3, 4), sunday: range(3, 4),
|
||||
}
|
||||
for (const day of weekdays) {
|
||||
const afternoon = initialRoutine.days[day].afternoon
|
||||
expect(afternoon.targetEffortRpe).toEqual(efforts[day])
|
||||
expect(afternoon.exercises.slice(0, 5).every(({ prescription }) => prescription.kind === 'isometric-hold' && !('durationSec' in prescription))).toBe(true)
|
||||
expect(afternoon.exercises[1].prescription.per).toBe('side')
|
||||
expect(afternoon.exercises[2].prescription.per).toBe('side')
|
||||
expect(afternoon.exercises[3].prescription.per).toBe('leg')
|
||||
expect(afternoon.initialRounds).toBe(1)
|
||||
expect(afternoon.optionalProgressionRounds).toBe(2)
|
||||
expect(afternoon.progressionCondition).toBe('Only if recovery remains good')
|
||||
expect(afternoon).not.toHaveProperty('restBetweenHoldsSec')
|
||||
expect(afternoon.targetsAreMandatory).toBe(false)
|
||||
expect(exercise(day, 'afternoon', 'daily-hang')).toMatchObject({
|
||||
prescription: { goalDurationSec: 120, currentDurationSec: null, attemptCount: null, breaks: null, goalFormat: null },
|
||||
})
|
||||
expect(exercise(day, 'afternoon', 'daily-hang')).not.toHaveProperty('load')
|
||||
}
|
||||
expect(exercise('saturday', 'morning', 'finger-hang').exerciseId).not.toBe(exercise('saturday', 'afternoon', 'daily-hang').exerciseId)
|
||||
})
|
||||
|
||||
it('keeps Monday and Friday stretch headings free of unspecified exercises', () => {
|
||||
for (const day of ['monday', 'friday']) {
|
||||
const morning = initialRoutine.days[day].morning
|
||||
expect(morning).toEqual({ sessionType: 'stretching', title: 'Full body stretch routine', exercises: [] })
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user