Repository navigation
feat(cli): honest download-metered bundle pull progress with reconstruction + discovery states - #2097
Conversation
…uction + discovery states (#2096) After shared-chunk coalescing (#2095) the progress display misled: the total bar was denominated by the whole content size and credited spliced-from-disk bytes, so a dedup'd pull read "25.6/25.66 GiB, ETA 1s" while only ~14.8 GB was actually transferred; the tail whole-file verify (hashing a multi-GB blob) ran with no callback and looked frozen; and a blob stalled on discovery hid behind a near-full total. Now: - The total bar meters the run's DOWNLOAD — the bytes actually fetched after dedup (`download_bytes`, computed up front from the fetch plan) — and only delivered bytes fold into it, capped per file at its download size, so its rate and ETA describe real transfer. A one-line header shows `<dir> · <download> to download · <content> on disk`, making the dedup saving visible. - Each per-file row reads `downloaded/download-total (reconstructed)` plus a phase word: `discovering…` before the first byte, `pending siblings…` while a deferred chunk is still being fetched by its holder, and `reconstructing…` during the whole-file verify — which now streams its running byte count into the bar so a multi-GB reconstruction never sits frozen (`hash_partial_with_progress`). No wire/protocol change; progress rendering only. Follow-up to #2094/#2095. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Per-file progress currently breaks for manifest entries without a declared size (explicitly allowed by the manifest format), yielding non-moving/meaningless rows instead of falling back to the stream’s expected length for display.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR updates decdn bundle pull’s progress rendering to meter actual downloaded bytes after shared-chunk coalescing, and to make previously “invisible” phases (discovery, deferred-wait, and reconstruction/verify) explicit in the UI. It primarily refactors the CLI progress renderer and threads it through bundle-pull’s dedup/reassembly path, including adding a byte-count progress reporter to the whole-file BLAKE3 verification step.
Changes:
- Compute a run-level
download_bytestotal (dedup-aware) and show a header comparing “to download” vs “on disk”. - Replace per-file bars with phase-aware rows (
discovering…,pending siblings…,reconstructing…) and meter per-file progress against planned download bytes. - Add
hash_partial_with_progressso whole-file verification advances the per-file bar during reconstruction.
| File | Description |
|---|---|
| crates/cli/src/commands/pull_progress.rs | Redesignes total/per-file progress rendering to be download-metered and phase-aware, and adds reconstruction progress reporting. |
| crates/cli/src/commands/fetch.rs | Removes now-unused progress style helper and SpeedState::shift support that was tied to the old “credit skipped bytes” approach. |
| crates/cli/src/commands/bundle_pull.rs | Computes download totals from the manifest fetch plan, threads FileBar through dedup/reassembly, and reports discovery/pending/reconstruction phases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 83.74% (was 83.60%, ▲ +0.14%) — 86586/103403 lines
History
|
…splay An entry the manifest declares no size for has download_total 0, so its per-file bar length stayed 0 and never moved. The row now borrows the stream's `expected` length for display once delivery starts, so it tracks progress like any other row — while still contributing nothing to the total bar's download meter (the fold is capped at download_total, which is 0 for an unsized entry). The counts render as a bare delivered figure when no size is known, rather than `x/0 B`. Co-Authored-By: Claude Opus 4.8 <[email protected]>

Closes #2096. Follow-up to #2094 / #2095 (shared-chunk coalescing).
Problem
After coalescing, the pull progress lied: the total bar was denominated by the whole content size and credited spliced-from-disk bytes, so a dedup'd pull read
25.6/25.66 GiB, ETA 1swhile only ~14.8 GB was actually transferred; the tail whole-file BLAKE3 verify (a multi-GB hash) ran with no callback and looked frozen; and a blob stalled on discovery (thetokenizer.jsoncase) hid behind a near-full total.Change
download_bytes— the bytes actually fetched after dedup, each shared chunk counted once under its assigned holder, computed up front from the fetch plan. Only delivered bytes fold in (per-file, capped at that file's download size); splices never inflate it, so rate/ETA describe real transfer. A one-line header shows<dir> · <download> to download · <content> on disk.downloaded/download-total (reconstructed)+ a phase word:discovering…before the first byte,pending siblings…while a deferred chunk is still being fetched by its holder,reconstructing…during the whole-file verify — which now streams its running byte count into the bar (hash_partial_with_progress) so a multi-GB reconstruction never sits frozen.No wire/protocol change — progress rendering only.
Tests
download_bytes/blob_download_reconstruct: a shared chunk is counted once, so download < on-disk.reconstructing…spans the whole blob and tracks hashed bytes;pending siblings…marks the download done.decdn-clisuite green (739);cargo clippy --workspace --all-targets --all-features,cargo fmt --check, rustdoc-D warningsall clean.🤖 Generated with Claude Code