Repository navigation
next-campaigns-create 1.3.1: round each unit's discount up to the cent in landed-price forecasts - #92
Conversation
… to the cent, as the cart engine does
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Verified correct
Fix these issues in Kilo Cloud Previous Review Summaries (3 snapshots, latest commit 44d986e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 44d986e)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Verified correct
Fix these issues in Kilo Cloud Previous review (commit 64d52ad)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (11 files)
Verified correct
Fix these issues in Kilo Cloud Previous review (commit 5d5da11)Status: 8 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (9 files)
Also read for context (not changed by this PR): Verified correct
Reviewed by minimax-m3 · Input: 63.1K · Output: 2.5K · Cached: 597.5K |
…nned edit test distinct, add a case that tells the rounding rules apart
…age hint prices with the plan's --rounding
…n ending cannot put it a dollar off
landed_unitrounded each unit's percentage discount to the nearest cent. The cart engine rounds it up to the cent, so a forecast could come out a cent too high per unit. With aprice_roundingending, it could come out a dollar too high.Evidence
carts/calculateon 2026-11-07, for a campaign whose offers haveprice_rounding: null:Rounding to the nearest cent can't produce the first two. Rounding up gives all three.
Eight discounted lines from recorded
calculatefixtures elsewhere also fit rounding up: 7 of 8 directly. The eighth ends in .99, which fits rounding up if that offer had a .99 ending (its settings aren't in the recording). Rounding to the nearest cent fits 4 of 8.verifydidn't catch this because it allows a one-cent-per-unit tolerance.What changes
landed_unit: quantizes the discount withROUND_CEILING. Theprice_roundingstep is unchanged..99ending, 52% off 49.99 now forecasts 23.99, not 24.99, because the up-rounded unit drops below the whole dollar.offer-doctrine.md(a new rounding bullet with the evidence, the buy-2-get-1 and voucher examples),worked-examples.md,admin-api-contract.md,SKILL.md, and one rationale string now say "rounded up to the cent".Patch release, 1.3.0 → 1.3.1.
Verification
python3 -m pytest next-campaigns-create/tests: 736 passed. That includes a newLandedUnitRoundingtest pinning the threecalculateprices above.scripts/check_skill_versions.py --base origin/mainpasses.scripts/check_public_safety.pypasses.