fix(cli): correct package download progress bar math#440
Merged
Conversation
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>
7949f82 to
2bc6a0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 / 857near the end of a download.total = total_comments * 3, position = sum of the three counters.progress.rsnow grows the bar's length when the live position overtakes the initial total, socurrent / totalnever inverts even if the up-front estimate is wrong. This also benefits the CM bar.Test plan
cargo fmt --check -p reinfer-clicargo clippy -p reinfer-cli -- -D warningscargo test -p reinfer-cli --bin re(25/25 pass)re package downloadagainst an IXP project where the dataset statistics under-count comments; confirm the bar reaches but does not exceed 100%re package downloadagainst a CM project; confirm the bar still behaves sensiblyNotes
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.rsabsorbs that — the bar grows instead of inverting.🤖 Generated with Claude Code