Issue #30: Download Reporting — Bound Callable Per Book #30

Closed
opened 2026-06-04 13:51:01 +02:00 by AlexKucera · 1 comment
AlexKucera commented 2026-06-04 13:51:01 +02:00 (Migrated from github.com)

Parent

#25 — PRD 001: Deepen Architecture — Module Depth & Domain Alignment

What to build

Change start_download(book) to return a bound callable that already targets the correct progress bar. Task identity becomes fully internal to ProgressReporter. Orchestrator no longer creates closures.

End state:

  • ProgressReporter.start_download(book) returns Callable[[int], None] bound to the correct task
  • PlainTextReporter.start_download(book) returns None
  • Task identity (task_id) is never exposed outside progress.py
  • complete(book) and fail(book, reason) look up task id internally via id(book)
  • Orchestrator passes bound callback to download_fn directly — no _progress(completed) closure
  • Old update(bytes_downloaded, task_id=...) API removed or made private

Acceptance criteria

  • start_download() returns bound callable for TTY reporter, None for plain text
  • Bound callable updates the correct bar; no cross-bar contamination possible
  • No test outside test_progress.py references task_id
  • Orchestrator has zero closure-wiring code for progress
  • Parallel download tests pass without per-book closure binding
  • complete()/fail() still work correctly with internal task lookup

Blocked by

  • #29 — needs final download_book() shape to verify orchestrator wiring
## Parent #25 — PRD 001: Deepen Architecture — Module Depth & Domain Alignment ## What to build Change `start_download(book)` to return a bound callable that already targets the correct progress bar. Task identity becomes fully internal to `ProgressReporter`. Orchestrator no longer creates closures. **End state:** - `ProgressReporter.start_download(book)` returns `Callable[[int], None]` bound to the correct task - `PlainTextReporter.start_download(book)` returns `None` - Task identity (`task_id`) is never exposed outside `progress.py` - `complete(book)` and `fail(book, reason)` look up task id internally via `id(book)` - Orchestrator passes bound callback to download_fn directly — no `_progress(completed)` closure - Old `update(bytes_downloaded, task_id=...)` API removed or made private ## Acceptance criteria - [ ] `start_download()` returns bound callable for TTY reporter, None for plain text - [ ] Bound callable updates the correct bar; no cross-bar contamination possible - [ ] No test outside `test_progress.py` references `task_id` - [ ] Orchestrator has zero closure-wiring code for progress - [ ] Parallel download tests pass without per-book closure binding - [ ] `complete()`/`fail()` still work correctly with internal task lookup ## Blocked by - #29 — needs final `download_book()` shape to verify orchestrator wiring
AlexKucera commented 2026-06-05 11:58:31 +02:00 (Migrated from github.com)

Issue #30 complete ✅ — 6/6 AC met, 382 tests pass (+11), committed as 1f46467.

Issue #30 complete ✅ — 6/6 AC met, 382 tests pass (+11), committed as `1f46467`.
Sign in to join this conversation.