Skip to main content

Backend handoff: session 1RM

Audience: server team. Status: the web app carries the rule in dev since 2026-11-18 and is meant to be released; the package is on main; Enode One has it on a branch, off in release builds. Date: 2026-11-18.

Summary​

iOS and web are testing one common rule for the 1RM of a running session. It replaces the per-session use of estimateRm1 / estimateMomentaryRm1 in both apps, behind a switch: on in the web app, on in Enode One's Debug and TestFlight builds only. The rule is documented in session-rm1.md.

The server has no logic to change for this test. What changes for the server is the content of two things that builds with the rule upload.

Where the code is​

RepositoryWhereNote
enode-coaching-core (package)main at 855694fcontains the Prediction module (6ac329f) and EnodePrediction.SessionRm1
enode-tracking (web: tracking and portal)devswitch on
Enode One (iOS)branch feature/rm1-warmup-candidatesswitch on in Debug and TestFlight, off in Release

The package change is on main, which the server builds against by branch. The next package resolution on the server picks it up — see "The package on main" below.

What builds with the rule upload differently​

  1. Session 1RM (measurements, metric rm1, session level). Same field, computed by the new rule: about 2 % higher on average, far fewer jumps, never below the formula value of a completed set. The confidence is now the calculation's: 0.25 when only a lower bound decided, 0.9 for velocity evidence, 0.94–0.99 for sets with an entered RIR. Web used to upload 1 for every session.
  2. Exertion (RIR) of a set, from the web. An app estimate now goes to value only, value_user stays unset. A value the athlete picked goes to value_user, including "6+" (6) and 0. Until now the web wrote its estimate to both fields and a "6+" pick to value only. The same holds for the complete-set sheet: a suggestion the athlete did not touch is stored in value only. iOS already separated them, with one exception that is fixed on the branch (the re-estimate after a corrected load or rep count).

Please confirm, or tell us where this is a problem:

  1. Nothing on the server reads the session-level 1RM confidence as "1 = valid".
  2. Nothing on the server depends on the web writing the RIR estimate to value_user. In particular: CoachingExerciseFetches.coachingSets with onlyValidExertionUSerValue and the exertion-profile fit read value_user; with this change they see fewer web sets as user-rated, which is the intended meaning.
  3. The trend over the last seven session 1RMs tolerates the level shift of about 2 % between sessions written by old and new builds.

What the apps read from the server​

ValueSourceUsed as
Exercise 1RM with confidencemeasurements, metric rm1, exercise levelThe base of the rule. Without it there is no start value.
Mean-velocity profile coeff_a0, coeff_a1regression_models, type meanVelocityProfileVelocity norm per load; only intercept and slope are read

Both clients must receive the same exercise 1RM and the same profile fit, or they compute different session values.

What does not change​

  • No endpoint, no DTO, no schema change.
  • CoachingServiceExerciseRm1.updateExerciseValue (the exercise 1RM) and the profile fits are untouched.

Old app versions​

Old builds keep writing the session 1RM with the old estimator into the same field. A user with an old and a new build gets the value of whichever device wrote last. Values stay readable and plausible on both.

The package on main​

main now contains the Prediction module (commit 6ac329f, see HANDOVER-server-ios.md) plus EnodePrediction.SessionRm1. Package.swift declares a resource folder: swift build emits <product>_EnodeCoachingCore.bundle (about 1 MB) next to the executable, which must ship with the binary. Only EnodePrediction.ML.* calls load it; the server makes none today. Nothing in Core/ changed, so estimateRm1 behaves as before.

Open question for the server team​

The database the app team reads (mcp_readonly) holds no session after 2026-07-01 13:04 UTC, all large tables were filled on that day, and nothing was written since. Is that a restored dump rather than the live database? The evaluation of this rule could only use data up to that date.