crabidy/quality/incremental-captures.md

2.8 KiB

Quality gates: incremental-captures

Criteria beyond the automatic tests. Each gate is pass/fail by reading the code. Tests live next to the modules they cover (fsdy, capture, capture_store, playback, cbd-tui).

Skipped playable (D1)

  • [playable] skipped = true parses; skipped = false, skipped combined with another field, and an empty table are typed PlayableCardinality-style errors — never panics.
  • from_track on an is_skipped wire track writes a skipped playable (queue persistence and bookmarks keep skipped-ness); to_track sets is_skipped and keeps the lib path.
  • get_urls_for_track on a skipped file is a typed error, not empty-vec success.

Incremental capture (D2)

  • Download captures write into the final folder with no tmp/swap and never delete existing entries; bookmark captures keep tmp-and-swap byte-identically (their existing tests pass unchanged).
  • Enumeration enforces max_dirs/max_tracks before any download; the byte budget counts only bytes downloaded this run.
  • Reuse rule: parseable toml + non-skipped playable (+ existing file for file playables) is not re-downloaded; skipped/broken/missing-audio entries are re-captured.
  • Uncapturable tracks write skipped tomls (no more silent omission); real download failures abort the run but keep prior writes.
  • Stream URLs and cookies never appear in errors, logs, or progress events (only names, paths, counts).

Progress + RPC (D4)

  • CaptureLibraryNode replies after validation (name, store enabled, download blessing) with the existing status mapping; the walk runs spawned and reports through CaptureProgress updates ending in exactly one finished event (success or error).
  • The progress channel is bounded; a vanished receiver does not abort the capture.

Playback (D3)

  • play skips is_skipped tracks without a provider call and bounds skipping by the queue length at entry: an all-skipped repeat queue stops with a warning instead of spinning.

TUI (D5, D7)

  • Skipped tracks render red in queue and library; the current-track marker keeps precedence.
  • Progress lines show name, done/total, and skipped count; finished lines expire on the render tick; errors render red.
  • The W binding description and the download-capture input label warn that captures can take long and resume by name.
  • The selected row of a focused pane renders colored items with the dark foreground (readable on the light bar); unfocused panes keep the colored foregrounds.

Hygiene

  • New/changed public items documented, stating error/edge behavior.
  • clippy -D warnings, fmt, taplo, markdownlint clean; all tests green.
  • architecture/incremental-captures.md reconciled where the implementation diverged.