After a reload the ephemeral /videos/ files may be cleaned up (1h retention),
leaving black previews on the results screen. For managed users, fetch the job's
clips from /api/history (now includes clip_index) and fall back to the durable R2
url on video error (with a retry for the load race).
- cloud/storage.py: R2 (S3-compatible) client — upload, presigned view/download
URLs, delete-by-prefix.
- cloud/videos.py: archive a completed managed job's clips to R2 under
users/<uid>/<job>/, GET /api/history (private signed links), and a retention
sweeper that deletes a user's videos 7 days after their subscription ends.
- models.py: user_videos table (created via create_all).
- app.py: archive clips to R2 on managed-job completion.
- billing.py: email the admin the moment a subscriber hits cancel.
- Frontend: History tab (library grid with per-video view + download).
R2 bucket 'openshorts-videos' + scoped API token created; end-to-end verified:
archive -> presigned GET (200) -> purge after grace -> object 404.