Skip to content

test(fx): address CodeRabbit nits on conservation tests#261

Merged
GeiserX merged 1 commit into
mainfrom
fix/fx-conservation-test-nits
Jun 22, 2026
Merged

test(fx): address CodeRabbit nits on conservation tests#261
GeiserX merged 1 commit into
mainfrom
fix/fx-conservation-test-nits

Conversation

@GeiserX

@GeiserX GeiserX commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Addresses both CodeRabbit findings on #260 (test-only, no production change):

  1. Decimal-safe test inputs — the Op helper tuples typed amounts/rates as JS number; now decimal strings (Money = string), honoring the repo's Financial Precision rule (never Number for amounts/rates). toEvents already wraps each in new Decimal(...), so all figures are numerically identical (160.00/320.00/680.00… unchanged).
  2. Diagnostic-only test now covers both branches — its title says "whether or not a mismatch is emitted" but it only tested the clean run. It now forces a real fx.conservation_mismatch via BreakableEngine and asserts the disposals/gain stay byte-identical after emission.

Verified: typecheck:tests clean, lint clean, conservation suite 19/19. No engine or tax-figure change.

- Op test-helper tuples now use decimal strings (Money = string) instead of
  JS number literals, honoring the Financial Precision rule (never Number for
  amounts/rates). toEvents already wraps each in new Decimal(...); figures are
  numerically identical (160.00/320.00/... unchanged).
- The DIAGNOSTIC-ONLY test now exercises BOTH branches its title promises: it
  forces a real fx.conservation_mismatch via BreakableEngine and asserts the
  disposals/gain stay byte-identical after emission.

Test-only; no production code or tax figure changes.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@GeiserX, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 50 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 754113d5-63e1-4993-8b7c-31fa41e28507

📥 Commits

Reviewing files that changed from the base of the PR and between b993a19 and b7a0b2d.

📒 Files selected for processing (1)
  • tests/engine/fx-conservation.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fx-conservation-test-nits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GeiserX GeiserX merged commit 2c10a6a into main Jun 22, 2026
5 checks passed
@GeiserX GeiserX deleted the fix/fx-conservation-test-nits branch June 22, 2026 12:01
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