Repository navigation
test: validate fractional-progress finding - #23
Open
zehongye-gaga wants to merge 1 commit into
Open
zehongye-gaga wants to merge 1 commit into
zehongye-gaga wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| """ | ||
| if total < 0 or completed < 0 or completed > total: | ||
| raise ValueError("invalid review counts") | ||
| return completed // total if total else 1.0 |
There was a problem hiding this comment.
Blocking correctness issue: // truncates fractional progress, so completed_ratio(1, 2) returns 0 instead of 0.5. In fact, every partially completed batch reports zero. Use true division (/) to preserve fractional progress while retaining the empty-batch behavior.
Suggestion:
Suggested change
| return completed // total if total else 1.0 | |
| return completed / total if total else 1.0 |
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.
This is an isolated production-rollout acceptance PR in the dedicated OCR test repository. Do not merge it.
The code is a small offline Python helper for review progress, with standard-library unittest checks. It contains no credentials, network calls, or private application code. Existing repository rules and integration settings are unchanged.
Local check:
python3 -m unittest discover -s tests -p 'test_*.py'.Scenario: an intentional precision regression in the progress calculation. Integer floor division makes a half-complete batch report zero. Four local tests pass and the fractional-progress test fails with 0 != 0.5. Verify that the actual review identifies the changed-line defect and records its result/publication for this exact snapshot.