CheckoutGuard repair record

Cart total with several of one item

Repair fix_7ac76b465e · attempt 1 · branch cg/cart-total-7ac76b465e · 2026-11-25T08:39:11.367Z

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

1. The failure

Kane CLI run run_5a45ec8a1d

Kane: the Subtotal is $54.00
Expected the Subtotal is $54.00, the page showed After the mug quantity changed to 3, the cart still displayed a subtotal of $18.00 instead of $54.00..

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..477103f 100644--- a/store/src/pricing.js+++ b/store/src/pricing.js@@ -7,7 +7,7 @@ export function subtotal(lines) {   for (const line of lines) {     const product = productById(line.productId);     if (!product) continue;-    cents += product.priceCents;+    cents += product.priceCents * line.qty;   }   return cents; }

3. Unit checks

Unit checks: 5 passing, 2 failing.
Newly passing: subtotal multiplies each price by its quantity; shipping is $5 under $100 and free from $100; SAVE10 takes 10% off the subtotal
Newly failing: none

4. The same journey, rerun

Kane CLI run run_d918236bf2: passed

Before and after

Before

After

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