Problem
REFUND_AUTO_LIMIT="abc" parses to NaN, and since x > NaN is always false, the over-limit escalate branch never fires: every refund auto-resolves (fail-open).
Where
lib/policy.ts (Number(process.env.REFUND_AUTO_LIMIT ?? "50"), no finite check; existing tests cover only "10" and default).
Acceptance
Add a failing test first with REFUND_AUTO_LIMIT="abc", asserting a $640 refund escalates (or falls back to $50) instead of resolving. Then fix.
Problem
REFUND_AUTO_LIMIT="abc"parses toNaN, and sincex > NaNis always false, the over-limit escalate branch never fires: every refund auto-resolves (fail-open).Where
lib/policy.ts(Number(process.env.REFUND_AUTO_LIMIT ?? "50"), no finite check; existing tests cover only"10"and default).Acceptance
Add a failing test first with
REFUND_AUTO_LIMIT="abc", asserting a $640 refund escalates (or falls back to $50) instead of resolving. Then fix.