FAILURE MAP
← Case archive

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

Foreign currency period-end revaluation: liability gain sign · case 02

A weakening home currency reports a gain on foreign-currency payables.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

x = {'bid': [num, den], 'ask': [num, den], 'accounts': [[name, 'asset'|'liability', monetary, foreign units, carried home cents]]}. Monetary assets are revalued at the bid rate and monetary liabilities at the ask rate: home = foreign * num / den rounded half-up per account. Non-monetary accounts keep their carried amount. Unrealized gain sums (new - carried) for assets and (carried - new) for liabilities. Return {'balances': [[name, home]], 'unrealized_gain'}.

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: liability gain sign{"balances": [["a0", 6], ["a1", 1], ["a2", 9], ["a3", 4]], "unrealized_gain": -493}{"balances": [["a0", 6], ["a1", 1], ["a2", 9], ["a3", 4]], "unrealized_gain": 493}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 ↗