Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

fix: do not raise weight in double progression before the top of the range

bluzername3d76ac21b88e
diff --git a/frontend/src/lib/progression.js b/frontend/src/lib/progression.js
index a665f499e..712ed03f3 100644
--- a/frontend/src/lib/progression.js
+++ b/frontend/src/lib/progression.js
@@ -429,7 +429,12 @@ export function nextPrescription(S, cfg, routine) {
const range = normalizeRepRange(cfg.reps || last.goal || 10, cfg.repsMin, repStep(cfg))
const top = range.reps
const bottom = range.repsMin
- if (last.ok) return {
+ // `last.ok` only means "matched whatever was recorded as this session's target" - the
+ // first session for a fresh exercise (or one mid-climb) is seeded below the top of the
+ // range, so hitting that recorded target is compliance with the plan, not "reached the
+ // top". Double progression must not add weight until every set actually reaches the top
+ // of the range (issue #278).
+ if (last.ok && last.low >= top) return {
policy, kind: 'up', weight: harder(w, inc), reps: bottom,
why: assisted
? ['Top of the rep range in every set — {0} {1} less help, back to {2} reps.', inc, unit, bottom]
diff --git a/frontend/src/lib/progression.test.js b/frontend/src/lib/progression.test.js
index cb458eb76..83d56bd9b 100644
--- a/frontend/src/lib/progression.test.js
+++ b/frontend/src/lib/progression.test.js
@@ -375,6 +375,17 @@ describe('double progression', () => {
expect(p.reps).toBe(8)
})
+ it('does not raise the weight for a session that only matched its own recorded target, short of the top of the range (issue #278)', () => {
+ // The very first logged session for a fresh double-progression exercise gets its target
+ // seeded at the bottom of the range (8 here), not the top (12). Hitting exactly that many
+ // reps in every set is compliance with the plan, not "reached the top of the range" - so
+ // it must not be graded as a hit that earns more weight.
+ const target = { sets: 3, reps: 8, weight: 40 }
+ const p = nextPrescription(hist(LIFT, [[40, 8, 8, 8]], target), cfg)
+ expect(p.kind).not.toBe('up')
+ expect(p.weight).toBe(40)
+ })
+
it('does not deload again when the deload was performed exactly as prescribed', () => {
const target = { sets: 3, reps: 12 }
// Three sessions stuck mid-range where every set misses the top, so a deload falls due (see DELOAD_POLICY)