Move the `_write_history()` function from `downloader.py` to `history.py`. This refactoring separates persistence logic from download orchestration, ensuring `downloader.py` focuses solely on its core responsibility.
Guard DownloadHistory.write() with a threading.Lock so concurrent
worker threads do not corrupt or lose history entries during parallel
downloads. Lock wraps both _data mutation and disk flush; read-only
methods (is_downloaded, find) stay lock-free per CPython dict atomicity.
Closes#13
Add the data layer that feeds into downloads: OAuth2 password grant
authentication via httpx, paginated library fetching across all pages,
download history JSON read/write with corrupt-recovery safety, and a
CLI skeleton that wires config → auth → fetch → filter → print.
16 new tests (6 client + 7 history + 3 CLI), 41 total passing.
All 11 acceptance criteria met.