Skip to content

Add refund helper for review flow#1

Open
lyc-aon wants to merge 1 commit into
mainfrom
codex-review-e2e-20260506071851
Open

Add refund helper for review flow#1
lyc-aon wants to merge 1 commit into
mainfrom
codex-review-e2e-20260506071851

Conversation

@lyc-aon
Copy link
Copy Markdown
Owner

@lyc-aon lyc-aon commented May 6, 2026

Test PR for the lycaon.wtf Codex review intake E2E path. It intentionally keeps the diff tiny so the automation can review and post safely.

@lyc-aon
Copy link
Copy Markdown
Owner Author

lyc-aon commented May 6, 2026

AI-assisted Codex review

Generated from the public diff for #1, requested by @lyc-aon. Please verify findings before merging.

  • P1 calculator.js:5
    applyDiscountCents no longer enforces the previous 0 <= discountPercent <= 100 contract. With this change, inputs like applyDiscountCents(1000, 150) now return -500, and applyDiscountCents(1000, -10) returns 1100, instead of rejecting invalid discounts. That is a production-impact money calculation regression, and the prior invalid-discount test was removed at the same time, so CI will not catch it.

  • P1 calculator.js:13
    refundAmountCents accepts any finite numbers and returns Math.min(...) directly, which means it can emit negative refund amounts. For example, refundAmountCents(5000, -100) returns -100. A refund helper should not produce a negative amount for numeric input; it should reject or clamp invalid values. In payment/refund code, allowing negative refund amounts is unsafe and can invert the money flow depending on the caller.


Want a Codex review on your PR? Submit a public pull request here: https://lycaon.wtf/#codex-review

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