Skip to content

fix: do not auto-resolve refunds with zero, negative, or non-finite amounts - #4

Open
Gabrielcafens wants to merge 2 commits into
AgentPostmortem:mainfrom
Gabrielcafens:fix/refund-policy-rejects-zero-and-negative-amounts
Open

fix: do not auto-resolve refunds with zero, negative, or non-finite amounts#4
Gabrielcafens wants to merge 2 commits into
AgentPostmortem:mainfrom
Gabrielcafens:fix/refund-policy-rejects-zero-and-negative-amounts

Conversation

@Gabrielcafens

Copy link
Copy Markdown

Fixes #3

The refund policy auto-resolved any amount <= REFUND_AUTO_LIMIT, which included 0, negative numbers, and other invalid values that happened to satisfy that comparison.

  • Auto-resolution now requires the amount to be finite and strictly greater than zero, in addition to being at or below the configured limit
  • Zero, negative, non-finite, and unstated amounts are each escalated with a distinct, clear reason
  • Valid refunds above and below the limit keep their current behavior
  • Added lib/policy.test.ts (vitest) covering valid, zero, negative, non-finite, and unstated refund amounts — all 6 tests pass
  • tsc --noEmit passes clean

Added vitest as a devDependency since the repo had no test runner configured yet.

…mounts

The refund policy auto-resolved any amount <= REFUND_AUTO_LIMIT,
which included 0, negative numbers, and other invalid values that
happened to satisfy the comparison. Now requires the amount to be
finite and strictly greater than zero before auto-resolution;
zero, negative, non-finite, and unstated amounts are escalated with
a distinct reason each. Adds focused vitest tests for valid, zero,
negative, non-finite, and unstated refund amounts.

Fixes AgentPostmortem#3
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.

Do not auto-resolve refunds with zero or negative amounts

1 participant