FAILURE MAP
← Case archive

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

Auto-reversing accruals: reversal date · case 03

Accruals cancel themselves inside the period they were meant to accrue.

Member previewVariant 3 · 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: reversal date{"balances": {"accrued_interest": 100, "accrued_wages": 700}, "reversals": [["R-E2", 28, 40], ["R-E3", 28, -100], ["R-E4", 28, -700]]}{"balances": {"accrued_interest": 100, "accrued_wages": 700}, "reversals": [["R-E2", 29, 40], ["R-E3", 29, -100], ["R-E4", 29, -700]]}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 ↗