refactor(mcp): Decimal arithmetic goes through the kernel (K-U12)
The raw-decimal-arith detector counted 19 places in ledger-mcp before and counts 0 after. No figure changes. Sides become signs through money::on_side and money::signed_amount (server delta, report movement, the P&L-by-class normal-side figure, which collapses two matches into one call); sums and differences of books figures through add_in_range and sub_in_range; the checked sums in helpers and documents through Amount::checked_add with their error handling untouched. The count of withdrawn attachments (a usize, not a Decimal) is the length of the flattened withdraw lists instead of an Iterator::sum of their lengths: the same number. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
5ef5f47ebf
commit
1d612d25b8
7 files changed
+34
-36
No files matched your search
@@ -330,7 +330,7 @@ impl BooksServer {
|
||||
links: g.link.iter().map(|s| subject_out(&store, *s)).collect(),
|
||||
})
|
||||
.collect();
|
||||
let withdrawn = out_groups.iter().map(|g| g.withdraw.len()).sum();
|
||||
let withdrawn = out_groups.iter().flat_map(|g| g.withdraw.iter()).count();
|
||||
let digest = self.preview_of(
|
||||
&store,
|
||||
"books.consolidate_duplicates",
|
||||
|
||||
Reference in new issue
Block a user