2Tax must be computed on the discounted total, never the raw subtotal.
src/checkout/total.ts
-1const tax = taxFor(discounted)
+1const tax = taxFor(subtotal)
Problem
implement spec/invariants/tax-after-discount
Reading the spec, then wiring it into checkout.
Refactored the total — cleaner now.
INVARIANT GUARDRAIL: you claim tax-after-discount holds, but no passing `// sr:invariant-test tax-after-discount` ran this turn. Write the test and run it, or the claim can't be trusted.