Files
alembic/pipeline/lib
andrew df0484c7fb Harden dedup-library.sh under set -euo pipefail (R1)
Turn on strict mode for the file that deletes music, and neutralize the
set -e footguns it exposed:

- json_emit returned non-zero in the default (non-JSON) path; as a standalone
  call that aborted the run on the first candidate. Now returns 0 explicitly.
- process_group returned 1 when a group had no files on disk, aborting the
  whole run since callers don't check it; now returns 0, with an explicit
  return 0 at the end so the loop's last status can't leak out.
- The cross-album keep-list pipeline returns non-zero on an all-comments file
  (the default) under pipefail; guarded with || true (empty = protect nobody).
- Apply-mode beet remove/import/move and rm are now best-effort (|| log WARN)
  so one failed deletion doesn't abort the rest of a confirmed apply.
- Added an explicit `exit 0`: the script previously exited non-zero in --apply
  mode because its last line was a failing `[[ $APPLY -eq 0 ]]` test, making a
  successful apply look like a failed run to the caller.

Verified: full dry-run over the real library exits 0 through all four passes;
process_group ranks FLAC over MP3, emits JSON, and handles empty groups without
aborting; and dedup:scan records success through pipeline_runner.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 17:52:26 -06:00
..