fix: normalize activity and workout detail semantics - #1
Open
ericlitman wants to merge 7 commits into
Open
Conversation
added 7 commits
July 30, 2026 11:58
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.
Summary
Tonal activity and workout-detail responses now tell callers what the upstream
data actually supports: strength workouts are separated from external
activities, fixed-page history gaps remain explicitly uncertain, and
unperformed sets no longer look like completed zero-difficulty work.
The CLI and MCP views now agree on user-facing load and performance semantics,
including bilateral StraightBar totals, off-machine duration movements, warm-up
volume, raw-versus-formatted side splits, and structured detail failures.
Behavioral contract
with activity type, strength eligibility, and completeness metadata exposed
instead of an unverified pagination promise.
off-machine duration movements without making mixed-workout totals unsafe to
sum.
and suggested-weight zeroes are real measurements or placeholders from a set
that never started. Legitimate zero scores and configured mode flags remain
intact.
convention across CLI detail, MCP detail, and MCP exercise history; upstream
volume is not doubled.
strength detail, definitive absence on an exhausted page, and uncertainty
beyond a full page.
Validation
python3 -m unittest discover -s tests -v— 25 tests passed.python3 -m compileall -q mcp tonal_tool.py tests— passed.git diff --check— passed.sets returned
nullanalytics only for the unperformed rows; the CLIaggregate changed from the fabricated
0.06to the performed-only0.23.read-only review-agent pass returned no findings.
Post-Deploy Monitoring & Validation
next live Tonal detail invocation.
detail <activity_id>and MCPget_workout_detailfor aworkout containing performed and skipped sets; confirm skipped analytics are
null, performed zero scores remain0, and mode flags remain present.detail, and MCP exercise history; load and 1RM must agree while volume stays
unchanged.
ID; expect
no_strength_data, oractivity_type_unknownwhen the observed50-row page cannot prove absence.
TypeError,unsupported operand type, raw placeholder-zeroanalytics entering averages, divergent StraightBar loads, or a definitive
activity_not_foundresult paired with a full source page.invoking CLI/MCP process logs for the failure strings above and watch GitHub
issues for response-shape regressions during the validation window.
reproducible CLI/MCP load mismatch. Revert this PR and retain the captured
response fixture before retrying the rollout.
Fixes TONAL-6.