Skip to content

Turn on the new discount engine - #20

Draft
agoldis wants to merge 2 commits into
demo/checkout-triagefrom
demo/checkout-triage-discount-engine
Draft

agoldis wants to merge 2 commits into
demo/checkout-triagefrom
demo/checkout-triage-discount-engine

Conversation

@agoldis

@agoldis agoldis commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Sets newDiscountEngine to true in evidence-sharing/checkout-triage/flags.json, so discount codes go through the new resolver.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
@agoldis

agoldis commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

SAVE10 fails on this branch. With newDiscountEngine on, ApplyDiscount takes the discount off twice: the total is $183.60, not $206.55.

Failing test, animated

Filmstrip of the failing test

Page at the failing step

Share link, 7 days

🤖 Generated with Claude Code

@agoldis

agoldis commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in abd6f49: the new discount engine takes the discount off once. SAVE10 passes on the run with the fix.

ApplyDiscount response for {"code":"save10"}, from each run's trace (amounts in cents):

Response
Before {"discount":2295,"total":18360} response · trace
After {"discount":2295,"total":20655} response · trace

🤖 Generated with Claude Code

@agoldis

agoldis commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

SAVE10 total, before and after the fix

Fixed in f4e8614: the new discount engine takes the discount off once. SAVE10 takes 10% off the total failed in run 267e78d4 and passes in run 19c532e5.

Before (92b4e82) After (f4e8614)
Screencast Before: the total changes from $229.50 to $183.60 After: the total changes from $229.50 to $206.55
Filmstrip Before: filmstrip up to the failure After: filmstrip
Total $183.60, expected $206.55 $206.55
Links trace · digest · page at the failure trace · digest · page at the end

ApplyDiscount response for {"code":"save10"}, amounts in cents (before, after):

- {"code":"SAVE10","percent":10,"discount":2295,"total":18360}
+ {"code":"SAVE10","percent":10,"discount":2295,"total":20655}

Order summary in the accessibility tree, before and after:

   - text: Subtotal
   - text: $229.50
   - text: Discount
   - text: −$22.95
   - text: Total
-  - text: $183.60
+  - text: $206.55

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