Repository navigation
Description
Summary
- Reporter: shredness_10860 (Discord)
- Type: Enhancement (feature request)
- Repo: 9thlevelsoftware/project-phoenix-mp (mobile)
- Source: Discord #feature-requests, thread
1572315372235923557
When a routine is set to a heavy deload, the app scales work by cutting set reps to the offered deload percentage while leaving weight unchanged. For exercises programmed as AMRAP there are no prescribed reps to cut, so the deload percentage cannot be applied and the set effectively stays the same. The reporter requests that deload percentages be applied to AMRAP sets by scaling the reps achieved in the last session instead of the (nonexistent) programmed rep target.
Request details
- Trigger: select a routine, set it to heavy deload at one of the offered percentages (e.g. 60%).
- Current behavior for fixed-rep sets: weight stays the same, reps are cut to the offered percentage.
- Problem: for AMRAP exercises there is no programmed rep count to cut, so the percentage has no effect on the set.
- Suggested behavior: take the reps from the last session and set the percentage against that number.
- Reporter's example: "I curled 45lbs at AMRAP for 10 reps the week before. I select the same routine, set it for heavy DELOAD at 60%, the app would set the exercise for six reps." (10 reps x 60% = 6 reps; weight stays 45 lbs.)
Expected behavior
Deload percentages apply to every exercise in the routine, including AMRAP sets. Example: heavy deload at 60% on an exercise whose last session AMRAP set was 45 lbs x 10 reps programs 45 lbs x 6 reps.
Actual behavior
Deload only cuts programmed reps. AMRAP sets have no programmed reps, so the deload percentage is not applied and the set is unchanged from the previous session.
Impact / notes
- Users who program AMRAP sets (a common progression tool) cannot use the deload feature on those exercises.
- Assumption: "last session" means the most recent completed session containing that exercise. Where no prior session exists there is no scaling source; implementation should define fallback behavior (e.g. leave the AMRAP set unscaled when no history exists).
- Assumption: deload continues to leave weight unchanged and scales reps only, matching the reporter's example.
- Scope: mobile app routine/deload logic (routine selection -> deload percentage application).
Attachments
No attachments recorded.
Original Discord Report
<@&1509574103043145931> When setting a routine to heavy deload, weight remains the same but set reps are cut to the offered percentages. However, if exercise is set to AMRAP there are no reps to cut. Suggestion: take reps from last session and set percentage against that number. For example, I curled 45lbs at AMRAP for 10 reps the week before. I select the same routine, set it for heavy DELOAD at 60%, the app would set the exercise for six reps.
Discord-Message-ID: 1572315372235923557
Activity
9thLevelSoftware commentedon Nov 17, 2026
Feasibility assessment — ACCEPT ✅
Verdict: accept (feasible, contained, high user value). Artifact:
feasibility.mdin the enhancement evidence dir.Confirmed gap (code evidence at origin/main 6f95247):
ApplyRoutineModifierUseCase.applyHeavyDeloadscales only non-nullsetRepsentries — AMRAP sets (nullsetRepsentries) pass through the deload transform untouched, so the percentage has no effect on them. Exactly as reported.Why feasible: achieved-reps history is already first-class (
CompletedSetRepository.getRecentCompletedSetsForExercise,CompletedSet.actualReps), the use case is alreadysuspendand already receives the completed-set repository, and the modifier is a non-persisted launch-time transform — so the change is contained to one use case + its existing unit-test file.Planned semantics (assumptions, per the reporter's example):
project-phoenix-mp), no portal/schema/sync changes.Rough effort: 1-2 bounded implementation packets (~0.5-1.5 days), implementation + unit tests.
Routing next to architecture/integration modelling on the enhancement board.
9thLevelSoftware commentedon Nov 17, 2026
Architecture — #1408 Heavy Deload for AMRAP sets (stage: architecture ✅)
Code baseline: origin/main
6f95247. Full design:architecture.mdin the enhancement artifact dir.Behavior: when Heavy Deload at P% is applied at launch, each AMRAP set (a
nullsetRepsentry, or the last set when the exercise-levelisAMRAPflag is on) uses the reps from the user's most recent completed AMRAP set for that exercise and profile. That number is scaled with the existingscaleReps, and the set becomes a fixed-rep set for this session only. Example: 10 reps × 60% = 6 reps at the same weight. If there is no AMRAP history, the set stays AMRAP and unchanged. The routine template is never modified.Reference set:
CompletedSetRepository.getRecentCompletedSetsForExercise. This already uses the latest logical attempt, is profile-scoped, and excludes deleted sessions. It is filtered tosetType == AMRAP && actualReps > 0, preferring same routine-exercise + set number, then same routine-exercise, then any. Deloaded sets now run and record as STANDARD, so a deload's reduced reps can never become the next "last session" (no feedback loop, no schema change). The design deliberately does not filter onroutineModifierApplied: migration 62 marks all pre-upgrade sessions as "unknown → applied", and filtering on it would disable the feature for the first cycle after the update.Scope: only
ApplyRoutineModifierUseCasechanges:applyHeavyDeloadbecomes suspend and receivesprofileId. No change to the repository/SQL, DI,RoutineFlowManager, schema, sync, portal or UI, and no feature flag. Bodyweight and timed-cable sets are excluded.Acceptance (unit tests in
ApplyRoutineModifierUseCaseTest):isAMRAPon the copy onlyAccepted limitation: an AMRAP set done during Active Recovery can be used as the reference. The follow-up, if needed, is a read-only query, with no migration.
Effort: one bounded implementation packet (~0.5–1 day). No UI → no prototype stage needed.
9thLevelSoftware commentedon Nov 17, 2026
Integration model complete (enhancement pipeline, stage
integration_model; code baselinemain@ 6f95247)The planned change fits the existing code with a single production file touched.
ApplyRoutineModifierUseCase.ktonly. Heavy Deload looks up the latest AMRAP sets for each AMRAP exercise (existing, profile-scopedgetRecentCompletedSetsForExercise), picks the reference in order of same routine exercise + same set number, then same routine exercise, then any, and converts the AMRAP set toround(reps × percent)fixed reps (minimum 1) with the weight unchanged. Without AMRAP history the set stays AMRAP, as it does today. Bodyweight and timed sets are unchanged.CompletedSet.setNumberis the 0-based set index,routineExerciseIdequalsRoutineExercise.id, and deloaded sets record asSTANDARD, so they never feed back into later deloads. The only caller (RoutineFlowManager.enterRoutineOverview) already passes the profile. DI and constructors are unchanged.ApplyRoutineModifierUseCaseTest(reporter example 10 → 6 @ 60%, no-history, last-set flag, reference precedence, STANDARD/0-rep rows ignored, profile isolation, bodyweight/timed, rounding, one query per exercise, Active Recovery untouched).FakeCompletedSetRepositoryalso needs a small fix so it honorsprofileId.Fixes #1408.Next: implementation packet (one bounded packet, ~0.5–1 day).
9thLevelSoftware commentedon Nov 17, 2026
Signoff decision: APPROVED ✅ (stage: signoff)
Verdict: approved for implementation specification and development. This is not release or merge approval.
Decided by: escalated-model review (
phoenix-rca, Claude Opus 5.5). No human feedback was on record. Full decision:signoff.mdin the enhancement evidence dir.What changes: Heavy Deload now covers AMRAP sets. For each AMRAP set, the app takes the reps from your most recent completed AMRAP set for that exercise and applies the deload percentage: 10 reps at 60% gives 6 reps at the same weight. If there is no AMRAP history, the set stays AMRAP as it is today.
Why approved: I re-checked the design against
main@6f95247. The gap is inApplyRoutineModifierUseCase.kt:104-115, where null (AMRAP) reps pass through. The fix touches one production file and uses an existing query that is profile-scoped and reads the latest attempt per set. Filtering references to AMRAP-type sets avoids a feedback loop, because deloaded sets record as STANDARD. There is no schema, sync, UI or portal change. The existing deload test ([10,8,null]→[5,4,null]with no history) still holds.Binding conditions (from signoff.md):
ApplyRoutineModifierUseCase.kt,ApplyRoutineModifierUseCaseTest.ktandtestutil/FakeCompletedSetRepository.kt. The DWSM integration test is optional. Any other file counts as scope drift.compileTestKotlinIosArm64and required CI must be green. Simulator/host evidence is enough, and GitGuardian is not a gate.Fixes #1408.Next stage:
implementation_spec.9thLevelSoftware commentedon Nov 17, 2026
Implementation plan (spec complete) — Heavy Deload scales AMRAP sets from last session's reps.
Single bounded packet, no UI, no schema/sync/DI/portal change. Baseline: main
6f95247, verified unchanged across all upstream stages; signoff (claude-opus-5-5) approved with binding conditions.Allowed files (exactly 3):
ApplyRoutineModifierUseCase.kt—applyHeavyDeloadbecomessuspend+profileId; per eligible exercise (non-bodyweight, non-timed), each AMRAP set (isAmrapSet) resolves R = reps of the most recent completed AMRAP-typed set (setType==AMRAP && actualReps>0, profile-scoped, limit 50, one query per exercise, memoized) with precedence same routine-exercise+set-number → same routine-exercise → any; target =scaleReps(R, P)(10 × 60% = 6), weight unchanged;isAMRAPcleared on the session copy only when resolved. No history → set stays AMRAP unchanged. No try/catch, no flag, no telemetry.ApplyRoutineModifierUseCaseTest.kt— 11 new cases (Kotlin/Native-safe names) covering history/no-history, last-set flag, precedence, STANDARD/zero-rep exclusion, profile isolation, bodyweight/timed byte-identical output, rounding floor, one-query-per-exercise, Active Recovery untouched.testutil/FakeCompletedSetRepository.kt— honorprofileIdand record calls.Guards: deloaded sets record as STANDARD (no feedback loop);
routineModifierApplieddeliberately not filtered (m62 fail-closed would void pre-upgrade history). Accepted limitations documented in KDoc: Active Recovery AMRAP rows may be a reference; history capped at 50 recent sets.Acceptance: 11 new tests + all existing tests green (incl.
[10,8,null]→[5,4,null]unchanged),:shared:testAndroidHostTest,:shared:compileTestKotlinIosArm64, required CI (Unit Tests / Build Android / iOS Test Target Compile) green; PR will carryFixes #1408.Docs:
implementation-spec.md+user-instructions.md(with release-note draft) in the enhancement artifact directory. Next stage: implementation + PR.9thLevelSoftware commentedon Nov 17, 2026
Implementation + PR ready: #1410
Heavy Deload now scales AMRAP sets from the last session's achieved reps exactly as requested: 10 AMRAP reps at 60% → 6 reps, weight unchanged; with no AMRAP history the set stays AMRAP; the saved routine is never modified (session-only copy).
feat/1408-deload-amrap-history@2b3189cd, baseorigin/main6f95247— diff limited to the 3 signoff-allowed files (ApplyRoutineModifierUseCase.kt,ApplyRoutineModifierUseCaseTest.kt,testutil/FakeCompletedSetRepository.kt).:shared:compileTestKotlinIosArm64green. PR body carriesFixes #1408.Unit Testscheck currently shows one failure —ExerciseMediaWiringTest > noMigrationTouchesExerciseImage, a stale migration-count ratchet (maxSeen <= 63) that already fails on main's own CI for base commit6f95247(run 44193888713) and is untouched by this PR (migration64.sqmfrom [Bug]: Velocity is 10x too low (stored as cm/s, labelled mm/s); set MCV and velocity loss include calibration and ramp reps #1400 landed on main without bumping the guard). Full evidence on the PR. Once main bumps the guard, CI turns green on re-run.9thLevelSoftware commentedon Nov 18, 2026
PR follow-up complete — CI green, ready for merge gate
Branch:
feat/1408-deload-amrap-history@acf2d485(basemain@c28f5094) · PR #1410 · MERGEABLE / CLEAN,Fixes #1408intact, zero unresolved review threads.The one CI failure was pre-existing on main and is now fixed main-side:
Unit Testsfailed onExerciseMediaWiringTest > noMigrationTouchesExerciseImage— a stale migration ratchet (maxSeen <= 63) after64.sqm([Bug]: Velocity is 10x too low (stored as cm/s, labelled mm/s); set MCV and velocity loss include calibration and ramp reps #1400 part 1) landed on main. Main's own CI failed identically on the base commit (run 44193888713), before this branch existed.c28f5094onmain: ratchet63→64(one test-guard line + comment;64.sqmhas zeroExerciseImagementions, guard (b) unchanged). Verified locally::shared:testAndroidHostTest --tests ExerciseMediaWiringTest→ 12 tests, 0 failures. This also repairs main's own CI and unblocks the same check on other open PRs (e.g. feat(garmin): watch button controls for workouts — Phase 1 MVP (#1391) #1407).origin/maininto the PR branch (acf2d485); the PR diff remains exactly the 3 signed-off files.Final CI on
acf2d485:PhantomBleRepositoryTesttimeout on first run — BLE code untouched by this diff, passed on rerun)No UI (ui_required=false), so no visual evidence gate applies. Next stage: merge gate (escalated model) — merge decision is intentionally left to it.
feat: scale heavy deload AMRAP sets from last session reps (issue #1408…
9thLevelSoftware commentedon Nov 18, 2026
Merge gate: merged ✅
PR #1410 was squash-merged to
mainasa6a659d09bfd45ba77c76ebe2f93d9eedebf6f38. This issue was closed automatically byFixes #1408.What changed: When Heavy Deload is on, each AMRAP set on a weighted cable exercise now becomes a fixed-rep set for that session only. Its rep target is your reps from the most recent AMRAP set for that exercise, times the deload percent. For example, 10 reps at 60% gives 6 reps, and the weight stays the same. If there is no AMRAP history, the set stays AMRAP with no change. Bodyweight and timed exercises are not affected, and the saved routine is never modified.
Gate audit (head
acf2d485):isAMRAPhandling, one memoized query per exercise (limit 50) with anAMRAP && actualReps > 0filter, no try/catch, Active Recovery untouched, and KDoc limitations.mainmoved ahead by 2 commits after follow-up (test(media): real picker-dialog photo-attach forwarding coverage (Refs #1358) #1409, fix: auto-advance equivalent consecutive duplicate routine entries (#1394) #1396). Neither touches the modifier or deload path, andgit merge-treeshowed a clean merge.ui_required=false), so no visual evidence was required.