Repository navigation
docs: correct stale Decimal Precision section (#1240 resolved) - #1614
Merged
Merged
Conversation
CLAUDE.md still described rust_decimal's 28-digit ceiling as an open compat failure with a TODO to migrate to bigdecimal. That's stale: `main` already resolves #1240 with a two-tier balance validator (calculate_residual -> calculate_residual_precise), and `rledger check` now reports the some_fund 2.1875E-25 USD residual. Decimal stays rust_decimal. Rewrite the section to describe the two-tier validator, move the over-precise residual case into the 'Fixable' compat bucket, narrow the 'Not fixable' note to over-precise *literals* (a non-issue, no real ledger has them), and record that the literal-recovery side channel was prototyped and rejected (PR #1613) so it isn't re-attempted. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates CLAUDE.md to remove stale guidance about rust_decimal precision being an unresolved compatibility failure, and to document the current two-tier balance validation approach that detects ultra-small residuals (closing #1240’s original symptom) while keeping rust_decimal for performance.
Changes:
- Reclassifies “over-precise residuals” as fixable and documents the two-tier residual computation (fast
Decimal, escalatedBigDecimal). - Narrows the “not fixable” limitation to over-precise literals (>~28–29 significant digits) and notes the rejected side-channel prototype (PR #1613).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Per Copilot review: the two-tier escalation logic lives in rustledger-validate (validate_transaction_balance), not rustledger-booking (which only provides calculate_residual / calculate_residual_precise); and align the '28-digit ceiling' wording with the '~28-29 significant digits' phrasing used in the section below. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CLAUDE.md's Known Limitations → Decimal Precision section still described
rust_decimal's 28-digit ceiling as an open compatibility failure ("1 compat test failure", "Rust considers it balanced") with a TODO to migrate tobigdecimal. That is stale.Why
mainalready resolves #1240 with a two-tier balance validator inrustledger-booking(calculate_residual→calculate_residual_precise). Verified on the affected fixture:So rledger now detects exactly the residual the doc claimed it missed.
Decimalremainsrust_decimal— the fix is the validator, not the type.Changes (docs only)
2.1875E-25 USDdetection.No code changes.
🤖 Generated with Claude Code