FA-58068 / Double-entry ledger accounting / Member archive
Account running balance report: line ordering key · case 03
Back-dated entries appear at the end of the ledger with wrong running balances.
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: line ordering key | {"closing": -320, "opening": -20, "rows": [[2, 5, -145], [4, 3, -20], [5, 5, -320]]} | {"closing": -320, "opening": -20, "rows": [[4, 3, 105], [2, 5, -20], [5, 5, -320]]} | 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 ↗