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
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
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
Change
start_download(book)to return a bound callable that already targets the correct progress bar. Task identity becomes fully internal toProgressReporter. Orchestrator no longer creates closures.End state:
ProgressReporter.start_download(book)returnsCallable[[int], None]bound to the correct taskPlainTextReporter.start_download(book)returnsNonetask_id) is never exposed outsideprogress.pycomplete(book)andfail(book, reason)look up task id internally viaid(book)_progress(completed)closureupdate(bytes_downloaded, task_id=...)API removed or made privateAcceptance criteria
start_download()returns bound callable for TTY reporter, None for plain texttest_progress.pyreferencestask_idcomplete()/fail()still work correctly with internal task lookupBlocked by
download_book()shape to verify orchestrator wiringIssue #30 complete ✅ — 6/6 AC met, 382 tests pass (+11), committed as
1f46467.