Skip to content

fix(cli): correct package download progress bar math#440

Merged
joe-prosser merged 1 commit into
masterfrom
fix/package-progress-bar
May 5, 2026
Merged

fix(cli): correct package download progress bar math#440
joe-prosser merged 1 commit into
masterfrom
fix/package-progress-bar

Conversation

@joe-prosser
Copy link
Copy Markdown
Collaborator

@joe-prosser joe-prosser commented May 5, 2026

Summary

  • The IXP progress bar averaged three independent counters (num_comments, num_docs_downloaded, num_docs_written) and divided by three, then compared the result to an approximate up-front comment count. In practice this displayed e.g. 974 / 857 near the end of a download.
  • IXP bar now treats each comment as three units of work (fetch, doc-download, doc-write): total = total_comments * 3, position = sum of the three counters.
  • progress.rs now grows the bar's length when the live position overtakes the initial total, so current / total never inverts even if the up-front estimate is wrong. This also benefits the CM bar.

Test plan

  • cargo fmt --check -p reinfer-cli
  • cargo clippy -p reinfer-cli -- -D warnings
  • cargo test -p reinfer-cli --bin re (25/25 pass)
  • Manual: run re package download against an IXP project where the dataset statistics under-count comments; confirm the bar reaches but does not exceed 100%
  • Manual: run re package download against a CM project; confirm the bar still behaves sensibly

Notes

The IXP bar still over- or under-shoots when comments have ≠1 attachment (we don't know attachment count up front), but the new overflow handler in progress.rs absorbs that — the bar grows instead of inverting.

🤖 Generated with Claude Code

@joe-prosser joe-prosser self-assigned this May 5, 2026
The IXP progress bar averaged three independent counters (comments,
docs downloaded, docs written) and divided by three, then displayed
that against the up-front comment count from dataset statistics.
Because dataset statistics are approximate and not every comment
maps 1:1 to a downloaded+written doc, the displayed numerator could
exceed the total (e.g. "974 / 857").

- IXP bar now treats each comment as three units of work (fetch,
  doc-download, doc-write); total = total_comments * 3, position =
  sum of the three counters.
- progress.rs grows the bar's length when the live position
  overtakes the initial total, so the displayed "current / total"
  never inverts even when the up-front estimate is wrong (this
  also covers the CM bar).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joe-prosser joe-prosser force-pushed the fix/package-progress-bar branch from 7949f82 to 2bc6a0f Compare May 5, 2026 15:30
@joe-prosser joe-prosser merged commit dde99f9 into master May 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant