Repository navigation
fix(coach): a bonus set no longer reads as a stall the athlete never had - #287
Merged
Merged
Conversation
`readSession` in api/coach/core/payload.js is a deliberate duplicate of the one in frontend/src/lib/progression.js. The two runtimes share no build step, the same trade-off server.js already makes for effectiveRoutineId. The copy missed issue DuarteSantos8#233: the frontend grades only the sets the plan asked for, this one graded every set logged. So a fourth set taken short of the goal on a clean 3x10 is a hit in the app and a miss in the Coach's payload. `stallCount` reads only this copy, so it reports a stall that did not happen, and the review and the next proposal are built on it. Two such sessions and the Coach starts suggesting a deload. The same `logged.slice(0, Math.max(1, planned))` as the frontend, in the same place. `count` deliberately keeps reading every logged set: extra sets are the dimension bodyweight work grows once reps hit their ceiling (DuarteSantos8#33), they just do not decide whether the prescription was met. The header comment claimed coach-parity.test.js pinned these rules against the frontend's originals. It pins three of the five: modeOf, isBw, isPerSide. isWarmupSet and readSession were pinned by nothing, which is how this drifted without anything noticing. api/test/payload-parity.test.js pins them now, and it has to be its own file: it imports the frontend's real readSession, and a vitest test cannot import into a node:test file or back. The new test fails against the old payload.js. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
Thanks @kurktchiev, and good catch on the server copy of Released in v1.3.9: https://github.com/DuarteSantos8/openGym/releases/tag/v1.3.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
readSessionin api/coach/core/payload.js is a deliberate duplicate of the one infrontend/src/lib/progression.js. The two runtimes share no build step, the same
trade-off server.js already makes for effectiveRoutineId. The copy missed issue #233:
the frontend grades only the sets the plan asked for, this one graded every set logged.
So a fourth set taken short of the goal on a clean 3x10 is a hit in the app and a miss
in the Coach's payload.
stallCountreads only this copy, so it reports a stall thatdid not happen, and the review and the next proposal are built on it. Two such sessions
and the Coach starts suggesting a deload.
The same
logged.slice(0, Math.max(1, planned))as the frontend, in the same place.countdeliberately keeps reading every logged set: extra sets are the dimensionbodyweight work grows once reps hit their ceiling (#33), they just do not decide whether
the prescription was met.
The header comment claimed coach-parity.test.js pinned these rules against the
frontend's originals. It pins three of the five: modeOf, isBw, isPerSide. isWarmupSet
and readSession were pinned by nothing, which is how this drifted without anything
noticing. api/test/payload-parity.test.js pins them now, and it has to be its own file:
it imports the frontend's real readSession, and a vitest test cannot import into a
node:test file or back.
The new test fails against the old payload.js.
🤖 Generated with Claude Code