3.0 KiB
3.0 KiB
Plan: captures
Ordered tasks; each names its verification (tests in fsdy/src/lib.rs,
crabidy-server/src/capture.rs, crabidy-server/src/capture_store.rs
and/or gates in quality/captures.md). Stubs, the proto field, tidal's
flag rule, and the full orchestrator/TUI plumbing exist; the new tests
fail on todo!() at plan time.
- T1 — fsdy file-playable constructor.
TrackFile::from_track_with_file: metadata likefrom_track, playablefile = <relative sibling>. Verifies:from_track_with_file_plays_the_relative_sibling. - T2 — capture.rs naming + extension helpers.
audio_file_name(sharedordered_namesemantics via a public fsdy seam) andextension_for(Content-Type map, URL-path fallback,bin). Verifies:extension_prefers_content_type_then_url_then_bin,audio_files_pair_with_their_toml_names. - T3 — shared walk. Move the bookmark walk into
capture::capture_into/write_treeparameterized byCapsandSink; per-track writes go throughwrite_track(Sink::Link= today's link file). RewireBookmarkStoreonto it (delete its copy; keep its public API andBOOKMARK_CAPS-equivalent behavior). Verifies: all existingbookmark_store::testsunchanged; gates "Shared walk". - T4 — download sink.
Downloader::new(connect timeout),Sink::Downloadinwrite_track: per-track deadline around URL fetch, GET, and the streamed body againstbytes_left,error_for_status, extension from the response, audio first then toml (from_track_with_file). Verifies:download_capture_writes_audio_next_to_pointing_tomls,download_capture_is_all_or_nothing,download_capture_enforces_its_caps; gates "Download sink". - T5 — CaptureStore.
open(create dir + build downloader),capture→ blessing check (source_allows_download: node or track parent) thencapture_with_caps(DOWNLOAD_CAPS)→capture_into. Verifies:capture_requires_the_root_download_blessing,capturing_a_single_blessed_track_writes_one_pair,capture_validates_names_and_overwrites; gates "Opt-in". - T6 — TUI tests. Binding test for
W(Library scope, shift),selected_downloadablegating (queueable-but-not-downloadable stays closed; tracks inherit the node flag), overlay labelcapture, submit carriesdownload: true. Verifies: newcbd-tuitests; gates "TUI". - T7 — full verification. Whole workspace suite green;
clippy/fmt/taplo/markdownlint clean; walk every gate in
quality/captures.mdand tick it; notodo!()left. - T8 — live smoke test. Capture a real Tidal track with download
through the provider layer into a temp store (a single track keeps the
probe cheap; the multi-track walk is unit-covered), verify the audio
exists with a plausible size, replay through a
/capturesinstance, and play-resolve it — remove any temporary probe afterwards. - T9 — docs.
plan/summary.mdsection incl. deviations; reconcilearchitecture/captures.md(tidal flag rule, anything else that moved).