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:
@@ -18,7 +18,8 @@ from generator.rules_engine import DB_CALIBRATION
|
||||
class Command(BaseCommand):
|
||||
help = (
|
||||
'Check for drift between research doc calibration values '
|
||||
'and WorkoutType DB records. Exits 1 if mismatches found.'
|
||||
'and WorkoutType DB records. Exits 1 if mismatches, missing '
|
||||
'types, or zero fields checked.'
|
||||
)
|
||||
|
||||
# Fields to compare between DB_CALIBRATION and WorkoutType model
|
||||
@@ -73,14 +74,32 @@ class Command(BaseCommand):
|
||||
self.stdout.write('')
|
||||
|
||||
if missing_in_db:
|
||||
self.stdout.write(self.style.WARNING(
|
||||
self.stdout.write(self.style.ERROR(
|
||||
f'Missing from DB ({len(missing_in_db)}):'
|
||||
))
|
||||
for name in missing_in_db:
|
||||
self.stdout.write(f' - {name}')
|
||||
self.stdout.write('')
|
||||
|
||||
has_errors = False
|
||||
|
||||
if checked == 0:
|
||||
has_errors = True
|
||||
self.stdout.write(self.style.ERROR(
|
||||
'No calibration fields were checked. '
|
||||
'DB_CALIBRATION keys likely do not match WorkoutType.name values.'
|
||||
))
|
||||
self.stdout.write('')
|
||||
|
||||
if missing_in_db:
|
||||
has_errors = True
|
||||
self.stdout.write(self.style.ERROR(
|
||||
'Missing workout types prevent full drift validation.'
|
||||
))
|
||||
self.stdout.write('')
|
||||
|
||||
if mismatches:
|
||||
has_errors = True
|
||||
self.stdout.write(self.style.ERROR(
|
||||
f'DRIFT DETECTED: {len(mismatches)} mismatch(es)'
|
||||
))
|
||||
@@ -98,8 +117,9 @@ class Command(BaseCommand):
|
||||
'To fix: update WorkoutType records in the DB or '
|
||||
'update DB_CALIBRATION in generator/rules_engine.py.'
|
||||
))
|
||||
if has_errors:
|
||||
sys.exit(1)
|
||||
else:
|
||||
self.stdout.write(self.style.SUCCESS(
|
||||
'No drift detected. DB values match research calibration.'
|
||||
))
|
||||
|
||||
self.stdout.write(self.style.SUCCESS(
|
||||
'No drift detected. DB values match research calibration.'
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user