Conservative review scoring still needs valid inputs
Keeping invalid chunk scores out of PR-Agent’s review reduction.
The problem
PR-Agent combines chunked review results conservatively by selecting the lowest score. A negative or out-of-range value could win over valid scores and leave the merged review outside its expected 0–100 score range.
Before
Scores [-10, 60, 80] could reduce to -10, even though -10 is outside the score contract.
After
Among parsed scores in the inclusive 0–100 range, choose the lowest. The same example reduces to 60, and a valid zero still wins. When no usable score exists, retain the existing diagnostic fallback.
The contribution
The merged reducer now filters values to the allowed range before choosing a minimum. Parameterized tests cover invalid negative and over-100 values, including string forms, plus a valid-zero control.
Validation and provenance
The PR records 69 focused tests passing on the exact candidate head. Its combined-campaign suite figures are not attributed to this patch in isolation. This case study independently rechecked authorship, merged state and the diff on November 4, 2026; historical tests were not rerun for this page.
What this does not establish
The change constrains score aggregation; it does not establish that an AI-generated review score is accurate, calibrated or fair. Hosted CI success, production rollout and customer outcomes are separate questions.
Engineering lesson
A conservative aggregator can still be wrong when invalid inputs dominate. Validate the score contract before applying the reduction rule, and preserve valid boundary values such as zero.
Inspect the evidence
Merged pull request and original validation narrative · Immutable merge commit · Source at that commit