FAILURE MAP
← Case archive

FA-58027 / Double-entry ledger accounting / Member archive

Auto-reversing accruals: as-of inclusivity · case 02

Balances as of a date omit entries dated that day.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

x = {'period_end': day, 'as_of': day, 'entries': [[id, day, kind, account, signed amount]]}. Every entry of kind 'accrual' dated on or before period_end is reversed by a generated entry 'R-'+id dated period_end + 1 with the negated amount; regular and deferral entries and later accruals are not reversed. Balances include every original and generated row dated on or before as_of; an account with rows in range appears even if its balance is zero. Return {'reversals': [[id, day, amount]], 'balances': {account: amount}}.

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: as-of inclusivity{"balances": {"accrued_interest": 0, "accrued_wages": 250, "cash": 100}, "reversals": [["R-E1", 32, -100], ["R-E2", 32, 40], ["R-E4", 32, 40], ["R-E5", 32, -250]]}{"balances": {"accrued_interest": -100, "accrued_wages": 250, "cash": 100}, "reversals": [["R-E1", 32, -100], ["R-E2", 32, 40], ["R-E4", 32, 40], ["R-E5", 32, -250]]}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 ↗