workout generator audit: rules engine, structure rules, split patterns, injury UX, metadata cleanup

- Add rules_engine.py with quantitative rules for all 8 workout types
- Add quality gate retry loop in generate_single_workout()
- Expand calibrate_structure_rules to all 120 combinations (8 types × 5 goals × 3 sections)
- Wire WeeklySplitPattern DB records into _pick_weekly_split()
- Enforce movement patterns from WorkoutStructureRule in exercise selection
- Add straight-set strength support (single main lift, 4-6 rounds)
- Add modality consistency check for duration-dominant workout types
- Add InjuryStep component to onboarding and preferences
- Add sibling exercise exclusion in regenerate and preview_day endpoints
- Display generator warnings on dashboard
- Expand fix_rep_durations, fix_exercise_flags, fix_movement_pattern_typo
- Add audit_exercise_data and check_rules_drift management commands
- Add Next.js frontend with dashboard, onboarding, preferences, history pages
- Add generator app with ML-powered workout generation pipeline
- 96 new tests across 7 test modules

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-22 20:07:40 -06:00
parent 2a16b75c4b
commit 1c61b80731
111 changed files with 28108 additions and 30 deletions

View File

@@ -0,0 +1,54 @@
# Generated by Django 5.1.4 on 2026-02-20 22:03
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercise', '0008_exercise_video_override'),
]
operations = [
migrations.AddField(
model_name='exercise',
name='complexity_rating',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='exercise',
name='difficulty_level',
field=models.CharField(blank=True, choices=[('beginner', 'Beginner'), ('intermediate', 'Intermediate'), ('advanced', 'Advanced')], max_length=16, null=True),
),
migrations.AddField(
model_name='exercise',
name='exercise_tier',
field=models.CharField(blank=True, choices=[('primary', 'Primary'), ('secondary', 'Secondary'), ('accessory', 'Accessory')], max_length=16, null=True),
),
migrations.AddField(
model_name='exercise',
name='hr_elevation_rating',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='exercise',
name='impact_level',
field=models.CharField(blank=True, choices=[('none', 'None'), ('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], max_length=8, null=True),
),
migrations.AddField(
model_name='exercise',
name='is_compound',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='exercise',
name='progression_of',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='progressions', to='exercise.exercise'),
),
migrations.AddField(
model_name='exercise',
name='stretch_position',
field=models.CharField(blank=True, choices=[('lengthened', 'Lengthened'), ('mid', 'Mid-range'), ('shortened', 'Shortened')], max_length=16, null=True),
),
]

View File

@@ -0,0 +1,24 @@
# Generated by Django 5.1.4 on 2026-02-21 05:06
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercise', '0009_exercise_complexity_rating_exercise_difficulty_level_and_more'),
]
operations = [
migrations.AlterField(
model_name='exercise',
name='complexity_rating',
field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)]),
),
migrations.AlterField(
model_name='exercise',
name='hr_elevation_rating',
field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10)]),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.1.4 on 2026-02-21 05:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercise', '0010_alter_exercise_complexity_rating_and_more'),
]
operations = [
migrations.AlterField(
model_name='exercise',
name='name',
field=models.CharField(default='', max_length=512),
),
]