Skip to content

fix: normalize activity and workout detail semantics - #1

Open
ericlitman wants to merge 7 commits into
danmarai:mainfrom
ericlitman:codex/tonal-6-unperformed-set-analytics
Open

fix: normalize activity and workout detail semantics#1
ericlitman wants to merge 7 commits into
danmarai:mainfrom
ericlitman:codex/tonal-6-unperformed-set-analytics

Conversation

@ericlitman

Copy link
Copy Markdown

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

  • History limits are enforced locally over Tonal's fixed 50-row activity page,
    with activity type, strength eligibility, and completeness metadata exposed
    instead of an unverified pagination promise.
  • Raw detail excludes Rest rows and distinguishes resistance work from
    off-machine duration movements without making mixed-workout totals unsafe to
    sum.
  • An upstream execution sentinel determines whether difficulty, consistency,
    and suggested-weight zeroes are real measurements or placeholders from a set
    that never started. Legitimate zero scores and configured mode flags remain
    intact.
  • Bilateral StraightBar load, 1RM, and suggestion fields use one total-load
    convention across CLI detail, MCP detail, and MCP exercise history; upstream
    volume is not doubled.
  • Detail 404s distinguish known external activities, temporarily unavailable
    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.
  • A live reference workout containing one performed set and three never-started
    sets returned null analytics only for the unperformed rows; the CLI
    aggregate changed from the fabricated 0.06 to the performed-only 0.23.
  • Compound review findings were fixed and regression-tested; the final
    read-only review-agent pass returned no findings.

Post-Deploy Monitoring & Validation

  • Window and owner: repository maintainer, first 24 hours after merge and the
    next live Tonal detail invocation.
  • Smoke test: run CLI detail <activity_id> and MCP get_workout_detail for a
    workout containing performed and skipped sets; confirm skipped analytics are
    null, performed zero scores remain 0, and mode flags remain present.
  • Cross-surface check: compare a bilateral StraightBar set in CLI detail, MCP
    detail, and MCP exercise history; load and 1RM must agree while volume stays
    unchanged.
  • Error-path check: request detail for a known External activity and an unknown
    ID; expect no_strength_data, or activity_type_unknown when the observed
    50-row page cannot prove absence.
  • Failure signals: TypeError, unsupported operand type, raw placeholder-zero
    analytics entering averages, divergent StraightBar loads, or a definitive
    activity_not_found result paired with a full source page.
  • Telemetry: this repository has no centralized runtime dashboard. Inspect the
    invoking CLI/MCP process logs for the failure strings above and watch GitHub
    issues for response-shape regressions during the validation window.
  • Rollback trigger: any exception on previously readable workout detail or a
    reproducible CLI/MCP load mismatch. Revert this PR and retain the captured
    response fixture before retrying the rollout.

Fixes TONAL-6.


Compound Engineering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant