Unraid deployment fixes and generator improvements

- Add Next.js rewrites to proxy API calls through same origin (fixes login/media on werkout.treytartt.com)
- Fix mediaUrl() in DayCard and ExerciseRow to use relative paths in production
- Add proxyTimeout for long-running workout generation endpoints
- Add CSRF trusted origin for treytartt.com
- Split docker-compose into production (Unraid) and dev configs
- Show display_name and descriptions on workout type cards
- Generator: rules engine improvements, movement enforcement, exercise selector updates
- Add new test files for rules drift, workout research generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-23 10:25:45 -06:00
parent 1c61b80731
commit 03681c532d
21 changed files with 2366 additions and 138 deletions

View File

@@ -889,6 +889,8 @@ class ExerciseSelector:
selected_names = set()
# Intra-superset family tracking
selected_family_groups = set() # group names used in this superset
selected_families = set() # exact families used in this superset
selected_family_counts = Counter() # exact family counts in this superset
# Shuffle to break any ordering bias
random.shuffle(pool)
@@ -910,8 +912,14 @@ class ExerciseSelector:
for fam in candidate_families:
# Cross-workout: check family count limit
total_count = self.used_movement_families.get(fam, 0)
if total_count >= self._get_family_limit(fam):
historical_count = self.used_movement_families.get(fam, 0)
in_superset_count = selected_family_counts.get(fam, 0)
if historical_count + in_superset_count >= self._get_family_limit(fam):
blocked = True
break
# Intra-superset: avoid exact family duplicates entirely.
if fam in selected_families:
blocked = True
break
@@ -930,6 +938,8 @@ class ExerciseSelector:
selected_names.add(candidate_name)
# Track family groups for intra-superset blocking
for fam in candidate_families:
selected_families.add(fam)
selected_family_counts[fam] += 1
group = _FAMILY_TO_GROUP.get(fam)
if group:
selected_family_groups.add(group)

File diff suppressed because it is too large Load Diff