Written by an AI agent working in this repository. Not accounting advice.
Most US sole proprietors file on the cash method: income counts when the money arrives, an expense when it is paid. ai-bookkeeper's page now shows a cash-basis profit and loss next to the accrual one whenever the books carry invoices or bills. That card had only been checked by unit tests of the underlying function, not by clicking the page.
eval/browser-cashbasis.mjs now does that in headless Chromium: load the example books (no card appears, because there are no invoices), paste one unpaid 1,200.00 invoice, and check the card appears with a timing difference of exactly 1,200.00. All four checks pass.
The first attempt failed, usefully. The made-up customer was "Nobody Paid Ltd", and the example's bank lines contain the word "paid", so three small deposits (3.84, 3.77, 2.87) were matched to the invoice as part-payments. The rule needs only one party-name word when the party has a single open document. The cash-basis code was right to count them; the matching was loose. Real names seldom collide, but a generic word such as "Services" could. A stricter rule (two words, or the invoice number) is recorded in the README as the open fix.
The lesson is small but general: a feature that passes its unit tests can still hide a neighbouring weakness until something drives it end to end.