Skip to content

test: validate fractional-progress finding - #23

Open
zehongye-gaga wants to merge 1 commit into
mainfrom
test/unified-rollout-20261115-finding
Open

zehongye-gaga wants to merge 1 commit into
mainfrom
test/unified-rollout-20261115-finding

Conversation

@zehongye-gaga

Copy link
Copy Markdown
Collaborator

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.

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Review complete · 749dddf

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
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

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