Skip to content

Allow same exercise in a routine - #53

Merged
Ramir0 merged 11 commits into
mainfrom
allow-same-exercise
Jun 6, 2026
Merged

Ramir0 merged 11 commits into
mainfrom
allow-same-exercise

Conversation

@Ramir0

@Ramir0 Ramir0 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

Ramir0 added 11 commits June 6, 2026 10:22
Adds test_import_csv_replaces_workout_exercises_growth_case to lock in the
symmetric replace-not-merge contract for WorkoutExercise rows.

The existing replace test only covers the shrink case (3 -> 2 exercises).
A future 'partial-merge optimization' that only deletes WorkoutExercise
rows whose exercise_name is absent from the new layout would silently
break the grow case (1 + 3 should yield 3, not 4 leftover + 3 new). This
test asserts the symmetric contract: re-import produces exactly the new
layout, regardless of size delta.

Passes on first run because Task 5's purge is already symmetric (deletes
ALL existing WorkoutExercise rows for the workout, then re-inserts).
Value is in regression-locking, not in surfacing a current bug.
The variable was initialized to 0, never read, never referenced in the
response dict, and only suppressed by a 'noqa: F841 — kept for response-
dict backward compat' comment that was a small lie to the reader. The
response dict only references workout_exercises_created.
…raint

- README.md: Add 'cp .env.example .env' as step 1 of Local Development
  Database. Update WORKOUT_EXERCISE schema description to note the
  (workout_id, exercise_id, exercise_index) unique key allows the same
  exercise at multiple positions.
- AGENTS.md: Update 'State of the Codebase' to reflect the new constraint,
  occurrence-aware parser, three-column-key upsert, and replace-on-reimport
  behavior (was still describing pre-allow-same-exercise state). Add the
  .env copy step to Local Development. Update Architecture section's DB
  Schema note with the new constraint details.
@Ramir0 Ramir0 linked an issue Jun 6, 2026 that may be closed by this pull request
@Ramir0
Ramir0 merged commit 7ba2188 into main Jun 6, 2026
3 checks passed
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.

Allow same exercise in a routine

1 participant