Extract the entire Sync Run pipeline from cli.run() into a standalone sync_run() function. Slim cli.py to a thin argparse→exit adapter (~80 lines). Introduce SyncRunResult. This is the capstone issue that wires all previous deep modules together.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#25 — PRD 001: Deepen Architecture — Module Depth & Domain Alignment
What to build
Extract the entire Sync Run pipeline from
cli.run()into a standalonesync_run()function. Slimcli.pyto a thin argparse→exit adapter (~80 lines). IntroduceSyncRunResult. This is the capstone issue that wires all previous deep modules together.End state:
librofm_downloader/sync_run.pysync_run(config, secrets_path, history_path, *, verbose, limit, workers, select_mode) -> SyncRunResultcli.py: parse args → callsync_run()→ translate exit code →sys.exit(). ≤80 lines.SyncRunResultfrozen dataclass: downloaded_count, skipped_count, failed_count, failed_books, skipped_books, interruptedOrchestratorResultdeprecated;download_all_books()returnsSyncRunResultsync_run()itselfMigration: ~24 test classes move from
test_cli.pyto newtest_sync_run.py. CLI tests keep only argparse + exit-code translation.Acceptance criteria
sync_run()callable and returns correctSyncRunResultfor: happy path, auth failure, empty library, mixed results, Ctrl+Ccli.py≤80 lines; contains only argparse + exit code translationtest_cli.pypatches load_config/LibroFmSession/DownloadHistory/download_book/DownloadReportertest_sync_run.pyBlocked by
DownloadResultand slimmeddownload_book()✅ Merged via
f371152— sync_run pipeline extracted, CLI slimmed to 65-line adapter, 374 tests passing.