docs(log_set): RiR ranges, bodyweight, and how to revise a set - #20
Open
wromansky wants to merge 1 commit into
Open
docs(log_set): RiR ranges, bodyweight, and how to revise a set#20wromansky wants to merge 1 commit into
wromansky wants to merge 1 commit into
Conversation
Three call-shape facts a caller cannot get from the signature. A trainee reports RiR as a range as often as a number - "maybe 3 or 4" - and the field takes one float. Without a stated convention the value is invented: an average, or a midpoint that was never claimed. Say to record the lower bound. It is what they are sure of, and it is the conservative input to a load decision. weight is required, so bodyweight work has to pass something. Zero is wger's convention for unloaded work; say so, rather than leaving each caller to conclude it separately. log_set always inserts, and the revision path is update_workout_log with the id in this call's result. A caller that revises by calling log_set again writes a second row for one physical set, and downstream nothing distinguishes that pair from two genuine sets at the same load - not the routine log view, not volume statistics, not the exercise history a progression decision reads.
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.
The problem
Three things about calling
log_setthat its signature does not say, each of which produced a wrong row in a real training log this week.A reported RiR is often a range. A trainee says "maybe 3 or 4"; the field takes one float. With no stated convention the caller invents one — an average, or a midpoint the trainee never claimed. Worse, the invention is unstable: a caller that writes 3.5, reconsiders, and decides 3 was the honest number then has a row it wants to change.
weightis required, so bodyweight work has to pass something. Zero is wger's convention for unloaded work, but nothing says so, and a caller can reasonably read a hard zero as a missing value it should avoid writing.log_setalways inserts. A caller revising a set it just wrote — a corrected rep count, a better RiR — reaches for the tool it already used. That writes a second row for one physical set, and downstream nothing distinguishes the pair from two genuine sets at the same load: not the routine log view, not volume statistics, not the exercise history a progression decision reads.The change
Docstring only.
log_setgains three paragraphs:weight=0is the bodyweight case, not a missing value;update_workout_logand the id returned in this call's result, because a secondlog_setwrites a duplicate.No signature, behaviour or schema change.
log_setalready returns the created row'sid, so the revision path the docstring names works today.Why the docstring
FastMCP turns the docstring into the description the model sees when it decides how to call the tool, so this is the layer where call-shape conventions are actually read — attached to the tool, at the moment of use. A validator cannot help here: two identical sets at the same load are legitimate training, so nothing server-side can distinguish a duplicate from a double.
Tests
None added; no behaviour changed. Full suite unchanged at 247 passed,
ruff checkclean.Note
#18 and #19 also edit this docstring, in the
reps_unitandexercise_idparagraphs respectively. This one extends therirparagraph and appends after it, so the hunks are adjacent rather than overlapping — whichever lands last may need a trivial rebase.