soulsync/tests/quality
dev ab05508acc feat(quality): rank-based candidate ordering toggle for priority mode
Adds an opt-in `rank_candidates_by_quality` profile flag. When on, the
priority-mode download walk orders candidates by the ranked-target quality
(confidence/speed only break ties) instead of confidence-first. Default off
keeps the byte-for-byte old behaviour, so existing installs are unaffected.

Best-quality search mode is always quality-first regardless of the flag; the
toggle only affects priority mode. Search-time source selection is unchanged —
nothing is skipped, so a track can never go missing, only the order in which
copies are tried changes.

The version-mismatch force-import follows automatically: it accepts the
first-tried (= best-ordered) quarantined candidate, which is the highest-quality
one once the walk is quality-first. No change to its selection logic needed.

- core/quality/selection.py: load_rank_candidates_by_quality() (fail-closed).
- core/downloads/task_worker.py: _best_quality_ordering -> _candidate_ordering;
  quality-first when best_quality mode OR the toggle is on.
- database/music_database.py: default profile carries the flag (False).
- web_server.py: flag is preserved globally across preset apply/reset, like
  search_mode.
- core/imports/version_mismatch_fallback.py: comment clarified (no behaviour
  change).

Tests (TDD): load_rank_candidates_by_quality default/enabled/disabled/error;
_candidate_ordering across all mode+toggle combinations + fail-closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:00:57 +02:00
..
test_engine_fallback.py fix(quality): correct ranking behaviour flagged in PR #896 (#3, #4) 2026-06-24 21:25:36 +02:00
test_model.py feat(quality): make every audio format controllable via ranked targets 2026-06-24 23:01:20 +02:00
test_quality_meets_profile.py feat(quality): unify quality scanner onto the real ranked-target core (strict) 2026-06-14 22:50:01 +02:00
test_quality_presets.py feat(quality): migrate old per-source Hi-Res preference into the profile (#896 #5) 2026-06-24 21:39:53 +02:00
test_search_all_sources.py fix(downloads): keep terminal tasks visible during active batch + concurrent pool 2026-06-14 20:08:56 +02:00
test_search_mode.py feat(quality): rank-based candidate ordering toggle for priority mode 2026-06-25 22:00:57 +02:00
test_selection.py feat(quality): quality-aware source fall-through in search_with_fallback 2026-06-14 12:33:34 +02:00
test_source_map.py feat(quality): make every audio format controllable via ranked targets 2026-06-24 23:01:20 +02:00
test_source_tier.py feat(quality): derive per-source download tier from the global profile 2026-06-14 13:18:01 +02:00
test_track_result_quality.py feat(quality): source mappers + populate real quality on streaming results 2026-06-14 12:27:03 +02:00