Skip to content

feat: recommend workouts using catalogue equipment alternatives - #91

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-90-catalogue-recommendations
Nov 16, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-90-catalogue-recommendations

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

BetterFit now offers getRecommendedWorkout(from:), which creates the first planned workout using real catalogue exercises when equipment is unavailable. Repeated exercise entries are swapped individually, with catalogue metadata and target sets preserved; the existing no-argument API keeps its generated alternatives.

Part of #5. Closes #90.

Verification

  • mise run lint passed with 0 serious violations and 491 existing warnings.
  • mise run build passed.
  • mise run test passed with 23 pipeline checks, 169 XCTest tests and 105 Swift Testing tests.
  • git diff origin/main --check passed.

The branch was rebased onto main after the sweep merged #89 and #87, then all three mise gates were rerun successfully.

Proof

Core logic test capture succeeded. The seven new tests in CatalogueRecommendationTests exercise the facade through plan selection, template creation and catalogue swaps. The transcript verifies repeated entries, target sets and stored data, catalogue preference and changing availability, unchanged unmatched entries, current-week selection, five missing-plan/template cases, empty templates and compatibility with the existing API.

==> summary: 23 passed, 0 failed
Executed 169 tests, with 0 failures (0 unexpected) in 2.284 (2.306) seconds
Test noArgumentAPIStillUsesGeneratedAlternatives() passed after 0.023 seconds.
Test usesFirstTemplateInCurrentWeek() passed after 0.023 seconds.
Test leavesUnmatchedEntriesUnchanged(_:) with 3 test cases passed after 0.023 seconds.
Test returnsNilWithoutScheduledTemplate(_:) with 5 test cases passed after 0.020 seconds.
Test swapsEveryRepeatedEntryAndPreservesTargetsAndStoredData() passed after 0.022 seconds.
Test emptyTemplateStillProducesAnEmptyWorkout() passed after 0.021 seconds.
Test choosesFirstEligibleCatalogueExerciseAndReflectsAvailabilityChanges() passed after 0.021 seconds.
Suite CatalogueRecommendationTests passed after 0.028 seconds.
Test run with 105 tests in 15 suites passed after 0.028 seconds.

No app screens changed. Simulator and UI test captures were not required for this core-package slice; no capture method was blocked. Full local gate transcripts are under .tmp/proof/ and are not committed.

Verification after merge

On merged main at c4090af, mise run lint, mise run build, mise run test and git diff origin/main --check all passed. Lint reported 491 existing warnings and no serious violations. Build completed in 33.36 seconds. The fresh core-logic capture shows 23 pipeline checks, 169 XCTest tests and 105 Swift Testing tests passing.

==> summary: 23 passed, 0 failed
Executed 169 tests, with 0 failures (0 unexpected) in 2.230 (2.248) seconds
Executed 169 tests, with 0 failures (0 unexpected) in 2.230 (2.250) seconds
Test returnsNilWithoutScheduledTemplate(_:) with 5 test cases passed after 0.024 seconds.
Test usesFirstTemplateInCurrentWeek() passed after 0.025 seconds.
Test leavesUnmatchedEntriesUnchanged(_:) with 3 test cases passed after 0.026 seconds.
Test noArgumentAPIStillUsesGeneratedAlternatives() passed after 0.026 seconds.
Test emptyTemplateStillProducesAnEmptyWorkout() passed after 0.027 seconds.
Test choosesFirstEligibleCatalogueExerciseAndReflectsAvailabilityChanges() passed after 0.027 seconds.
Test swapsEveryRepeatedEntryAndPreservesTargetsAndStoredData() passed after 0.027 seconds.
Suite CatalogueRecommendationTests passed after 0.030 seconds.
Test run with 105 tests in 15 suites passed after 0.030 seconds.

No app screens changed, so visual captures were not applicable. No capture method was blocked. The initial lint attempt required trusting this worktree with mise trust; the rerun passed.

After merging the metadata-only release PR #92, all three mise gates passed again on main at 54cae9d. Results remained 491 lint warnings with no serious violations, 23 passing pipeline checks, 169 passing XCTest tests and 105 passing Swift Testing tests. The working tree is clean.

Reviewer notes

Entries without a catalogue match remain unchanged and may still require unavailable equipment. Callers supply a movement-appropriate catalogue; exact muscle matching alone does not establish movement equivalence. Target weights are preserved, without load conversion. Recovery-based ranking and iOS/watch catalogue wiring remain follow-up slices under #5.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy merged commit c4090af into main Nov 16, 2026
10 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-90-catalogue-recommendations branch November 16, 2026 15:23
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.

Recommend planned workouts using catalogue equipment alternatives

1 participant