v1.0.0:7 — exercise library cleanup, photo-import removal, AI-section honesty

Library JSON cleanup (proof-of-work/prisma/exercises.seed.json)
  19 exercises corrected:
  - Cycling/Jump Rope/Rowing/Running: type=cardio with proper
    inputFields (duration/distance/calories — no more reps/weight).
  - Walking Lunge/Wall Sit/Headstand/Hip Extension: reclassified
    out of cardio into bodyweight.
  - Plank/Mace warmup/Hollow Body Landmine/Soccer: inputFields
    fixed.
  - Descriptions added for ~10 cryptic exercises (Core, Resistance
    Band, Stir the pot, Slide Board, Neck Circuit, TGU, Captains
    of Crush, etc.).

Reconcile-on-boot (ensureExerciseLibrary.cjs)
  Changed from INSERT-OR-IGNORE to INSERT-OR-UPDATE keyed on
  (userId, name). Existing rows where isCustom = 0 get
  description/type/muscleGroups/inputFields/defaultWeightUnit
  refreshed from the curated JSON. Rows where isCustom = 1 are
  skipped — user customizations always win.

  Verified end-to-end: applied patches propagate to a copy of the
  user's snapshot DB; manually-tampered isCustom=1 rows survive a
  second reconcile pass untouched.

PATCH /api/exercises/[id] flips isCustom -> true on user edits
  Once you edit a library exercise via the in-app UI, the row's
  isCustom flag becomes 1 and the boot-time reconcile leaves it
  alone forever. Closes the only failure mode where a maintainer
  curated-library refresh could overwrite user edits.

Photo-import (Claude vision) removed
  - app/api/workouts/import/route.ts deleted.
  - components/import/WorkoutImportClient.tsx deleted (orphan
    component — wasn't referenced anywhere by the live UI).
  - CSV import (app/main/import → page-csv.tsx →
    /api/workouts/import/save) is unchanged. The save endpoint
    stays — it's used by the CSV flow too.

Settings UI: "Claude AI Integration" section removed
  The toggle + API key input promised "personalized workout
  recommendations" that the codebase never delivered (the only
  actually-wired use was the photo-import we just removed).
  Schema columns User.enableClaudeAI / User.claudeApiKey stay
  as harmless dead fields — they'll get cleaned up or repurposed
  when the model-agnostic AI work lands. The preferences API
  no longer accepts or returns those fields.

No data migration. /data on existing installs is untouched.
v1.0.0:7 promoted to current; :1-:6 in other.
This commit is contained in:
Keysat
2026-05-09 21:24:00 -05:00
parent ffa8e0d480
commit 55c17614b8
11 changed files with 189 additions and 1427 deletions
+13 -6
View File
@@ -141,12 +141,19 @@ if command -v sqlite3 >/dev/null 2>&1 && [ -f "$DB_PATH" ]; then
fi
# -----------------------------------------------------------------------------
# Step 3 — ensure curated exercise library for every user (multi-user-aware).
# New entries shipped in /app/prisma/exercises.seed.json appear on every boot.
# `INSERT OR IGNORE` keyed on (userId, name) so we never overwrite a user's
# own custom exercises. Designed to be additive only — exercises removed from
# the curated JSON are not deleted from existing installs (users may have
# logged sets against them).
# Step 3 — reconcile curated exercise library for every user
# (multi-user-aware). As of v1.0.0:7 this is INSERT-or-UPDATE rather than
# INSERT-or-IGNORE: existing rows where isCustom = 0 get refreshed from
# /app/prisma/exercises.seed.json so maintainer-side fixes (e.g. correct
# inputFields for cardio) propagate to existing installs. Rows where
# isCustom = 1 are skipped — user customizations win.
#
# PATCH /api/exercises/[id] flips isCustom to 1 on any user edit, so the
# moment you change a library exercise via the in-app UI it stops getting
# overwritten on subsequent boots.
#
# Additive on names: exercises removed from the curated JSON are NOT
# deleted from existing installs (users may have logged sets against them).
# -----------------------------------------------------------------------------
if [ -f "$LIBRARY_JSON_PATH" ] && [ -f "$DB_PATH" ]; then
log "ensuring curated exercise library is present for every user"