docs(log_set): pass rir only when the trainee gave a number - #22
Draft
wromansky wants to merge 1 commit into
Draft
docs(log_set): pass rir only when the trainee gave a number#22wromansky wants to merge 1 commit into
wromansky wants to merge 1 commit into
Conversation
A trainee reports effort in words at least as often as in numbers - "felt good", "a few left", "that was hard". rir is a float, so a caller that treats it as always-required has to convert, and the conversion is a guess that becomes indistinguishable from a report the moment it is stored. Nothing downstream can tell 2.0-because-he-said-two from 2.0-because-it-seemed-like-two, and progression logic reads both as fact. Say to leave rir unset in that case. wger already accepts a null rir - the field has always been optional here - and null carries the true statement, "not reported", rather than a number nobody said. A stated range is still numbers: record the lower bound, the one the trainee is sure of. Docstring and changelog only. No signature, schema or behaviour change.
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
A trainee reports effort in words at least as often as in numbers — "felt good", "a few left in the tank", "that was hard".
riris a float, so a caller that treats it as always-required has to convert, and the conversion is a guess that becomes indistinguishable from a report the moment it is stored.Nothing downstream can tell
2.0because the trainee said two from2.0because it sounded like two. Progression logic reads both as fact.Observed in production over two sessions on a self-hosted instance: six values inferred from phrases like "felt good" and "a lot more in the tank", each stored as a precise float, none of them stated. One of them was even sourced from a previous day's message the model had in context. The values were plausible — that is exactly why nobody noticed.
The change
Docstring only.
log_setnow says:rironly when the trainee gave a number;rirunset and ask afterwards.rirhas always beenfloat | None = None, so nothing in the schema, the signature or the behaviour changes. This makes the existing optionality usable by saying when to use it.Why null is better than a plausible number
nullsays "not reported", which is true.2.0says "two reps left in the tank", which is a claim the trainee never made. A missing value is visible and can be backfilled; an invented one is invisible and is read as fact by every later decision. Callers that need an effort signal and find null still have reps-versus-target, which is stated data.Tests
None added — no behaviour changed. Full suite unchanged at 247 passed,
ruff checkclean.Note
#20 also edits this docstring's
rirparagraph, adding the lower-bound rule for reported ranges. The two compose — range means numbers, words mean omit — but whichever lands second will need a small rebase to merge the two paragraphs into one.