FA-57920 / Double-entry ledger accounting / Member archive
Period closing entries: oci routing · case 05
Unrealized OCI movements show up in net income.
Case contract
x = {'accounts': {name: [type, normal-signed balance]}, 'retained': opening retained earnings, 'aoci': opening accumulated OCI}. Temporary types are revenue, contra_revenue, expense, gain, loss, dividend and oci. Income summary = revenue - contra_revenue + gain - expense - loss and is net income. Retained earnings close = opening + net income - dividends. OCI closes to AOCI, never to income or retained earnings. 'closed' lists temporary accounts with a nonzero balance (including abnormal negative ones), sorted. Return {'net_income', 'retained', 'aoci', 'closed'}.
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: oci routing | {"aoci": 3300, "closed": ["cont_6", "divi_5", "expe_3", "expe_7", "loss_4", "oci_2"], "net_income": -6000, "retained": -6650} | {"aoci": 3300, "closed": ["cont_6", "divi_5", "expe_3", "expe_7", "loss_4", "oci_2"], "net_income": -9000, "retained": -9650} | 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 ↗