CheckoutGuard repair record

Expired coupon must be rejected

Repair fix_c4c0c1d1a9 · attempt 1 · branch cg/expired-coupon-c4c0c1d1a9 · 2026-11-25T08:42:51.924Z

✓ Verified: the same journey passed after the patch. A person discarded the patch instead of merging it.

1. The failure

Kane CLI run run_e7b5802230

Kane: an error message says the coupon has expired and no discount is applied
Expected an error message says the coupon has expired and no discount is applied, the page showed The cart accepted OLD20 and applied a 20% discount instead of showing that the coupon had expired..

2. The patch

Made by the coding agent in an isolated git worktree. Only files under store/src/ may change.

diff --git a/store/src/pricing.js b/store/src/pricing.jsindex ee3422e..7a238bf 100644--- a/store/src/pricing.js+++ b/store/src/pricing.js@@ -16,6 +16,10 @@ export function subtotal(lines) { export function checkCoupon(code, today = new Date()) {   const coupon = COUPONS[String(code || "").trim().toUpperCase()];   if (!coupon) return { ok: false, reason: "That coupon code doesn't exist" };+  // Valid through the end of its expiry date (compared as YYYY-MM-DD, UTC).+  if (coupon.expires && today.toISOString().slice(0, 10) > coupon.expires) {+    return { ok: false, reason: `That coupon expired on ${coupon.expires}` };+  }   return { ok: true, percentOff: coupon.percentOff }; }

3. Unit checks

Unit checks: 3 passing, 4 failing.
Newly passing: expired coupons are rejected and give no discount
Newly failing: none

4. The same journey, rerun

Kane CLI run run_e615db2a42: passed

Before and after

Before

After

Generated by CheckoutGuard. Payments in the demo store use a fake provider; nothing was charged.