catacomb/src
Luna c1bd88d800 Stability hardening: crash.log + disk-full preflight (2.5)
Two independent improvements from Phase 2.5.

## Panic hook → crash.log

GUI users launched from a .desktop file have no stderr — today panics
vanish without trace. Install a panic::set_hook early in main() that
appends a structured entry to <library_root>/yt-offline.crash.log for
every panic from every thread (UI, axum workers, downloader spawns,
tray bg thread, thumbnail decode workers).

Each entry: ISO-8601 timestamp, thread name, file:line, panic message,
and a backtrace when RUST_BACKTRACE is set. The default panic hook
still runs after ours, so dev workflows keep getting the stderr trace.

Bounded: when the log passes 256 KB the next write rotates it to .1
(one previous generation kept). No external date library — small
civil-time formula in-tree.

## Disk-full preflight

Before yt-dlp ever launches, statvfs the target filesystem. If free
space is under 500 MB, push a synthetic Failed job classified as
DiskFull instead of starting yt-dlp. That way:

- Users see the actual problem ("only 230 MB free on /mnt/…") in the
  Downloads modal with the same "free up space and retry" hint the
  error-classifier emits for mid-download ENOSPC.
- No half-written file lands on disk.
- No 30-second yt-dlp warmup wasted on a doomed run.

statvfs returning None (non-Unix, missing path) skips the check —
better to let yt-dlp run than to refuse on no data.

5 new tests: 3 in crash (civil-time, log shape, real-panic capture),
2 in disk_space (statvfs plumbing + missing-path None). 74 pass total.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 02:53:56 -07:00
..
web_ui Library restore — idempotent backup import (2.4) 2026-05-27 02:43:18 -07:00
app.rs Library restore — idempotent backup import (2.4) 2026-05-27 02:43:18 -07:00
config.rs Tray: minimize-to-tray is opt-in via config 2026-05-27 02:18:28 -07:00
crash.rs Stability hardening: crash.log + disk-full preflight (2.5) 2026-05-27 02:53:56 -07:00
database.rs Library restore — idempotent backup import (2.4) 2026-05-27 02:43:18 -07:00
disk_space.rs Stability hardening: crash.log + disk-full preflight (2.5) 2026-05-27 02:53:56 -07:00
download_options.rs Per-video state flags + smart folders + comments capture (Tartube parity 1.3/1.4) 2026-05-25 21:57:52 -07:00
downloader.rs Stability hardening: crash.log + disk-full preflight (2.5) 2026-05-27 02:53:56 -07:00
error_class.rs Classify yt-dlp failures into actionable buckets (2.3) 2026-05-27 02:32:45 -07:00
library.rs Channel folder hierarchy (Tartube parity 1.2) 2026-05-25 22:07:42 -07:00
main.rs Stability hardening: crash.log + disk-full preflight (2.5) 2026-05-27 02:53:56 -07:00
maintenance.rs Add bundled yt-dlp, music library, Plex metadata, sort by date; security + perf hardening 2026-05-23 04:54:26 -07:00
platform.rs Upload date in UI; extract HTML_UI; Twitch clips mode; DB connection pool 2026-05-25 01:17:08 -07:00
plex.rs Add multi-platform support: TikTok, Twitch, Vimeo, Bandcamp, SoundCloud, Odysee 2026-05-24 22:16:40 -07:00
stats.rs Add statistics view, editable source_url, rewrite security audit 2026-05-23 05:34:29 -07:00
theme.rs Desktop: shuffle + library backup + theme contrast fixes 2026-05-26 03:09:50 -07:00
tray.rs Add system tray with minimize-to-tray (Tartube parity 1.6) 2026-05-27 02:17:10 -07:00
web.rs Library restore — idempotent backup import (2.4) 2026-05-27 02:43:18 -07:00
ytdlp_bin.rs Switch bundled yt-dlp to a Python venv with curl_cffi for impersonation 2026-05-24 23:17:27 -07:00