Skip to content

feat: 1RM parity Phase 1 — canonical hybrid estimate + sync field#486

Merged
9thLevelSoftware merged 12 commits into
mainfrom
docs/1rm-parity-spec
May 30, 2026
Merged

feat: 1RM parity Phase 1 — canonical hybrid estimate + sync field#486
9thLevelSoftware merged 12 commits into
mainfrom
docs/1rm-parity-spec

Conversation

@9thLevelSoftware

Copy link
Copy Markdown
Owner

Summary

  • Add canonical hybrid 1RM estimator (Brzycki reps<=10, Epley reps>10) in \OneRepMaxCalculator.estimate()\ and route all production call sites through it
  • Ship \�stimatedOneRepMaxKg\ per exercise in the mobile sync payload; portal stores it verbatim (counterpart PR required)
  • Fix CSV export to use the same hybrid formula; document parity constant in CLAUDE.md

Test plan

  • ./gradlew :shared:testAndroidHostTest\
  • ./gradlew :androidApp:testDebugUnitTest\
  • Manual: complete a workout, sync, confirm portal exercise progress chart matches mobile estimate
  • Land together with phoenix-portal \docs/1rm-parity-spec\ PR (shared wire contract)

Made with Cursor

9thLevelSoftware and others added 10 commits May 30, 2026 13:34
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…stimate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add PortalExerciseDto.estimatedOneRepMaxKg (nullable Float) computed via
OneRepMaxCalculator.estimate (Brzycki ≤10 reps, Epley >10 reps). Mobile is
now the source of truth; portal stores verbatim and skips recomputation when
field is present. Field is nullable for backward compat with legacy payloads.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 30, 2026 20:25
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements Phase 1 of the 1RM Parity plan by introducing a canonical hybrid 1RM estimation formula (Brzycki for reps <= 10, Epley for reps > 10) in OneRepMaxCalculator and refactoring various screens, exporters, and repositories to use it. It also adds the estimatedOneRepMaxKg field to the sync DTO to ship the mobile-computed estimate to the portal. The reviewer feedback suggests using session.workingReps instead of session.totalReps in the sync adapter to avoid inflating 1RM estimates with warmup reps, along with a corresponding update to the unit tests.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

9thLevelSoftware and others added 2 commits May 30, 2026 16:33
…c/PortalSyncAdapter.kt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…c/PortalSyncAdapterTest.kt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@9thLevelSoftware 9thLevelSoftware merged commit 4df9b53 into main May 30, 2026
7 of 9 checks passed
@9thLevelSoftware 9thLevelSoftware deleted the docs/1rm-parity-spec branch May 30, 2026 20:41
@kilo-code-bot

kilo-code-bot Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

This is a rare sight - a PR that not only adds functionality but actually removes code duplication while fixing latent bugs. The hybrid Brzycki/Epley transition at reps=10 is mathematically seamless (both give 1.3333× multiplier), and the centralization of OneRepMaxCalculator.estimate() across 6 call sites means future formula tweaks won't turn into whack-a-mole.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (11 files)
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/util/Constants.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/data/sync/PortalSyncAdapter.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/data/sync/PortalSyncDtos.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/presentation/screen/ExerciseDetailScreen.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/presentation/screen/ExercisesTab.kt
  • shared/src/androidMain/kotlin/com/devil/phoenixproject/util/CsvExporter.android.kt
  • shared/src/iosMain/kotlin/com/devil/phoenixproject/util/CsvExporter.ios.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/domain/model/TrainingCycleModels.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/data/repository/SqlDelightPersonalRecordRepository.kt
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/data/repository/SqlDelightWorkoutRepository.kt
  • shared/src/commonTest/kotlin/com/devil/phoenixproject/util/OneRepMaxCalculatorTest.kt
  • shared/src/commonTest/kotlin/com/devil/phoenixproject/data/sync/PortalSyncAdapterTest.kt
  • shared/src/androidHostTest/kotlin/com/devil/phoenixproject/data/repository/SqlDelightPersonalRecordRepositoryTest.kt
  • shared/src/androidHostTest/kotlin/com/devil/phoenixproject/data/migration/MigrationManagerTest.kt
  • docs/superpowers/plans/2026-05-30-1rm-parity-mobile.md
  • docs/superpowers/specs/2026-05-30-1rm-parity-mobile-design.md
  • CLAUDE.md

Reviewed by laguna-m.1-20260312:free · 1,363,949 tokens

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.

2 participants