FA-58073 / Double-entry ledger accounting / Member archive
Account running balance report: report opening cutoff · case 03
Lines dated on the first report day are counted in the opening and again in the rows.
Case contract
x = {'normal': 'D'|'C', 'opening': balance before all lines, 'lines': [[seq, day, side, amount]], 'from': day, 'to': day}. Balances are signed positive on the normal side. The report opening is the opening plus every line dated before 'from'. Lines dated from..to inclusive are listed in (day, seq) order with the running balance after each; closing is the last running balance (the report opening if none). Return {'opening', 'rows': [[seq, day, running]], 'closing'}.
Why this case matters
Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: report opening cutoff | {"closing": 0, "opening": 125, "rows": [[3, 5, 0]]} | {"closing": 125, "opening": 250, "rows": [[3, 5, 125]]} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗