mcp: P&L by class no longer counts closing entries; oracle tests for every tool's output
check / check (push) Waiting to run

profit_and_loss_by_class re-added every posted entry in the range,
closing entries included: after closing January, its by-class P&L for
January showed an unclassified row of the whole period's net income,
negated. Closing entries are left out, as profit_and_loss_for_period
leaves them out.

tests/oracle_mcp.rs (24 tests): every export (CSV, JSON, XLSX, PDF,
IIF) against ledger-core's reports on the same books; the CPA package's
contents; P&L by class; the 1099 worksheet; disposals; depreciation;
payroll remittance; the digest against the journal; books.show's viewer
commands; resources; receipts and documents round-tripping; the 25 MiB
upload limit; bank import sides; reference resolution; partial FX lines;
preview balances. Written against the mutation run's 126 survivors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GWVo7x3UHw5kwCUaWxiejX
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-14 17:14:27 -06:00
1 parent d1cbd845c0
commit f0fc725ca2
2 files changed
+2726 -1

No files matched your search

+5 -1
View File
@@ -3666,8 +3666,12 @@ impl BooksServer {
expenses: Decimal,
}
let mut by_class: HashMap<Option<u32>, Acc> = HashMap::new();
// A closing entry isn't income or spending (rules.md B-11): left
// out, as profit_and_loss_for_period leaves it out (found by
// pnl_by_class_excludes_closing_entries, 2026-10-14).
let closings = ledger.closing_entry_ids();
for entry in ledger.posted_entries() {
if entry.date() < start || entry.date() > end {
if entry.date() < start || entry.date() > end || closings.contains(&entry.id()) {
continue;
}
for line in entry.lines() {
File diff suppressed because it is too large. Load diff