The uploads size cap trimmed source uploads once UPLOAD_DIR crossed
UPLOADS_MAX_GB (default 15 GB), so a burst of long sources got purged
mid-window ("Uploads at 28.3 GB (cap 15 GB) — trimming"). Drop the cap
entirely: the function, the UPLOADS_MAX_GB env knob, its call in the
cleanup task and the scope test.
Sources are still bounded by the age-based _sweep_expired_uploads sweep
(they age out with JOB_RETENTION_SECONDS), and the OUTPUT_MAX_GB cap is
untouched.
The hourly sweep deleted job dirs and source uploads by age alone. With the
queue backed up (22-sep-2026) free jobs waited over an hour, so their dir
was removed under the worker: no clips, and the minute reservation stayed
held until the 3 h stuck sweep. 21 free users lost their job that way today,
most of them on their first run.
- _job_is_active(): running here, queued/processing in memory, or a fresh
resume manifest (the other instance's jobs during a handover). Manifests
pin a dir for at most ACTIVE_JOB_MAX_SECONDS (24 h).
- The age sweeps and both size caps skip active jobs and their sources.
- run_job_wrapper settles the reservation from the job record it started
with, so a vanished entry releases the minutes instead of holding them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>